mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-10 03:23:29 +03:00
54 lines
749 B
Markdown
54 lines
749 B
Markdown
![]() |
|
||
|
# `memcachedTestHook` {#sec-memcachedTestHook}
|
||
|
|
||
|
This hook starts a Memcached server during `checkPhase`. Example:
|
||
|
|
||
|
```nix
|
||
|
{
|
||
|
stdenv,
|
||
|
memcachedTestHook,
|
||
|
}:
|
||
|
stdenv.mkDerivation {
|
||
|
|
||
|
# ...
|
||
|
|
||
|
nativeCheckInputs = [
|
||
|
memcachedTestHook
|
||
|
];
|
||
|
}
|
||
|
```
|
||
|
|
||
|
If you use a custom `checkPhase`, remember to add the `runHook` calls:
|
||
|
```nix
|
||
|
checkPhase ''
|
||
|
runHook preCheck
|
||
|
|
||
|
# ... your tests
|
||
|
|
||
|
runHook postCheck
|
||
|
''
|
||
|
```
|
||
|
|
||
|
## Variables {#sec-memcachedTestHook-variables}
|
||
|
|
||
|
Bash-only variables:
|
||
|
|
||
|
- `memcachedTestPort`: Port to use by Memcached. Defaults to `11211`
|
||
|
|
||
|
Example usage:
|
||
|
|
||
|
```nix
|
||
|
{ stdenv, memcachedTestHook }:
|
||
|
stdenv.mkDerivation {
|
||
|
|
||
|
# ...
|
||
|
|
||
|
nativeCheckInputs = [
|
||
|
memcachedTestHook
|
||
|
];
|
||
|
|
||
|
preCheck = ''
|
||
|
memcachedTestPort=1234
|
||
|
''
|
||
|
}
|