Skip to content

Commit b05b409

Browse files
Denton-Lgitster
authored andcommitted
t0000: cover GIT_SKIP_TESTS blindspots
Currently, the tests for GIT_SKIP_TESTS do not cover the situation where we skip an entire test suite. The tests also do not cover the situation where we have GIT_SKIP_TESTS defined but the test suite does not match. Add two test cases so we cover this blindspot. Signed-off-by: Denton Liu <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 5fa0f52 commit b05b409

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

t/t0000-basic.sh

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,44 @@ test_expect_success 'GIT_SKIP_TESTS sh pattern' "
391391
)
392392
"
393393

394+
test_expect_success 'GIT_SKIP_TESTS entire suite' "
395+
(
396+
GIT_SKIP_TESTS='git' && export GIT_SKIP_TESTS &&
397+
run_sub_test_lib_test git-skip-tests-entire-suite \
398+
'GIT_SKIP_TESTS entire suite' <<-\\EOF &&
399+
for i in 1 2 3
400+
do
401+
test_expect_success \"passing test #\$i\" 'true'
402+
done
403+
test_done
404+
EOF
405+
check_sub_test_lib_test git-skip-tests-entire-suite <<-\\EOF
406+
> 1..0 # SKIP skip all tests in git
407+
EOF
408+
)
409+
"
410+
411+
test_expect_success 'GIT_SKIP_TESTS does not skip unmatched suite' "
412+
(
413+
GIT_SKIP_TESTS='notgit' && export GIT_SKIP_TESTS &&
414+
run_sub_test_lib_test git-skip-tests-unmatched-suite \
415+
'GIT_SKIP_TESTS does not skip unmatched suite' <<-\\EOF &&
416+
for i in 1 2 3
417+
do
418+
test_expect_success \"passing test #\$i\" 'true'
419+
done
420+
test_done
421+
EOF
422+
check_sub_test_lib_test git-skip-tests-unmatched-suite <<-\\EOF
423+
> ok 1 - passing test #1
424+
> ok 2 - passing test #2
425+
> ok 3 - passing test #3
426+
> # passed all 3 test(s)
427+
> 1..3
428+
EOF
429+
)
430+
"
431+
394432
test_expect_success '--run basic' "
395433
run_sub_test_lib_test run-basic \
396434
'--run basic' --run='1 3 5' <<-\\EOF &&

0 commit comments

Comments
 (0)