@@ -68,7 +68,7 @@ test_expect_success 'success is reported like this' '
68
68
'
69
69
70
70
test_expect_success ' pretend we have a fully passing test suite' '
71
- run_sub_test_lib_test full-pass "3 passing tests" <<-\EOF &&
71
+ write_and_run_sub_test_lib_test full-pass "3 passing tests" <<-\EOF &&
72
72
for i in 1 2 3
73
73
do
74
74
test_expect_success "passing test #$i" "true"
@@ -85,7 +85,7 @@ test_expect_success 'pretend we have a fully passing test suite' '
85
85
'
86
86
87
87
test_expect_success ' pretend we have a partially passing test suite' '
88
- run_sub_test_lib_test_err \
88
+ write_and_run_sub_test_lib_test_err \
89
89
partial-pass "2/3 tests passing" <<-\EOF &&
90
90
test_expect_success "passing test #1" "true"
91
91
test_expect_success "failing test #2" "false"
@@ -103,7 +103,7 @@ test_expect_success 'pretend we have a partially passing test suite' '
103
103
'
104
104
105
105
test_expect_success ' pretend we have a known breakage' '
106
- run_sub_test_lib_test failing-todo "A failing TODO test" <<-\EOF &&
106
+ write_and_run_sub_test_lib_test failing-todo "A failing TODO test" <<-\EOF &&
107
107
test_expect_success "passing test" "true"
108
108
test_expect_failure "pretend we have a known breakage" "false"
109
109
test_done
@@ -118,7 +118,7 @@ test_expect_success 'pretend we have a known breakage' '
118
118
'
119
119
120
120
test_expect_success ' pretend we have fixed a known breakage' '
121
- run_sub_test_lib_test passing-todo "A passing TODO test" <<-\EOF &&
121
+ write_and_run_sub_test_lib_test passing-todo "A passing TODO test" <<-\EOF &&
122
122
test_expect_failure "pretend we have fixed a known breakage" "true"
123
123
test_done
124
124
EOF
@@ -130,7 +130,7 @@ test_expect_success 'pretend we have fixed a known breakage' '
130
130
'
131
131
132
132
test_expect_success ' pretend we have fixed one of two known breakages (run in sub test-lib)' '
133
- run_sub_test_lib_test partially-passing-todos \
133
+ write_and_run_sub_test_lib_test partially-passing-todos \
134
134
"2 TODO tests, one passing" <<-\EOF &&
135
135
test_expect_failure "pretend we have a known breakage" "false"
136
136
test_expect_success "pretend we have a passing test" "true"
@@ -149,7 +149,7 @@ test_expect_success 'pretend we have fixed one of two known breakages (run in su
149
149
'
150
150
151
151
test_expect_success ' pretend we have a pass, fail, and known breakage' '
152
- run_sub_test_lib_test_err \
152
+ write_and_run_sub_test_lib_test_err \
153
153
mixed-results1 "mixed results #1" <<-\EOF &&
154
154
test_expect_success "passing test" "true"
155
155
test_expect_success "failing test" "false"
@@ -168,7 +168,7 @@ test_expect_success 'pretend we have a pass, fail, and known breakage' '
168
168
'
169
169
170
170
test_expect_success ' pretend we have a mix of all possible results' '
171
- run_sub_test_lib_test_err \
171
+ write_and_run_sub_test_lib_test_err \
172
172
mixed-results2 "mixed results #2" <<-\EOF &&
173
173
test_expect_success "passing test" "true"
174
174
test_expect_success "passing test" "true"
@@ -204,7 +204,7 @@ test_expect_success 'pretend we have a mix of all possible results' '
204
204
'
205
205
206
206
test_expect_success ' test --verbose' '
207
- run_sub_test_lib_test_err \
207
+ write_and_run_sub_test_lib_test_err \
208
208
t1234-verbose "test verbose" --verbose <<-\EOF &&
209
209
test_expect_success "passing test" true
210
210
test_expect_success "test with output" "echo foo"
@@ -231,7 +231,7 @@ test_expect_success 'test --verbose' '
231
231
'
232
232
233
233
test_expect_success ' test --verbose-only' '
234
- run_sub_test_lib_test_err \
234
+ write_and_run_sub_test_lib_test_err \
235
235
t2345-verbose-only-2 "test verbose-only=2" \
236
236
--verbose-only=2 <<-\EOF &&
237
237
test_expect_success "passing test" true
@@ -255,7 +255,7 @@ test_expect_success 'test --verbose-only' '
255
255
256
256
test_expect_success ' GIT_SKIP_TESTS' '
257
257
(
258
- run_sub_test_lib_test git-skip-tests-basic \
258
+ write_and_run_sub_test_lib_test git-skip-tests-basic \
259
259
"GIT_SKIP_TESTS" \
260
260
--skip="git.2" <<-\EOF &&
261
261
for i in 1 2 3
@@ -276,7 +276,7 @@ test_expect_success 'GIT_SKIP_TESTS' '
276
276
277
277
test_expect_success ' GIT_SKIP_TESTS several tests' '
278
278
(
279
- run_sub_test_lib_test git-skip-tests-several \
279
+ write_and_run_sub_test_lib_test git-skip-tests-several \
280
280
"GIT_SKIP_TESTS several tests" \
281
281
--skip="git.2 git.5" <<-\EOF &&
282
282
for i in 1 2 3 4 5 6
@@ -300,7 +300,7 @@ test_expect_success 'GIT_SKIP_TESTS several tests' '
300
300
301
301
test_expect_success ' GIT_SKIP_TESTS sh pattern' '
302
302
(
303
- run_sub_test_lib_test git-skip-tests-sh-pattern \
303
+ write_and_run_sub_test_lib_test git-skip-tests-sh-pattern \
304
304
"GIT_SKIP_TESTS sh pattern" \
305
305
--skip="git.[2-5]" <<-\EOF &&
306
306
for i in 1 2 3 4 5 6
@@ -324,7 +324,7 @@ test_expect_success 'GIT_SKIP_TESTS sh pattern' '
324
324
325
325
test_expect_success ' GIT_SKIP_TESTS entire suite' '
326
326
(
327
- run_sub_test_lib_test git-skip-tests-entire-suite \
327
+ write_and_run_sub_test_lib_test git-skip-tests-entire-suite \
328
328
"GIT_SKIP_TESTS entire suite" \
329
329
--skip="git" <<-\EOF &&
330
330
for i in 1 2 3
@@ -341,7 +341,7 @@ test_expect_success 'GIT_SKIP_TESTS entire suite' '
341
341
342
342
test_expect_success ' GIT_SKIP_TESTS does not skip unmatched suite' '
343
343
(
344
- run_sub_test_lib_test git-skip-tests-unmatched-suite \
344
+ write_and_run_sub_test_lib_test git-skip-tests-unmatched-suite \
345
345
"GIT_SKIP_TESTS does not skip unmatched suite" \
346
346
--skip="notgit" <<-\EOF &&
347
347
for i in 1 2 3
@@ -361,7 +361,7 @@ test_expect_success 'GIT_SKIP_TESTS does not skip unmatched suite' '
361
361
'
362
362
363
363
test_expect_success ' --run basic' '
364
- run_sub_test_lib_test run-basic \
364
+ write_and_run_sub_test_lib_test run-basic \
365
365
"--run basic" --run="1,3,5" <<-\EOF &&
366
366
for i in 1 2 3 4 5 6
367
367
do
@@ -382,7 +382,7 @@ test_expect_success '--run basic' '
382
382
'
383
383
384
384
test_expect_success ' --run with a range' '
385
- run_sub_test_lib_test run-range \
385
+ write_and_run_sub_test_lib_test run-range \
386
386
"--run with a range" --run="1-3" <<-\EOF &&
387
387
for i in 1 2 3 4 5 6
388
388
do
@@ -403,7 +403,7 @@ test_expect_success '--run with a range' '
403
403
'
404
404
405
405
test_expect_success ' --run with two ranges' '
406
- run_sub_test_lib_test run-two-ranges \
406
+ write_and_run_sub_test_lib_test run-two-ranges \
407
407
"--run with two ranges" --run="1-2,5-6" <<-\EOF &&
408
408
for i in 1 2 3 4 5 6
409
409
do
@@ -424,7 +424,7 @@ test_expect_success '--run with two ranges' '
424
424
'
425
425
426
426
test_expect_success ' --run with a left open range' '
427
- run_sub_test_lib_test run-left-open-range \
427
+ write_and_run_sub_test_lib_test run-left-open-range \
428
428
"--run with a left open range" --run="-3" <<-\EOF &&
429
429
for i in 1 2 3 4 5 6
430
430
do
@@ -445,7 +445,7 @@ test_expect_success '--run with a left open range' '
445
445
'
446
446
447
447
test_expect_success ' --run with a right open range' '
448
- run_sub_test_lib_test run-right-open-range \
448
+ write_and_run_sub_test_lib_test run-right-open-range \
449
449
"--run with a right open range" --run="4-" <<-\EOF &&
450
450
for i in 1 2 3 4 5 6
451
451
do
@@ -466,7 +466,7 @@ test_expect_success '--run with a right open range' '
466
466
'
467
467
468
468
test_expect_success ' --run with basic negation' '
469
- run_sub_test_lib_test run-basic-neg \
469
+ write_and_run_sub_test_lib_test run-basic-neg \
470
470
"--run with basic negation" --run="!3" <<-\EOF &&
471
471
for i in 1 2 3 4 5 6
472
472
do
@@ -487,7 +487,7 @@ test_expect_success '--run with basic negation' '
487
487
'
488
488
489
489
test_expect_success ' --run with two negations' '
490
- run_sub_test_lib_test run-two-neg \
490
+ write_and_run_sub_test_lib_test run-two-neg \
491
491
"--run with two negations" --run="!3,!6" <<-\EOF &&
492
492
for i in 1 2 3 4 5 6
493
493
do
@@ -508,7 +508,7 @@ test_expect_success '--run with two negations' '
508
508
'
509
509
510
510
test_expect_success ' --run a range and negation' '
511
- run_sub_test_lib_test run-range-and-neg \
511
+ write_and_run_sub_test_lib_test run-range-and-neg \
512
512
"--run a range and negation" --run="-4,!2" <<-\EOF &&
513
513
for i in 1 2 3 4 5 6
514
514
do
@@ -529,7 +529,7 @@ test_expect_success '--run a range and negation' '
529
529
'
530
530
531
531
test_expect_success ' --run range negation' '
532
- run_sub_test_lib_test run-range-neg \
532
+ write_and_run_sub_test_lib_test run-range-neg \
533
533
"--run range negation" --run="!1-3" <<-\EOF &&
534
534
for i in 1 2 3 4 5 6
535
535
do
@@ -550,7 +550,7 @@ test_expect_success '--run range negation' '
550
550
'
551
551
552
552
test_expect_success ' --run include, exclude and include' '
553
- run_sub_test_lib_test run-inc-neg-inc \
553
+ write_and_run_sub_test_lib_test run-inc-neg-inc \
554
554
"--run include, exclude and include" \
555
555
--run="1-5,!1-3,2" <<-\EOF &&
556
556
for i in 1 2 3 4 5 6
@@ -572,7 +572,7 @@ test_expect_success '--run include, exclude and include' '
572
572
'
573
573
574
574
test_expect_success ' --run include, exclude and include, comma separated' '
575
- run_sub_test_lib_test run-inc-neg-inc-comma \
575
+ write_and_run_sub_test_lib_test run-inc-neg-inc-comma \
576
576
"--run include, exclude and include, comma separated" \
577
577
--run=1-5,!1-3,2 <<-\EOF &&
578
578
for i in 1 2 3 4 5 6
@@ -594,7 +594,7 @@ test_expect_success '--run include, exclude and include, comma separated' '
594
594
'
595
595
596
596
test_expect_success ' --run exclude and include' '
597
- run_sub_test_lib_test run-neg-inc \
597
+ write_and_run_sub_test_lib_test run-neg-inc \
598
598
"--run exclude and include" \
599
599
--run="!3-,5" <<-\EOF &&
600
600
for i in 1 2 3 4 5 6
@@ -616,7 +616,7 @@ test_expect_success '--run exclude and include' '
616
616
'
617
617
618
618
test_expect_success ' --run empty selectors' '
619
- run_sub_test_lib_test run-empty-sel \
619
+ write_and_run_sub_test_lib_test run-empty-sel \
620
620
"--run empty selectors" \
621
621
--run="1,,3,,,5" <<-\EOF &&
622
622
for i in 1 2 3 4 5 6
@@ -638,7 +638,7 @@ test_expect_success '--run empty selectors' '
638
638
'
639
639
640
640
test_expect_success ' --run substring selector' '
641
- run_sub_test_lib_test run-substring-selector \
641
+ write_and_run_sub_test_lib_test run-substring-selector \
642
642
"--run empty selectors" \
643
643
--run="relevant" <<-\EOF &&
644
644
test_expect_success "relevant test" "true"
@@ -662,7 +662,7 @@ test_expect_success '--run substring selector' '
662
662
'
663
663
664
664
test_expect_success ' --run keyword selection' '
665
- run_sub_test_lib_test_err run-inv-range-start \
665
+ write_and_run_sub_test_lib_test_err run-inv-range-start \
666
666
"--run invalid range start" \
667
667
--run="a-5" <<-\EOF &&
668
668
test_expect_success "passing test #1" "true"
@@ -677,7 +677,7 @@ test_expect_success '--run keyword selection' '
677
677
'
678
678
679
679
test_expect_success ' --run invalid range end' '
680
- run_sub_test_lib_test_err run-inv-range-end \
680
+ write_and_run_sub_test_lib_test_err run-inv-range-end \
681
681
"--run invalid range end" \
682
682
--run="1-z" <<-\EOF &&
683
683
test_expect_success "passing test #1" "true"
@@ -692,7 +692,7 @@ test_expect_success '--run invalid range end' '
692
692
'
693
693
694
694
test_expect_success ' tests respect prerequisites' '
695
- run_sub_test_lib_test prereqs "tests respect prereqs" <<-\EOF &&
695
+ write_and_run_sub_test_lib_test prereqs "tests respect prereqs" <<-\EOF &&
696
696
697
697
test_set_prereq HAVEIT
698
698
test_expect_success HAVEIT "prereq is satisfied" "true"
@@ -722,7 +722,7 @@ test_expect_success 'tests respect prerequisites' '
722
722
'
723
723
724
724
test_expect_success ' tests respect lazy prerequisites' '
725
- run_sub_test_lib_test lazy-prereqs "respect lazy prereqs" <<-\EOF &&
725
+ write_and_run_sub_test_lib_test lazy-prereqs "respect lazy prereqs" <<-\EOF &&
726
726
727
727
test_lazy_prereq LAZY_TRUE true
728
728
test_expect_success LAZY_TRUE "lazy prereq is satisifed" "true"
@@ -746,7 +746,7 @@ test_expect_success 'tests respect lazy prerequisites' '
746
746
'
747
747
748
748
test_expect_success ' nested lazy prerequisites' '
749
- run_sub_test_lib_test nested-lazy "nested lazy prereqs" <<-\EOF &&
749
+ write_and_run_sub_test_lib_test nested-lazy "nested lazy prereqs" <<-\EOF &&
750
750
751
751
test_lazy_prereq NESTED_INNER "
752
752
>inner &&
@@ -772,7 +772,7 @@ test_expect_success 'nested lazy prerequisites' '
772
772
'
773
773
774
774
test_expect_success ' lazy prereqs do not turn off tracing' '
775
- run_sub_test_lib_test lazy-prereq-and-tracing \
775
+ write_and_run_sub_test_lib_test lazy-prereq-and-tracing \
776
776
"lazy prereqs and -x" -v -x <<-\EOF &&
777
777
test_lazy_prereq LAZY true
778
778
@@ -785,7 +785,7 @@ test_expect_success 'lazy prereqs do not turn off tracing' '
785
785
'
786
786
787
787
test_expect_success ' tests clean up after themselves' '
788
- run_sub_test_lib_test cleanup "test with cleanup" <<-\EOF &&
788
+ write_and_run_sub_test_lib_test cleanup "test with cleanup" <<-\EOF &&
789
789
clean=no
790
790
test_expect_success "do cleanup" "
791
791
test_when_finished clean=yes
@@ -805,7 +805,7 @@ test_expect_success 'tests clean up after themselves' '
805
805
'
806
806
807
807
test_expect_success ' tests clean up even on failures' '
808
- run_sub_test_lib_test_err \
808
+ write_and_run_sub_test_lib_test_err \
809
809
failing-cleanup "Failing tests with cleanup commands" <<-\EOF &&
810
810
test_expect_success "tests clean up even after a failure" "
811
811
touch clean-after-failure &&
@@ -834,7 +834,7 @@ test_expect_success 'tests clean up even on failures' '
834
834
'
835
835
836
836
test_expect_success ' test_atexit is run' '
837
- run_sub_test_lib_test_err \
837
+ write_and_run_sub_test_lib_test_err \
838
838
atexit-cleanup "Run atexit commands" -i <<-\EOF &&
839
839
test_expect_success "tests clean up even after a failure" "
840
840
> ../../clean-atexit &&
0 commit comments