about summary refs log tree commit diff
path: root/tests/parallel.sh
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2004-05-04T17·04+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2004-05-04T17·04+0000
commita9858c9f26c5be743e0bbe1949954f6bd2497306 (patch)
tree9ee029ebea9b1ce561eff31a3a6ccfa9b5f26ae5 /tests/parallel.sh
parentf044ccf7025137ec541e165e7988772f27080a23 (diff)
* A test to verify that Nix executes build jobs in parallel, if
  possible.

  This test fails right now because this hasn't been implemented right
  now.  Yes, I'm doing Test-Driven Development! ;-)

Diffstat (limited to 'tests/parallel.sh')
-rw-r--r--tests/parallel.sh20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/parallel.sh b/tests/parallel.sh
new file mode 100644
index 000000000000..7040f7ad91d3
--- /dev/null
+++ b/tests/parallel.sh
@@ -0,0 +1,20 @@
+storeExpr=$($TOP/src/nix-instantiate/nix-instantiate parallel.nix)
+
+echo "store expr is $storeExpr"
+
+for i in $(seq 1 5); do
+    echo "WORKER $i"
+    $TOP/src/nix-store/nix-store -rvvB "$storeExpr" &
+done
+
+sleep 5
+
+outPath=$($TOP/src/nix-store/nix-store -qnfvvvvv "$storeExpr")
+
+echo "output path is $outPath"
+
+text=$(cat "$outPath")
+if test "$text" != "aabcade"; then exit 1; fi
+
+if test "$(cat $SHARED.cur)" != 0; then exit 1; fi
+if test "$(cat $SHARED.max)" != 3; then exit 1; fi