aboutsummaryrefslogtreecommitdiff
path: root/tests/CMakeLists.txt
diff options
context:
space:
mode:
authorMarco Poletti <poletti.marco@gmail.com>2015-12-01 23:03:15 +0100
committerMarco Poletti <poletti.marco@gmail.com>2015-12-01 23:03:15 +0100
commit0d2cef0bee989bcc08c60f06ae9ee839ac7a4634 (patch)
tree9e17a69be4ea1e7d6b2000eb7c2cfcafceaefc51 /tests/CMakeLists.txt
parent70bf24dbbd0c10e8eec5f5d08144c5a0bf3b6808 (diff)
downloadgoogle-fruit-0d2cef0bee989bcc08c60f06ae9ee839ac7a4634.tar.gz
Set a maximum timeout for tests. A test taking more than that should be considered as failing and we should go ahead with the rest (instead of stalling the test run which then might get killed by Travis CI).
Diffstat (limited to 'tests/CMakeLists.txt')
-rw-r--r--tests/CMakeLists.txt2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 4dbfeaf..1327108 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -222,7 +222,7 @@ function(add_test_expected_to_fail_at_runtime NAME MESSAGE)
add_test(NAME ${NAME}
COMMAND bash -c "
F=`mktemp`
- if $<TARGET_FILE:${NAME}-exec> &>\${F}; then
+ if timeout 20s $<TARGET_FILE:${NAME}-exec> &>\${F}; then
cat \$F | fgrep error | head -n 1
rm -f \${F}
echo 'Expected runtime error but the test passed.'