Skip to content

Commit 03efadb

Browse files
peffgitster
authored andcommitted
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 477dcad (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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent e636282 commit 03efadb

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

t/t0000-basic.sh

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -829,17 +829,6 @@ then
829829
exit 1
830830
fi
831831

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-
843832
test_lazy_prereq NESTED_INNER '
844833
>inner &&
845834
rm -f outer
@@ -874,6 +863,17 @@ test_expect_success 'lazy prereqs do not turn off tracing' "
874863
grep 'echo trace' lazy-prereq-and-tracing/err
875864
"
876865

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+
877877
test_expect_success 'tests clean up even on failures' "
878878
run_sub_test_lib_test_err \
879879
failing-cleanup 'Failing tests with cleanup commands' <<-\\EOF &&

0 commit comments

Comments
 (0)