diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2013-09-02T10·44+0200 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2013-09-02T10·44+0200 |
commit | 6ec8dab06abd08f3239c10b98d34a268cd0657cb (patch) | |
tree | 575f4a3583900b34db5a13a1204177c4ee0ed053 /tests/timeout.sh | |
parent | b29d3f4aee9fa91f4ea1019d09bf63bc81b9f830 (diff) |
Adda test for build-max-log-size
Diffstat (limited to 'tests/timeout.sh')
-rw-r--r-- | tests/timeout.sh | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/tests/timeout.sh b/tests/timeout.sh index 2101d13a7894..4a4769a165e8 100644 --- a/tests/timeout.sh +++ b/tests/timeout.sh @@ -2,23 +2,20 @@ source common.sh -drvPath=$(nix-instantiate timeout.nix) - -test "$(nix-store -q --binding system "$drvPath")" = "$system" - -echo "derivation is $drvPath" - failed=0 -messages="`nix-store -r --timeout 2 $drvPath 2>&1 || failed=1`" -if test $failed -ne 0; then - echo "error: \`nix-store' succeeded; should have timed out" >&2 +messages="`nix-build timeout.nix --timeout 2 2>&1 || failed=1`" +if [ $failed -ne 0 ]; then + echo "error: \`nix-store' succeeded; should have timed out" exit 1 fi -if ! echo "$messages" | grep "timed out"; then - echo "error: \`nix-store' may have failed for reasons other than timeout" >&2 - echo >&2 - echo "output of \`nix-store' follows:" >&2 +if ! echo "$messages" | grep -q "timed out"; then + echo "error: build may have failed for reasons other than timeout; output:" echo "$messages" >&2 exit 1 fi + +if nix-build timeout.nix --option build-max-log-size 100; then + echo "build should have failed" + exit 1 +fi |