mirror of
https://github.com/NixOS/nix.git
synced 2024-11-22 14:52:55 +00:00
Add a test for --check / --repeat
This commit is contained in:
parent
0c95776c3e
commit
87e3d142cc
12
tests/check.nix
Normal file
12
tests/check.nix
Normal file
@ -0,0 +1,12 @@
|
||||
with import ./config.nix;
|
||||
|
||||
{
|
||||
nondeterministic = mkDerivation {
|
||||
name = "nondeterministic";
|
||||
buildCommand =
|
||||
''
|
||||
mkdir $out
|
||||
date +%s.%N > $out/date
|
||||
'';
|
||||
};
|
||||
}
|
18
tests/check.sh
Normal file
18
tests/check.sh
Normal file
@ -0,0 +1,18 @@
|
||||
source common.sh
|
||||
|
||||
clearStore
|
||||
|
||||
nix-build dependencies.nix --no-out-link
|
||||
nix-build dependencies.nix --no-out-link --check
|
||||
|
||||
nix-build check.nix -A nondeterministic --no-out-link
|
||||
(! nix-build check.nix -A nondeterministic --no-out-link --check 2> $TEST_ROOT/log)
|
||||
grep 'may not be deterministic' $TEST_ROOT/log
|
||||
|
||||
clearStore
|
||||
|
||||
nix-build dependencies.nix --no-out-link --repeat 3
|
||||
|
||||
(! nix-build check.nix -A nondeterministic --no-out-link --repeat 1 2> $TEST_ROOT/log)
|
||||
grep 'differs from previous round' $TEST_ROOT/log
|
||||
|
@ -21,7 +21,8 @@ nix_tests = \
|
||||
signing.sh \
|
||||
run.sh \
|
||||
brotli.sh \
|
||||
pure-eval.sh
|
||||
pure-eval.sh \
|
||||
check.sh
|
||||
# parallel.sh
|
||||
|
||||
install-tests += $(foreach x, $(nix_tests), tests/$(x))
|
||||
|
Loading…
Reference in New Issue
Block a user