diff mbox series

[4/5] test-lib: add more exhaustive GIT_SKIP_TESTS testing

Message ID 20181127225445.30045-4-avarab@gmail.com (mailing list archive)
State New, archived
Headers show
Series [1/5] t/README: make the 'Skipping tests' section less confusing | expand

Commit Message

Ævar Arnfjörð Bjarmason Nov. 27, 2018, 10:54 p.m. UTC
Add a test for the when GIT_SKIP_TESTS is used to skip entire test
files. Support for this was added back in 04ece59399 ("GIT_SKIP_TESTS:
allow users to omit tests that are known to break", 2006-12-28), but
never tested for.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 t/t0000-basic.sh | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
diff mbox series

Patch

diff --git a/t/t0000-basic.sh b/t/t0000-basic.sh
index b6566003dd..b87a8f18c2 100755
--- a/t/t0000-basic.sh
+++ b/t/t0000-basic.sh
@@ -393,6 +393,23 @@  test_expect_success 'GIT_SKIP_TESTS sh pattern' "
 	)
 "
 
+test_expect_success 'GIT_SKIP_TESTS entire file' "
+	(
+		GIT_SKIP_TESTS='git' && export GIT_SKIP_TESTS &&
+		run_sub_test_lib_test git-skip-tests-entire-file \
+			'GIT_SKIP_TESTS' <<-\\EOF &&
+		for i in 1 2 3
+		do
+			test_expect_success \"passing test #\$i\" 'true'
+		done
+		test_done
+		EOF
+		check_sub_test_lib_test git-skip-tests-entire-file <<-\\EOF
+		1..0 # SKIP skip all tests in git
+		EOF
+	)
+"
+
 test_expect_success '--run basic' "
 	run_sub_test_lib_test run-basic \
 		'--run basic' --run='1 3 5' <<-\\EOF &&