aboutsummaryrefslogtreecommitdiffstats
path: root/t/t0000-basic.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2019-04-25 16:41:12 +0900
committerJunio C Hamano <gitster@pobox.com>2019-04-25 16:41:12 +0900
commit579b75ad9530827fe00740b8551963f16f279c40 (patch)
tree9beebfa6f1162d688b034923b2ba3498cf6597e5 /t/t0000-basic.sh
parente62e68d35949235435ea7f7d22ab6ea678fd46b0 (diff)
parent74ec8cf6747a60885e15d4c36e6b47bc37764748 (diff)
downloadgit-579b75ad9530827fe00740b8551963f16f279c40.tar.gz
Merge branch 'sg/test-atexit'
Test framework update to more robustly clean up leftover files and processes after tests are done. * sg/test-atexit: t9811-git-p4-label-import: fix pipeline negation git p4 test: disable '-x' tracing in the p4d watchdog loop git p4 test: simplify timeout handling git p4 test: clean up the p4d cleanup functions git p4 test: use 'test_atexit' to kill p4d and the watchdog process t0301-credential-cache: use 'test_atexit' to stop the credentials helper tests: use 'test_atexit' to stop httpd git-daemon: use 'test_atexit` to stop 'git-daemon' test-lib: introduce 'test_atexit' t/lib-git-daemon: make sure to kill the 'git-daemon' process test-lib: fix interrupt handling with 'dash' and '--verbose-log -x'
Diffstat (limited to 't/t0000-basic.sh')
-rwxr-xr-xt/t0000-basic.sh18
1 files changed, 18 insertions, 0 deletions
diff --git a/t/t0000-basic.sh b/t/t0000-basic.sh
index b6566003dd..c03054c538 100755
--- a/t/t0000-basic.sh
+++ b/t/t0000-basic.sh
@@ -825,6 +825,24 @@ test_expect_success 'tests clean up even on failures' "
EOF
"
+test_expect_success 'test_atexit is run' "
+ test_must_fail run_sub_test_lib_test \
+ atexit-cleanup 'Run atexit commands' -i <<-\\EOF &&
+ test_expect_success 'tests clean up even after a failure' '
+ > ../../clean-atexit &&
+ test_atexit rm ../../clean-atexit &&
+ > ../../also-clean-atexit &&
+ test_atexit rm ../../also-clean-atexit &&
+ > ../../dont-clean-atexit &&
+ (exit 1)
+ '
+ test_done
+ EOF
+ test_path_is_file dont-clean-atexit &&
+ test_path_is_missing clean-atexit &&
+ test_path_is_missing also-clean-atexit
+"
+
test_expect_success 'test_oid setup' '
test_oid_init
'