summaryrefslogtreecommitdiff
path: root/t/t0000-basic.sh
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2021-01-28 06:32:28 (GMT)
committerJunio C Hamano <gitster@pobox.com>2021-01-28 20:06:25 (GMT)
commit03efadb7748d50b98fc1da5530b32f633fd1cbbb (patch)
treec4c52b261b9cb93292ea456bb713c04ef9e31503 /t/t0000-basic.sh
parente6362826a0409539642a5738db61827e5978e2e4 (diff)
downloadgit-03efadb7748d50b98fc1da5530b32f633fd1cbbb.zip
git-03efadb7748d50b98fc1da5530b32f633fd1cbbb.tar.gz
git-03efadb7748d50b98fc1da5530b32f633fd1cbbb.tar.bz2
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>
Diffstat (limited to 't/t0000-basic.sh')
-rwxr-xr-xt/t0000-basic.sh22
1 files changed, 11 insertions, 11 deletions
diff --git a/t/t0000-basic.sh b/t/t0000-basic.sh
index f4ba2e8..d49b5dd 100755
--- a/t/t0000-basic.sh
+++ b/t/t0000-basic.sh
@@ -829,17 +829,6 @@ then
exit 1
fi
-clean=no
-test_expect_success 'tests clean up after themselves' '
- test_when_finished clean=yes
-'
-
-if test -z "$GIT_TEST_FAIL_PREREQS_INTERNAL" -a $clean != yes
-then
- say "bug in test framework: basic cleanup command does not work reliably"
- exit 1
-fi
-
test_lazy_prereq NESTED_INNER '
>inner &&
rm -f outer
@@ -874,6 +863,17 @@ test_expect_success 'lazy prereqs do not turn off tracing' "
grep 'echo trace' lazy-prereq-and-tracing/err
"
+clean=no
+test_expect_success 'tests clean up after themselves' '
+ test_when_finished clean=yes
+'
+
+if test -z "$GIT_TEST_FAIL_PREREQS_INTERNAL" -a $clean != yes
+then
+ say "bug in test framework: basic cleanup command does not work reliably"
+ exit 1
+fi
+
test_expect_success 'tests clean up even on failures' "
run_sub_test_lib_test_err \
failing-cleanup 'Failing tests with cleanup commands' <<-\\EOF &&