@@ -69,6 +69,23 @@ test_expect_success 'success is reported like this' '
69
69
_run_sub_test_lib_test_common () {
70
70
neg=" $1 " name=" $2 " descr=" $3 " # stdin is the body of the test code
71
71
shift 3
72
+
73
+ # intercept pseudo-options at the front of the argument list that we
74
+ # will not pass to child script
75
+ skip=
76
+ while test $# -gt 0
77
+ do
78
+ case " $1 " in
79
+ --skip=* )
80
+ skip=${1# --* =}
81
+ shift
82
+ ;;
83
+ * )
84
+ break
85
+ ;;
86
+ esac
87
+ done
88
+
72
89
mkdir " $name " &&
73
90
(
74
91
# Pretend we're not running under a test harness, whether we
@@ -91,6 +108,8 @@ _run_sub_test_lib_test_common () {
91
108
export TEST_DIRECTORY &&
92
109
TEST_OUTPUT_DIRECTORY=$( pwd) &&
93
110
export TEST_OUTPUT_DIRECTORY &&
111
+ GIT_SKIP_TESTS=$skip &&
112
+ export GIT_SKIP_TESTS &&
94
113
sane_unset GIT_TEST_FAIL_PREREQS &&
95
114
if test -z " $neg "
96
115
then
@@ -319,9 +338,9 @@ test_expect_success 'test --verbose-only' '
319
338
320
339
test_expect_success ' GIT_SKIP_TESTS' '
321
340
(
322
- GIT_SKIP_TESTS="git.2" && export GIT_SKIP_TESTS &&
323
341
run_sub_test_lib_test git-skip-tests-basic \
324
- "GIT_SKIP_TESTS" <<-\EOF &&
342
+ "GIT_SKIP_TESTS" \
343
+ --skip="git.2" <<-\EOF &&
325
344
for i in 1 2 3
326
345
do
327
346
test_expect_success "passing test #$i" "true"
@@ -340,9 +359,9 @@ test_expect_success 'GIT_SKIP_TESTS' '
340
359
341
360
test_expect_success ' GIT_SKIP_TESTS several tests' '
342
361
(
343
- GIT_SKIP_TESTS="git.2 git.5" && export GIT_SKIP_TESTS &&
344
362
run_sub_test_lib_test git-skip-tests-several \
345
- "GIT_SKIP_TESTS several tests" <<-\EOF &&
363
+ "GIT_SKIP_TESTS several tests" \
364
+ --skip="git.2 git.5" <<-\EOF &&
346
365
for i in 1 2 3 4 5 6
347
366
do
348
367
test_expect_success "passing test #$i" "true"
@@ -364,9 +383,9 @@ test_expect_success 'GIT_SKIP_TESTS several tests' '
364
383
365
384
test_expect_success ' GIT_SKIP_TESTS sh pattern' '
366
385
(
367
- GIT_SKIP_TESTS="git.[2-5]" && export GIT_SKIP_TESTS &&
368
386
run_sub_test_lib_test git-skip-tests-sh-pattern \
369
- "GIT_SKIP_TESTS sh pattern" <<-\EOF &&
387
+ "GIT_SKIP_TESTS sh pattern" \
388
+ --skip="git.[2-5]" <<-\EOF &&
370
389
for i in 1 2 3 4 5 6
371
390
do
372
391
test_expect_success "passing test #$i" "true"
@@ -388,9 +407,9 @@ test_expect_success 'GIT_SKIP_TESTS sh pattern' '
388
407
389
408
test_expect_success ' GIT_SKIP_TESTS entire suite' '
390
409
(
391
- GIT_SKIP_TESTS="git" && export GIT_SKIP_TESTS &&
392
410
run_sub_test_lib_test git-skip-tests-entire-suite \
393
- "GIT_SKIP_TESTS entire suite" <<-\EOF &&
411
+ "GIT_SKIP_TESTS entire suite" \
412
+ --skip="git" <<-\EOF &&
394
413
for i in 1 2 3
395
414
do
396
415
test_expect_success "passing test #$i" "true"
@@ -405,9 +424,9 @@ test_expect_success 'GIT_SKIP_TESTS entire suite' '
405
424
406
425
test_expect_success ' GIT_SKIP_TESTS does not skip unmatched suite' '
407
426
(
408
- GIT_SKIP_TESTS="notgit" && export GIT_SKIP_TESTS &&
409
427
run_sub_test_lib_test git-skip-tests-unmatched-suite \
410
- "GIT_SKIP_TESTS does not skip unmatched suite" <<-\EOF &&
428
+ "GIT_SKIP_TESTS does not skip unmatched suite" \
429
+ --skip="notgit" <<-\EOF &&
411
430
for i in 1 2 3
412
431
do
413
432
test_expect_success "passing test #$i" "true"
0 commit comments