Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1 2# `memcachedTestHook` {#sec-memcachedTestHook} 3 4This hook starts a Memcached server during `checkPhase`. Example: 5 6```nix 7{ stdenv, memcachedTestHook }: 8stdenv.mkDerivation { 9 10 # ... 11 12 nativeCheckInputs = [ memcachedTestHook ]; 13} 14``` 15 16If you use a custom `checkPhase`, remember to add the `runHook` calls: 17```nix 18{ 19 checkPhase = '' 20 runHook preCheck 21 22 # ... your tests 23 24 runHook postCheck 25 ''; 26} 27``` 28 29## Variables {#sec-memcachedTestHook-variables} 30 31Bash-only variables: 32 33 - `memcachedTestPort`: Port to use by Memcached. Defaults to `11211` 34 35Example usage: 36 37```nix 38{ stdenv, memcachedTestHook }: 39stdenv.mkDerivation { 40 41 # ... 42 43 nativeCheckInputs = [ memcachedTestHook ]; 44 45 preCheck = '' 46 memcachedTestPort=1234; 47 ''; 48} 49```