t0000: keep clean-up tests together

We check that test_when_finished cleans up after a test, and that it runs even after a failure. Those two were originally adjacent, but got split apart by the new test added in 477dcaddb6 (tests: do not let lazy prereqs inside `test_expect_*` turn off tracing, 2020-03-26), and then further by more lazy-prereq tests. Let's move them back together. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Jeff King committed Jan 28, 2021 at 01:32 UTC 03efadb7748d50b98fc1da5530b32f633fd1cbbb
1 file changed +11 -11
t/t0000-basic.sh
+11 -11
@@ -829,17 +829,6 @@ then
829 exit 1
830 fi
831
832 -clean=no
833 -test_expect_success 'tests clean up after themselves' '
834 - test_when_finished clean=yes
835 -'
836 -
837 -if test -z "$GIT_TEST_FAIL_PREREQS_INTERNAL" -a $clean != yes
838 -then
839 - say "bug in test framework: basic cleanup command does not work reliably"
840 - exit 1
841 -fi
842 -
832 test_lazy_prereq NESTED_INNER '
833 >inner &&
834 rm -f outer
@@ -874,6 +863,17 @@ test_expect_success 'lazy prereqs do not turn off tracing' "
863 grep 'echo trace' lazy-prereq-and-tracing/err
864 "
865
866 +clean=no
867 +test_expect_success 'tests clean up after themselves' '
868 + test_when_finished clean=yes
869 +'
870 +
871 +if test -z "$GIT_TEST_FAIL_PREREQS_INTERNAL" -a $clean != yes
872 +then
873 + say "bug in test framework: basic cleanup command does not work reliably"
874 + exit 1
875 +fi
876 +
877 test_expect_success 'tests clean up even on failures' "
878 run_sub_test_lib_test_err \
879 failing-cleanup 'Failing tests with cleanup commands' <<-\\EOF &&