From adfd82753185d38357dcbc8f0beef1add701bf3d Mon Sep 17 00:00:00 2001 From: David Wilson Date: Thu, 22 Mar 2018 05:21:42 +0545 Subject: [PATCH] test.sh: enhancements * Explicitly name every test to run, I have lots of unchecked in stuff * Allow SIGINT to stop the process --- test.sh | 36 ++++++++++++++++++++++++++++++++---- 1 file changed, 32 insertions(+), 4 deletions(-) diff --git a/test.sh b/test.sh index c252950b..2df991eb 100755 --- a/test.sh +++ b/test.sh @@ -22,10 +22,38 @@ sys.exit(1) ' "$@" } -for f in tests/*_test.py; do - echo $f - timeout 10 python $f || fail=1 -done +trap 'sigint' INT +sigint() +{ + echo "SIGINT received, stopping.." + exit 1 +} + +run_test() +{ + echo "Running $1.." + timeout 10 python $1 || fail=$? +} + +run_test tests/ansible_helpers_test.py +run_test tests/call_function_test.py +run_test tests/channel_test.py +run_test tests/fakessh_test.py +run_test tests/first_stage_test.py +run_test tests/id_allocation_test.py +run_test tests/importer_test.py +run_test tests/latch_test.py +run_test tests/local_test.py +run_test tests/master_test.py +run_test tests/module_finder_test.py +run_test tests/nested_test.py +run_test tests/parent_test.py +run_test tests/responder_test.py +run_test tests/router_test.py +run_test tests/select_test.py +run_test tests/ssh_test.py +run_test tests/testlib.py +run_test tests/utils_test.py if [ "$fail" ]; then echo "AT LEAST ONE TEST FAILED" >&2