diff options
author | Nick Mathewson <nickm@torproject.org> | 2010-05-26 13:31:41 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2010-05-26 13:43:01 -0400 |
commit | faf2a04fa5e4c44a356d635502cc7e2dbead34d3 (patch) | |
tree | 25104119752944273569a5812661b1ab7828855d /test | |
parent | 8bc1e3d6d109c4f72b2c3962e721c0b9399fb855 (diff) | |
download | libevent-faf2a04fa5e4c44a356d635502cc7e2dbead34d3.tar.gz |
Make test.sh exit with nonzero status if tests fail
This behavior makes "make verify" actually fail when the tests fail,
which is what it's supposed to do.
Diffstat (limited to 'test')
-rwxr-xr-x | test/test-ratelim.sh | 9 | ||||
-rwxr-xr-x | test/test.sh | 10 |
2 files changed, 19 insertions, 0 deletions
diff --git a/test/test-ratelim.sh b/test/test-ratelim.sh index 201794c4..229cba54 100755 --- a/test/test-ratelim.sh +++ b/test/test-ratelim.sh @@ -1,5 +1,7 @@ #!/bin/sh +FAILED=no + if test "x$TEST_OUTPUT_FILE" = "x" then TEST_OUTPUT_FILE=/dev/null @@ -44,6 +46,7 @@ run_tests () { announce OKAY else announce FAILED + FAILED=yes fi announce_n " Connection limit, no group limit:" @@ -52,6 +55,7 @@ run_tests () { announce OKAY ; else announce FAILED ; + FAILED=yes fi announce_n " Connection limit and group limit:" @@ -60,9 +64,14 @@ run_tests () { announce OKAY ; else announce FAILED ; + FAILED=yes fi } announce "Running rate-limiting tests:" run_tests + +if test "$FAILED" = "yes"; then + exit 1 +fi diff --git a/test/test.sh b/test/test.sh index e132fc38..5b6b5378 100755 --- a/test/test.sh +++ b/test/test.sh @@ -1,5 +1,7 @@ #!/bin/sh +FAILED=no + if test "x$TEST_OUTPUT_FILE" = "x" then TEST_OUTPUT_FILE=/dev/null @@ -62,6 +64,7 @@ run_tests () { announce OKAY ; else announce FAILED ; + FAILED=yes fi announce_n " test-weof: " if $TEST_DIR/test-weof >>"$TEST_OUTPUT_FILE" ; @@ -69,6 +72,7 @@ run_tests () { announce OKAY ; else announce FAILED ; + FAILED=yes fi announce_n " test-time: " if $TEST_DIR/test-time >>"$TEST_OUTPUT_FILE" ; @@ -76,6 +80,7 @@ run_tests () { announce OKAY ; else announce FAILED ; + FAILED=yes fi announce_n " regress: " if $TEST_DIR/regress >>"$TEST_OUTPUT_FILE" ; @@ -83,6 +88,7 @@ run_tests () { announce OKAY ; else announce FAILED ; + FAILED=yes fi } @@ -123,3 +129,7 @@ setup unset EVENT_NOWIN32 announce "WIN32" run_tests + +if test "$FAILED" = "yes"; then + exit 1 +fi |