Skip to content
Snippets Groups Projects
Commit a7bbe739 authored by Eelco Dolstra's avatar Eelco Dolstra
Browse files

* Another test.

parent ef093aac
No related branches found
No related tags found
No related merge requests found
......@@ -10,10 +10,12 @@ TESTS_ENVIRONMENT = TEST_ROOT=$(TEST_ROOT) \
$(SHELL) -e -x
simple.sh: simple.nix
dependencies.sh: dependencies.nix
TESTS = init.sh simple.sh
TESTS = init.sh simple.sh dependencies.sh
include ../substitute.mk
EXTRA_DIST = $(TESTS) \
simple.nix.in simple.builder.sh
simple.nix.in simple.builder.sh \
dependencies.nix.in dependencies.builder*.sh
export PATH=/bin:/usr/bin:$PATH
mkdir $out
echo $(cat $input1/foo)$(cat $input2/bar) > $out/foobar
ln -s $input2 $out/input-2
\ No newline at end of file
export PATH=/bin:/usr/bin:$PATH
mkdir $out
echo FOO > $out/foo
export PATH=/bin:/usr/bin:$PATH
mkdir $out
echo BAR > $out/bar
let {
input1 = derivation {
name = "dependencies-input-1";
system = "@system@";
builder = "@shell@";
args = ["-e" "-x" ./dependencies.builder1.sh];
};
input2 = derivation {
name = "dependencies-input-2";
system = "@system@";
builder = "@shell@";
args = ["-e" "-x" ./dependencies.builder2.sh];
};
body = derivation {
name = "dependencies";
system = "@system@";
builder = "@shell@";
args = ["-e" "-x" ./dependencies.builder0.sh];
inherit input1 input2;
};
}
\ No newline at end of file
storeExpr=$($TOP/src/nix-instantiate/nix-instantiate dependencies.nix)
echo "store expr is $storeExpr"
outPath=$($TOP/src/nix-store/nix-store -qnfvvvvv "$storeExpr")
echo "output path is $outPath"
text=$(cat "$outPath"/foobar)
if test "$text" != "FOOBAR"; then exit 1; fi
deps=$($TOP/src/nix-store/nix-store -qnR "$storeExpr")
echo "output closures are $deps"
# The output path should be in the closure.
echo "$deps" | grep -q "$outPath"
# Input-1 is not retained.
if echo "$deps" | grep -q "dependencies-input-1"; then exit 1; fi
# Input-2 is retained.
echo "$deps" | grep -q "dependencies-input-2"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment