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 <liu.denton@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Denton Liu committed
Oct 8, 2019 at 02:22 UTC
b05b40930ebfbd12ba89f73f15a46dfb107b16f6
1 file changed
+38
t/t0000-basic.sh
+38
@@ -391,6 +391,44 @@ test_expect_success 'GIT_SKIP_TESTS sh pattern' "
391
)
392
"
393
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
+
432
test_expect_success '--run basic' "
433
run_sub_test_lib_test run-basic \
434
'--run basic' --run='1 3 5' <<-\\EOF &&