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 | |
parent | b29d3f4aee9fa91f4ea1019d09bf63bc81b9f830 (diff) |
Adda test for build-max-log-size
Diffstat (limited to 'tests')
-rw-r--r-- | tests/timeout.builder.sh | 2 | ||||
-rw-r--r-- | tests/timeout.sh | 23 |
2 files changed, 11 insertions, 14 deletions
diff --git a/tests/timeout.builder.sh b/tests/timeout.builder.sh index 5a7e08861002..1ddb44e99c7f 100644 --- a/tests/timeout.builder.sh +++ b/tests/timeout.builder.sh @@ -1,2 +1,2 @@ echo "\`timeout' builder entering an infinite loop" -while true ; do echo foo; sleep 1; done +while true ; do echo -n .; done 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 |