File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5,6 +5,9 @@ bats_require_minimum_version 1.5.0
55load test_helper
66fixtures parallel
77
8+ # shellcheck disable=SC2034
9+ BATS_TEST_TIMEOUT=10 # only intended for the "short form ..."" test
10+
811setup () {
912 type -p parallel & > /dev/null || skip " --jobs requires GNU parallel"
1013 (type -p flock & > /dev/null || type -p shlock & > /dev/null) || skip " --jobs requires flock/shlock"
@@ -208,3 +211,10 @@ check_parallel_tests() { # <expected maximum parallelity>
208211@test " BATS_NO_PARALLELIZE_WITHIN_FILE does not work from inside test function" {
209212 DISABLE_IN_TEST_FUNCTION=1 reentrant_run ! bats --jobs 2 " $FIXTURE_ROOT /must_not_parallelize_within_file.bats"
210213}
214+
215+ @test " Short form typo does not run endlessly" {
216+ unset BATS_NO_PARALLELIZE_ACROSS_FILES
217+ run bats -j2 " $FIXTURE_ROOT /../bats/passing.bats"
218+ (( SECONDS < 5 ))
219+ [ " ${lines[1]} " = ' Invalid number of jobs: -2' ]
220+ }
Original file line number Diff line number Diff line change @@ -23,3 +23,7 @@ bats_require_minimum_version 1.5.0
2323 [ " ${lines[3]} " == " # \` sleep \"\$ {SLEEP?}\" ' failed due to timeout" ]
2424 (( SECONDS < 10 )) || false
2525}
26+
27+ @test " sleep in run" {
28+ run sleep 10
29+ }
You can’t perform that action at this time.
0 commit comments