summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2019-10-08 12:23:38 -0600
committerJens Axboe <axboe@kernel.dk>2019-10-08 12:23:38 -0600
commitb00ba56bd510084ed86d6256a8b4fbed227dc81f (patch)
tree164788d0bbf251050046f6f1aff2b88b87cc2705
parent5f421b51679738e0d05049d84489282c5b3efe2e (diff)
downloadliburing-b00ba56bd510084ed86d6256a8b4fbed227dc81f.tar.gz
liburing-b00ba56bd510084ed86d6256a8b4fbed227dc81f.tar.bz2
test/runtests.sh: distinguish between failed and OK timeouts
Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r--test/35fa71a030ca-test.c7
-rw-r--r--test/a4c0b3decb33-test.c6
-rwxr-xr-xtest/runtests.sh10
3 files changed, 19 insertions, 4 deletions
diff --git a/test/35fa71a030ca-test.c b/test/35fa71a030ca-test.c
index 17e062b..1573413 100644
--- a/test/35fa71a030ca-test.c
+++ b/test/35fa71a030ca-test.c
@@ -310,8 +310,15 @@ void execute_call(int call)
break;
}
}
+
+static void sig_int(int sig)
+{
+ exit(0);
+}
+
int main(void)
{
+ signal(SIGINT, sig_int);
syscall(__NR_mmap, 0x20000000, 0x1000000, 3, 0x32, -1, 0);
loop();
return 0;
diff --git a/test/a4c0b3decb33-test.c b/test/a4c0b3decb33-test.c
index e1e0706..c7d0fec 100644
--- a/test/a4c0b3decb33-test.c
+++ b/test/a4c0b3decb33-test.c
@@ -164,8 +164,14 @@ void execute_one(void)
syscall(__NR_io_uring_setup, 0x983, 0x20000080);
}
+static void sig_int(int sig)
+{
+ exit(0);
+}
+
int main(void)
{
+ signal(SIGINT, sig_int);
syscall(__NR_mmap, 0x20000000, 0x1000000, 3, 0x32, -1, 0);
loop();
return 0;
diff --git a/test/runtests.sh b/test/runtests.sh
index b2e5526..9ca4654 100755
--- a/test/runtests.sh
+++ b/test/runtests.sh
@@ -17,12 +17,12 @@ for t in $TESTS; do
else
echo Running test $t
fi
- timeout -s INT $TIMEOUT ./$t
+ timeout --preserve-status -s INT $TIMEOUT ./$t
r=$?
if [ "${r}" -eq 124 ]; then
echo "Test $t timed out (may not be a failure)"
elif [ "${r}" -ne 0 ]; then
- echo Test $t failed
+ echo "Test $t failed with ret ${r}"
FAILED="$FAILED $t"
RET=1
fi
@@ -30,6 +30,8 @@ done
if [ "${RET}" -ne 0 ]; then
echo "Tests $FAILED failed"
+ exit $RET
+else
+ echo "All tests passed"
+ exit 0
fi
-
-exit $RET