@@ -74,7 +74,11 @@ set ::stack_logging 0
74
74
set ::verbose 0
75
75
set ::quiet 0
76
76
set ::denytags {}
77
+ set ::skiptests {}
77
78
set ::allowtags {}
79
+ set ::only_tests {}
80
+ set ::single_tests {}
81
+ set ::skip_till " "
78
82
set ::external 0; # If "1" this means, we are running against external instance
79
83
set ::file " " ; # If set, runs only the tests in this comma separated list
80
84
set ::curfile " " ; # Hold the filename of the current suite
@@ -255,6 +259,8 @@ proc accept_test_clients {fd addr port} {
255
259
# testing: just used to signal that a given test started.
256
260
# ok: a test was executed with success.
257
261
# err: a test was executed with an error.
262
+ # skip: a test was skipped by skipfile or individual test options.
263
+ # ignore: a test was skipped by a group tag.
258
264
# exception: there was a runtime exception while executing the test.
259
265
# done: all the specified test file was processed, this test client is
260
266
# ready to accept a new task.
@@ -283,6 +289,14 @@ proc read_from_test_client fd {
283
289
puts " \[ [ colorstr green $status ] \] : $data "
284
290
}
285
291
set ::active_clients_task($fd ) " (OK) $data "
292
+ } elseif {$status eq {skip}} {
293
+ if {!$::quiet } {
294
+ puts " \[ [ colorstr yellow $status ] \] : $data "
295
+ }
296
+ } elseif {$status eq {ignore}} {
297
+ if {!$::quiet } {
298
+ puts " \[ [ colorstr cyan $status ] \] : $data "
299
+ }
286
300
} elseif {$status eq {err}} {
287
301
set err " \[ [ colorstr red $status ] \] : $data "
288
302
puts $err
@@ -412,11 +426,15 @@ proc print_help_screen {} {
412
426
" --stack-logging Enable OSX leaks/malloc stack logging."
413
427
" --accurate Run slow randomized tests for more iterations."
414
428
" --quiet Don't show individual tests."
415
- " --single <unit> Just execute the specified unit (see next option)."
429
+ " --single <unit> Just execute the specified unit (see next option). this option can be repeated. "
416
430
" --list-tests List all the available test units."
431
+ " --only <test> Just execute the specified test by test name. this option can be repeated."
432
+ " --skiptill <unit> Skip all units until (and including) the specified one."
417
433
" --clients <num> Number of test clients (default 16)."
418
434
" --timeout <sec> Test timeout in seconds (default 10 min)."
419
435
" --force-failure Force the execution of a test that always fails."
436
+ " --config <k> <v> extra config file argument"
437
+ " --skipfile <file> name of a file containing test names that should be skipped (one per line)"
420
438
" --dont-clean don't delete redis log files after the run"
421
439
" --wait-server wait after server is started (so that you can attach a debugger)"
422
440
" --help Print this help screen."
@@ -436,6 +454,18 @@ for {set j 0} {$j < [llength $argv]} {incr j} {
436
454
}
437
455
}
438
456
incr j
457
+ } elseif {$opt eq {--config}} {
458
+ set arg2 [lindex $argv [expr $j +2]]
459
+ lappend ::global_overrides $arg
460
+ lappend ::global_overrides $arg2
461
+ incr j
462
+ incr j
463
+ } elseif {$opt eq {--skipfile}} {
464
+ incr j
465
+ set fp [open $arg r]
466
+ set file_data [read $fp ]
467
+ close $fp
468
+ set ::skiptests [split $file_data " \n " ]
439
469
} elseif {$opt eq {--valgrind}} {
440
470
set ::valgrind 1
441
471
} elseif {$opt eq {--stack-logging}} {
@@ -456,7 +486,13 @@ for {set j 0} {$j < [llength $argv]} {incr j} {
456
486
} elseif {$opt eq {--force-failure}} {
457
487
set ::force_failure 1
458
488
} elseif {$opt eq {--single}} {
459
- set ::all_tests $arg
489
+ lappend ::single_tests $arg
490
+ incr j
491
+ } elseif {$opt eq {--only}} {
492
+ lappend ::only_tests $arg
493
+ incr j
494
+ } elseif {$opt eq {--skiptill}} {
495
+ set ::skip_till $arg
460
496
incr j
461
497
} elseif {$opt eq {--list-tests}} {
462
498
foreach t $::all_tests {
@@ -488,6 +524,26 @@ for {set j 0} {$j < [llength $argv]} {incr j} {
488
524
}
489
525
}
490
526
527
+ if {$::skip_till != " " } {
528
+ set skipping 1
529
+ foreach t $::all_tests {
530
+ if {$skipping == 0} {
531
+ lappend ::single_tests $t
532
+ }
533
+ if {$t == $::skip_till } {
534
+ set skipping 0
535
+ }
536
+ }
537
+ if {$skipping } {
538
+ puts " test $::skip_till not found"
539
+ exit 0
540
+ }
541
+ }
542
+
543
+ if {[llength $::single_tests ] > 0} {
544
+ set ::all_tests $::single_tests
545
+ }
546
+
491
547
proc attach_to_replication_stream {} {
492
548
set s [socket [srv 0 " host" ] [srv 0 " port" ]]
493
549
fconfigure $s -translation binary
0 commit comments