X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=t%2Ft0000-basic.sh;h=3ec9cbef2c88f65e5fb254d10cc551c6c4062c88;hb=127f04522292fc62152762405c92d6acca4dbcb5;hp=f4ca4fc85c6b52a2ba919528284f2b668e6bd3d2;hpb=990169b9b19b2a4e837127c6b8678d6bdf44c609;p=git.git diff --git a/t/t0000-basic.sh b/t/t0000-basic.sh index f4ca4fc85..3ec9cbef2 100755 --- a/t/t0000-basic.sh +++ b/t/t0000-basic.sh @@ -73,6 +73,27 @@ then exit 1 fi +clean=no +test_expect_success 'tests clean up after themselves' ' + test_when_finished clean=yes +' + +cleaner=no +test_expect_code 1 'tests clean up even after a failure' ' + test_when_finished cleaner=yes && + (exit 1) +' + +if test $clean$cleaner != yesyes +then + say "bug in test framework: cleanup commands do not work reliably" + exit 1 +fi + +test_expect_code 2 'failure to clean up causes the test to fail' ' + test_when_finished "(exit 2)" +' + ################################################################ # Basics of the basics