aboutsummaryrefslogtreecommitdiff
path: root/t/t0000-basic.sh
diff options
context:
space:
mode:
authorIlya Bobyr <ilya.bobyr@gmail.com>2014-04-30 02:50:43 -0700
committerJunio C Hamano <gitster@pobox.com>2014-06-06 13:48:00 -0700
commitef2ac68def0fd8a10e4df06706e7276ff63a58f2 (patch)
treed23ce2d89c8c0ed3c80f4cfe85be762a72df098b /t/t0000-basic.sh
parent5e3b4fce4293d89ea79433527e6d55f4bcd42bbd (diff)
downloadgit-ef2ac68def0fd8a10e4df06706e7276ff63a58f2.tar.gz
git-ef2ac68def0fd8a10e4df06706e7276ff63a58f2.tar.xz
test-lib: tests skipped by GIT_SKIP_TESTS say so
We used to show "(missing )" next to tests skipped because they are specified in GIT_SKIP_TESTS. Use "(GIT_SKIP_TESTS)" instead. Plus tests that check basic GIT_SKIP_TESTS functions. Signed-off-by: Ilya Bobyr <ilya.bobyr@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t0000-basic.sh')
-rwxr-xr-xt/t0000-basic.sh63
1 files changed, 63 insertions, 0 deletions
diff --git a/t/t0000-basic.sh b/t/t0000-basic.sh
index a2bb63ce8..ae8874e0b 100755
--- a/t/t0000-basic.sh
+++ b/t/t0000-basic.sh
@@ -270,6 +270,69 @@ test_expect_success 'test --verbose-only' '
EOF
'
+test_expect_success 'GIT_SKIP_TESTS' "
+ GIT_SKIP_TESTS='git.2' \
+ run_sub_test_lib_test git-skip-tests-basic \
+ '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-basic <<-\\EOF
+ > ok 1 - passing test #1
+ > ok 2 # skip passing test #2 (GIT_SKIP_TESTS)
+ > ok 3 - passing test #3
+ > # passed all 3 test(s)
+ > 1..3
+ EOF
+"
+
+test_expect_success 'GIT_SKIP_TESTS several tests' "
+ GIT_SKIP_TESTS='git.2 git.5' \
+ run_sub_test_lib_test git-skip-tests-several \
+ 'GIT_SKIP_TESTS several tests' <<-\\EOF &&
+ for i in 1 2 3 4 5 6
+ do
+ test_expect_success \"passing test #\$i\" 'true'
+ done
+ test_done
+ EOF
+ check_sub_test_lib_test git-skip-tests-several <<-\\EOF
+ > ok 1 - passing test #1
+ > ok 2 # skip passing test #2 (GIT_SKIP_TESTS)
+ > ok 3 - passing test #3
+ > ok 4 - passing test #4
+ > ok 5 # skip passing test #5 (GIT_SKIP_TESTS)
+ > ok 6 - passing test #6
+ > # passed all 6 test(s)
+ > 1..6
+ EOF
+"
+
+test_expect_success 'GIT_SKIP_TESTS sh pattern' "
+ GIT_SKIP_TESTS='git.[2-5]' \
+ run_sub_test_lib_test git-skip-tests-sh-pattern \
+ 'GIT_SKIP_TESTS sh pattern' <<-\\EOF &&
+ for i in 1 2 3 4 5 6
+ do
+ test_expect_success \"passing test #\$i\" 'true'
+ done
+ test_done
+ EOF
+ check_sub_test_lib_test git-skip-tests-sh-pattern <<-\\EOF
+ > ok 1 - passing test #1
+ > ok 2 # skip passing test #2 (GIT_SKIP_TESTS)
+ > ok 3 # skip passing test #3 (GIT_SKIP_TESTS)
+ > ok 4 # skip passing test #4 (GIT_SKIP_TESTS)
+ > ok 5 # skip passing test #5 (GIT_SKIP_TESTS)
+ > ok 6 - passing test #6
+ > # passed all 6 test(s)
+ > 1..6
+ EOF
+"
+
test_set_prereq HAVEIT
haveit=no
test_expect_success HAVEIT 'test runs if prerequisite is satisfied' '