about summary refs log tree commit diff
path: root/tests/nix-build.sh
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2006-03-01T13·49+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2006-03-01T13·49+0000
commit5cb6c42088347bf7ba513cdd68b20c91035c7db9 (patch)
treea4ed49dba181a486bae53991cc6243702945a103 /tests/nix-build.sh
parent8cd646b6af87dad97d326e5f0d7b1e9ecff17c97 (diff)
* Test nix-build. This also tests indirect roots.
Diffstat (limited to 'tests/nix-build.sh')
-rw-r--r--tests/nix-build.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/nix-build.sh b/tests/nix-build.sh
new file mode 100644
index 000000000000..23f8ce99875f
--- /dev/null
+++ b/tests/nix-build.sh
@@ -0,0 +1,17 @@
+source common.sh
+
+$nixstore --gc
+
+(cd $TEST_ROOT && $NIX_BIN_DIR/nix-build ../dependencies.nix)
+test "$(cat $TEST_ROOT/result/foobar)" = FOOBAR
+
+# The result should be retained by a GC.
+target=$(ls -l $TEST_ROOT/result | sed 's/.*->\ //')
+echo target is $target
+$nixstore --gc
+test -e $target/foobar
+
+# But now it should be gone.
+rm $TEST_ROOT/result
+$nixstore --gc
+if test -e $target/foobar; then false; fi