mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-09 19:13:26 +03:00
memcachedTestHook: init
This commit is contained in:
parent
aa01fb4e17
commit
74c386d399
4 changed files with 139 additions and 0 deletions
53
doc/hooks/memcached-test-hook.section.md
Normal file
53
doc/hooks/memcached-test-hook.section.md
Normal file
|
@ -0,0 +1,53 @@
|
|||
|
||||
# `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
|
||||
''
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue