2006-10-19 17:44:51 +00:00
|
|
|
source common.sh
|
|
|
|
|
|
|
|
RESULT=$TEST_ROOT/result
|
|
|
|
|
2011-10-10 21:32:34 +00:00
|
|
|
dep=$(nix-build -o $RESULT check-refs.nix -A dep)
|
2006-10-19 17:44:51 +00:00
|
|
|
|
|
|
|
# test1 references dep, not itself.
|
2011-10-10 21:32:34 +00:00
|
|
|
test1=$(nix-build -o $RESULT check-refs.nix -A test1)
|
2014-08-21 19:50:19 +00:00
|
|
|
(! nix-store -q --references $test1 | grep -q $test1)
|
2011-10-10 21:32:34 +00:00
|
|
|
nix-store -q --references $test1 | grep -q $dep
|
2006-10-19 17:44:51 +00:00
|
|
|
|
|
|
|
# test2 references src, not itself nor dep.
|
2011-10-10 21:32:34 +00:00
|
|
|
test2=$(nix-build -o $RESULT check-refs.nix -A test2)
|
2014-08-21 19:50:19 +00:00
|
|
|
(! nix-store -q --references $test2 | grep -q $test2)
|
|
|
|
(! nix-store -q --references $test2 | grep -q $dep)
|
2011-10-10 21:32:34 +00:00
|
|
|
nix-store -q --references $test2 | grep -q aux-ref
|
2006-10-19 17:44:51 +00:00
|
|
|
|
|
|
|
# test3 should fail (unallowed ref).
|
2014-08-21 19:50:19 +00:00
|
|
|
(! nix-build -o $RESULT check-refs.nix -A test3)
|
2006-10-19 17:44:51 +00:00
|
|
|
|
|
|
|
# test4 should succeed.
|
2011-10-10 21:32:34 +00:00
|
|
|
nix-build -o $RESULT check-refs.nix -A test4
|
2006-10-19 17:44:51 +00:00
|
|
|
|
|
|
|
# test5 should succeed.
|
2011-10-10 21:32:34 +00:00
|
|
|
nix-build -o $RESULT check-refs.nix -A test5
|
2006-10-19 17:44:51 +00:00
|
|
|
|
|
|
|
# test6 should fail (unallowed self-ref).
|
2014-08-21 19:50:19 +00:00
|
|
|
(! nix-build -o $RESULT check-refs.nix -A test6)
|
2006-10-19 17:44:51 +00:00
|
|
|
|
|
|
|
# test7 should succeed (allowed self-ref).
|
2011-10-10 21:32:34 +00:00
|
|
|
nix-build -o $RESULT check-refs.nix -A test7
|
2006-10-19 17:44:51 +00:00
|
|
|
|
|
|
|
# test8 should fail (toFile depending on derivation output).
|
2014-08-21 19:50:19 +00:00
|
|
|
(! nix-build -o $RESULT check-refs.nix -A test8)
|