nixpkgs/doc/hooks/memcached-test-hook.section.md

56 lines
758 B
Markdown
Raw Normal View History

2025-01-16 22:13:36 +01:00
# `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
2025-04-08 17:36:13 +02:00
{
checkPhase = ''
2025-01-16 22:13:36 +01:00
runHook preCheck
# ... your tests
runHook postCheck
2025-04-08 17:36:13 +02:00
'';
}
2025-01-16 22:13:36 +01:00
```
## 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 = ''
2025-04-08 17:36:13 +02:00
memcachedTestPort=1234;
'';
2025-01-16 22:13:36 +01:00
}