@@ -226,18 +226,13 @@ test_expect_success 'subtest: --verbose option' '
226
226
'
227
227
228
228
test_expect_success ' subtest: --verbose-only option' '
229
- write_and_run_sub_test_lib_test_err \
230
- t2345-verbose-only-2 \
231
- --verbose-only=2 <<-\EOF &&
232
- test_expect_success "passing test" true
233
- test_expect_success "test with output" "echo foo"
234
- test_expect_success "failing test" false
235
- test_done
236
- EOF
237
- check_sub_test_lib_test t2345-verbose-only-2 <<-\EOF
229
+ run_sub_test_lib_test_err \
230
+ t1234-verbose \
231
+ --verbose-only=2 &&
232
+ check_sub_test_lib_test t1234-verbose <<-\EOF
238
233
> ok 1 - passing test
239
234
> Z
240
- > expecting success of 2345 .2 ' \' ' test with output' \' ' : echo foo
235
+ > expecting success of 1234 .2 ' \' ' test with output' \' ' : echo foo
241
236
> foo
242
237
> ok 2 - test with output
243
238
> Z
@@ -250,15 +245,9 @@ test_expect_success 'subtest: --verbose-only option' '
250
245
251
246
test_expect_success ' subtest: skip one with GIT_SKIP_TESTS' '
252
247
(
253
- write_and_run_sub_test_lib_test git-skip-tests-basic \
254
- --skip="git.2" <<-\EOF &&
255
- for i in 1 2 3
256
- do
257
- test_expect_success "passing test #$i" "true"
258
- done
259
- test_done
260
- EOF
261
- check_sub_test_lib_test git-skip-tests-basic <<-\EOF
248
+ run_sub_test_lib_test full-pass \
249
+ --skip="full.2" &&
250
+ check_sub_test_lib_test full-pass <<-\EOF
262
251
> ok 1 - passing test #1
263
252
> ok 2 # skip passing test #2 (GIT_SKIP_TESTS)
264
253
> ok 3 - passing test #3
@@ -293,15 +282,9 @@ test_expect_success 'subtest: skip several with GIT_SKIP_TESTS' '
293
282
294
283
test_expect_success ' subtest: sh pattern skipping with GIT_SKIP_TESTS' '
295
284
(
296
- write_and_run_sub_test_lib_test git-skip-tests-sh-pattern \
297
- --skip="git.[2-5]" <<-\EOF &&
298
- for i in 1 2 3 4 5 6
299
- do
300
- test_expect_success "passing test #$i" "true"
301
- done
302
- test_done
303
- EOF
304
- check_sub_test_lib_test git-skip-tests-sh-pattern <<-\EOF
285
+ run_sub_test_lib_test git-skip-tests-several \
286
+ --skip="git.[2-5]" &&
287
+ check_sub_test_lib_test git-skip-tests-several <<-\EOF
305
288
> ok 1 - passing test #1
306
289
> ok 2 # skip passing test #2 (GIT_SKIP_TESTS)
307
290
> ok 3 # skip passing test #3 (GIT_SKIP_TESTS)
@@ -316,31 +299,21 @@ test_expect_success 'subtest: sh pattern skipping with GIT_SKIP_TESTS' '
316
299
317
300
test_expect_success ' subtest: skip entire test suite with GIT_SKIP_TESTS' '
318
301
(
319
- write_and_run_sub_test_lib_test git-skip-tests-entire-suite \
320
- --skip="git" <<-\EOF &&
321
- for i in 1 2 3
322
- do
323
- test_expect_success "passing test #$i" "true"
324
- done
325
- test_done
326
- EOF
327
- check_sub_test_lib_test git-skip-tests-entire-suite <<-\EOF
302
+ GIT_SKIP_TESTS="git" && export GIT_SKIP_TESTS &&
303
+ run_sub_test_lib_test git-skip-tests-several \
304
+ --skip="git" &&
305
+ check_sub_test_lib_test git-skip-tests-several <<-\EOF
328
306
> 1..0 # SKIP skip all tests in git
329
307
EOF
330
308
)
331
309
'
332
310
333
311
test_expect_success ' subtest: GIT_SKIP_TESTS does not skip unmatched suite' '
334
312
(
335
- write_and_run_sub_test_lib_test git-skip-tests-unmatched-suite \
336
- --skip="notgit" <<-\EOF &&
337
- for i in 1 2 3
338
- do
339
- test_expect_success "passing test #$i" "true"
340
- done
341
- test_done
342
- EOF
343
- check_sub_test_lib_test git-skip-tests-unmatched-suite <<-\EOF
313
+ GIT_SKIP_TESTS="notgit" && export GIT_SKIP_TESTS &&
314
+ run_sub_test_lib_test full-pass \
315
+ --skip="notfull" &&
316
+ check_sub_test_lib_test full-pass <<-\EOF
344
317
> ok 1 - passing test #1
345
318
> ok 2 - passing test #2
346
319
> ok 3 - passing test #3
@@ -351,14 +324,8 @@ test_expect_success 'subtest: GIT_SKIP_TESTS does not skip unmatched suite' '
351
324
'
352
325
353
326
test_expect_success ' subtest: --run basic' '
354
- write_and_run_sub_test_lib_test run-basic --run="1,3,5" <<-\EOF &&
355
- for i in 1 2 3 4 5 6
356
- do
357
- test_expect_success "passing test #$i" "true"
358
- done
359
- test_done
360
- EOF
361
- check_sub_test_lib_test run-basic <<-\EOF
327
+ run_sub_test_lib_test git-skip-tests-several --run="1,3,5" &&
328
+ check_sub_test_lib_test git-skip-tests-several <<-\EOF
362
329
> ok 1 - passing test #1
363
330
> ok 2 # skip passing test #2 (--run)
364
331
> ok 3 - passing test #3
@@ -371,15 +338,9 @@ test_expect_success 'subtest: --run basic' '
371
338
'
372
339
373
340
test_expect_success ' subtest: --run with a range' '
374
- write_and_run_sub_test_lib_test run-range \
375
- --run="1-3" <<-\EOF &&
376
- for i in 1 2 3 4 5 6
377
- do
378
- test_expect_success "passing test #$i" "true"
379
- done
380
- test_done
381
- EOF
382
- check_sub_test_lib_test run-range <<-\EOF
341
+ run_sub_test_lib_test git-skip-tests-several \
342
+ --run="1-3" &&
343
+ check_sub_test_lib_test git-skip-tests-several <<-\EOF
383
344
> ok 1 - passing test #1
384
345
> ok 2 - passing test #2
385
346
> ok 3 - passing test #3
@@ -392,15 +353,9 @@ test_expect_success 'subtest: --run with a range' '
392
353
'
393
354
394
355
test_expect_success ' subtest: --run with two ranges' '
395
- write_and_run_sub_test_lib_test run-two-ranges \
396
- --run="1-2,5-6" <<-\EOF &&
397
- for i in 1 2 3 4 5 6
398
- do
399
- test_expect_success "passing test #$i" "true"
400
- done
401
- test_done
402
- EOF
403
- check_sub_test_lib_test run-two-ranges <<-\EOF
356
+ run_sub_test_lib_test git-skip-tests-several \
357
+ --run="1-2,5-6" &&
358
+ check_sub_test_lib_test git-skip-tests-several <<-\EOF
404
359
> ok 1 - passing test #1
405
360
> ok 2 - passing test #2
406
361
> ok 3 # skip passing test #3 (--run)
@@ -413,15 +368,9 @@ test_expect_success 'subtest: --run with two ranges' '
413
368
'
414
369
415
370
test_expect_success ' subtest: --run with a left open range' '
416
- write_and_run_sub_test_lib_test run-left-open-range \
417
- --run="-3" <<-\EOF &&
418
- for i in 1 2 3 4 5 6
419
- do
420
- test_expect_success "passing test #$i" "true"
421
- done
422
- test_done
423
- EOF
424
- check_sub_test_lib_test run-left-open-range <<-\EOF
371
+ run_sub_test_lib_test git-skip-tests-several \
372
+ --run="-3" &&
373
+ check_sub_test_lib_test git-skip-tests-several <<-\EOF
425
374
> ok 1 - passing test #1
426
375
> ok 2 - passing test #2
427
376
> ok 3 - passing test #3
@@ -434,15 +383,9 @@ test_expect_success 'subtest: --run with a left open range' '
434
383
'
435
384
436
385
test_expect_success ' subtest: --run with a right open range' '
437
- write_and_run_sub_test_lib_test run-right-open-range \
438
- --run="4-" <<-\EOF &&
439
- for i in 1 2 3 4 5 6
440
- do
441
- test_expect_success "passing test #$i" "true"
442
- done
443
- test_done
444
- EOF
445
- check_sub_test_lib_test run-right-open-range <<-\EOF
386
+ run_sub_test_lib_test git-skip-tests-several \
387
+ --run="4-" &&
388
+ check_sub_test_lib_test git-skip-tests-several <<-\EOF
446
389
> ok 1 # skip passing test #1 (--run)
447
390
> ok 2 # skip passing test #2 (--run)
448
391
> ok 3 # skip passing test #3 (--run)
@@ -455,15 +398,9 @@ test_expect_success 'subtest: --run with a right open range' '
455
398
'
456
399
457
400
test_expect_success ' subtest: --run with basic negation' '
458
- write_and_run_sub_test_lib_test run-basic-neg \
459
- --run="!3" <<-\EOF &&
460
- for i in 1 2 3 4 5 6
461
- do
462
- test_expect_success "passing test #$i" "true"
463
- done
464
- test_done
465
- EOF
466
- check_sub_test_lib_test run-basic-neg <<-\EOF
401
+ run_sub_test_lib_test git-skip-tests-several \
402
+ --run="!3" &&
403
+ check_sub_test_lib_test git-skip-tests-several <<-\EOF
467
404
> ok 1 - passing test #1
468
405
> ok 2 - passing test #2
469
406
> ok 3 # skip passing test #3 (--run)
@@ -476,15 +413,9 @@ test_expect_success 'subtest: --run with basic negation' '
476
413
'
477
414
478
415
test_expect_success ' subtest: --run with two negations' '
479
- write_and_run_sub_test_lib_test run-two-neg \
480
- --run="!3,!6" <<-\EOF &&
481
- for i in 1 2 3 4 5 6
482
- do
483
- test_expect_success "passing test #$i" "true"
484
- done
485
- test_done
486
- EOF
487
- check_sub_test_lib_test run-two-neg <<-\EOF
416
+ run_sub_test_lib_test git-skip-tests-several \
417
+ --run="!3,!6" &&
418
+ check_sub_test_lib_test git-skip-tests-several <<-\EOF
488
419
> ok 1 - passing test #1
489
420
> ok 2 - passing test #2
490
421
> ok 3 # skip passing test #3 (--run)
@@ -497,15 +428,9 @@ test_expect_success 'subtest: --run with two negations' '
497
428
'
498
429
499
430
test_expect_success ' subtest: --run a range and negation' '
500
- write_and_run_sub_test_lib_test run-range-and-neg \
501
- --run="-4,!2" <<-\EOF &&
502
- for i in 1 2 3 4 5 6
503
- do
504
- test_expect_success "passing test #$i" "true"
505
- done
506
- test_done
507
- EOF
508
- check_sub_test_lib_test run-range-and-neg <<-\EOF
431
+ run_sub_test_lib_test git-skip-tests-several \
432
+ --run="-4,!2" &&
433
+ check_sub_test_lib_test git-skip-tests-several <<-\EOF
509
434
> ok 1 - passing test #1
510
435
> ok 2 # skip passing test #2 (--run)
511
436
> ok 3 - passing test #3
@@ -518,15 +443,9 @@ test_expect_success 'subtest: --run a range and negation' '
518
443
'
519
444
520
445
test_expect_success ' subtest: --run range negation' '
521
- write_and_run_sub_test_lib_test run-range-neg \
522
- --run="!1-3" <<-\EOF &&
523
- for i in 1 2 3 4 5 6
524
- do
525
- test_expect_success "passing test #$i" "true"
526
- done
527
- test_done
528
- EOF
529
- check_sub_test_lib_test run-range-neg <<-\EOF
446
+ run_sub_test_lib_test git-skip-tests-several \
447
+ --run="!1-3" &&
448
+ check_sub_test_lib_test git-skip-tests-several <<-\EOF
530
449
> ok 1 # skip passing test #1 (--run)
531
450
> ok 2 # skip passing test #2 (--run)
532
451
> ok 3 # skip passing test #3 (--run)
@@ -539,15 +458,9 @@ test_expect_success 'subtest: --run range negation' '
539
458
'
540
459
541
460
test_expect_success ' subtest: --run include, exclude and include' '
542
- write_and_run_sub_test_lib_test run-inc-neg-inc \
543
- --run="1-5,!1-3,2" <<-\EOF &&
544
- for i in 1 2 3 4 5 6
545
- do
546
- test_expect_success "passing test #$i" "true"
547
- done
548
- test_done
549
- EOF
550
- check_sub_test_lib_test run-inc-neg-inc <<-\EOF
461
+ run_sub_test_lib_test git-skip-tests-several \
462
+ --run="1-5,!1-3,2" &&
463
+ check_sub_test_lib_test git-skip-tests-several <<-\EOF
551
464
> ok 1 # skip passing test #1 (--run)
552
465
> ok 2 - passing test #2
553
466
> ok 3 # skip passing test #3 (--run)
@@ -560,15 +473,9 @@ test_expect_success 'subtest: --run include, exclude and include' '
560
473
'
561
474
562
475
test_expect_success ' subtest: --run include, exclude and include, comma separated' '
563
- write_and_run_sub_test_lib_test run-inc-neg-inc-comma \
564
- --run=1-5,!1-3,2 <<-\EOF &&
565
- for i in 1 2 3 4 5 6
566
- do
567
- test_expect_success "passing test #$i" "true"
568
- done
569
- test_done
570
- EOF
571
- check_sub_test_lib_test run-inc-neg-inc-comma <<-\EOF
476
+ run_sub_test_lib_test git-skip-tests-several \
477
+ --run=1-5,!1-3,2 &&
478
+ check_sub_test_lib_test git-skip-tests-several <<-\EOF
572
479
> ok 1 # skip passing test #1 (--run)
573
480
> ok 2 - passing test #2
574
481
> ok 3 # skip passing test #3 (--run)
@@ -581,15 +488,9 @@ test_expect_success 'subtest: --run include, exclude and include, comma separate
581
488
'
582
489
583
490
test_expect_success ' subtest: --run exclude and include' '
584
- write_and_run_sub_test_lib_test run-neg-inc \
585
- --run="!3-,5" <<-\EOF &&
586
- for i in 1 2 3 4 5 6
587
- do
588
- test_expect_success "passing test #$i" "true"
589
- done
590
- test_done
591
- EOF
592
- check_sub_test_lib_test run-neg-inc <<-\EOF
491
+ run_sub_test_lib_test git-skip-tests-several \
492
+ --run="!3-,5" &&
493
+ check_sub_test_lib_test git-skip-tests-several <<-\EOF
593
494
> ok 1 - passing test #1
594
495
> ok 2 - passing test #2
595
496
> ok 3 # skip passing test #3 (--run)
@@ -602,15 +503,9 @@ test_expect_success 'subtest: --run exclude and include' '
602
503
'
603
504
604
505
test_expect_success ' subtest: --run empty selectors' '
605
- write_and_run_sub_test_lib_test run-empty-sel \
606
- --run="1,,3,,,5" <<-\EOF &&
607
- for i in 1 2 3 4 5 6
608
- do
609
- test_expect_success "passing test #$i" "true"
610
- done
611
- test_done
612
- EOF
613
- check_sub_test_lib_test run-empty-sel <<-\EOF
506
+ run_sub_test_lib_test git-skip-tests-several \
507
+ --run="1,,3,,,5" &&
508
+ check_sub_test_lib_test git-skip-tests-several <<-\EOF
614
509
> ok 1 - passing test #1
615
510
> ok 2 # skip passing test #2 (--run)
616
511
> ok 3 - passing test #3
@@ -660,12 +555,9 @@ test_expect_success 'subtest: --run keyword selection' '
660
555
'
661
556
662
557
test_expect_success ' subtest: --run invalid range end' '
663
- write_and_run_sub_test_lib_test_err run-inv-range-end \
664
- --run="1-z" <<-\EOF &&
665
- test_expect_success "passing test #1" "true"
666
- test_done
667
- EOF
668
- check_sub_test_lib_test_err run-inv-range-end \
558
+ run_sub_test_lib_test_err run-inv-range-start \
559
+ --run="1-z" &&
560
+ check_sub_test_lib_test_err run-inv-range-start \
669
561
<<-\EOF_OUT 3<<-EOF_ERR
670
562
> FATAL: Unexpected exit with code 1
671
563
EOF_OUT
0 commit comments