mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-25 15:26:17 +02:00
* Add a precise test for hashDerivatioModulo.
This commit is contained in:
parent
4f3725b167
commit
88e54153dc
3 changed files with 34 additions and 0 deletions
|
@ -27,6 +27,7 @@ $(TESTS): common.sh
|
|||
|
||||
EXTRA_DIST = $(TESTS) \
|
||||
simple.nix.in simple.builder.sh \
|
||||
hash-check.nix.in \
|
||||
dependencies.nix.in dependencies.builder*.sh \
|
||||
locking.nix.in locking.builder.sh \
|
||||
parallel.nix.in parallel.builder.sh \
|
||||
|
|
29
tests/hash-check.nix
Normal file
29
tests/hash-check.nix
Normal file
|
@ -0,0 +1,29 @@
|
|||
let {
|
||||
|
||||
input1 = derivation {
|
||||
name = "dependencies-input-1";
|
||||
system = "i086-msdos";
|
||||
builder = "/bar/sh";
|
||||
args = ["-e" "-x" ./dependencies.builder1.sh];
|
||||
};
|
||||
|
||||
input2 = derivation {
|
||||
name = "dependencies-input-2";
|
||||
system = "i086-msdos";
|
||||
builder = "/bar/sh";
|
||||
args = ["-e" "-x" ./dependencies.builder2.sh];
|
||||
outputHashMode = "recursive";
|
||||
outputHashAlgo = "md5";
|
||||
outputHash = "ffffffffffffffffffffffffffffffff";
|
||||
};
|
||||
|
||||
body = derivation {
|
||||
name = "dependencies";
|
||||
system = "i086-msdos";
|
||||
builder = "/bar/sh";
|
||||
args = ["-e" "-x" (./dependencies.builder0.sh + "/FOOBAR/../.")];
|
||||
input1 = input1 + "/.";
|
||||
inherit input2;
|
||||
};
|
||||
|
||||
}
|
|
@ -17,3 +17,7 @@ if test "$text" != "Hello World!"; then exit 1; fi
|
|||
# be deleteable.
|
||||
$nixstore --delete $outPath
|
||||
if test -e $outPath/hello; then false; fi
|
||||
|
||||
if test "$(NIX_STORE_DIR=/foo $nixinstantiate --readonly-mode hash-check.nix)" != "/foo/4hgkkq63lp8x5kmh9cmsyqimq5v42zzl-dependencies.drv"; then
|
||||
echo "hashDerivationModulo appears broken"
|
||||
fi
|
||||
|
|
Loading…
Reference in a new issue