Problem
bench is silent and green where test is explicit and red:
| invocation | bashunit test | bashunit bench |
|---|
| file that does not exist | No tests found, exit 1 | header only, exit 0 |
| directory that does not exist | No tests found, exit 1 | header only, exit 0 |
| file present, nothing to run | No tests found, exit 1 | header only, exit 0 |
$ bashunit bench nope_bench.sh
bashunit - 0.47.0
$ echo $?
0
A typo in a path or in the bench_ prefix produces a green run that measured
nothing. In CI that is a benchmark job passing without executing a single
benchmark — the same silent-green shape as #1145 and #1147, on a subcommand
whose whole output is numbers nobody will notice are missing.
Not filing the other one
A bench_ function whose body fails (a command that does not exist) is
reported as a normal result with a timing. That looks wrong, but the documented
failure conditions for bench are all timing-based — @max_ms, baseline
tolerance, a missing baseline — and a body may legitimately exit non-zero. Out
of scope without a maintainer's view.
Fix
Match test: say nothing was found and exit non-zero. The message can borrow
the existing wording rather than inventing a new one.
Problem
benchis silent and green wheretestis explicit and red:bashunit testbashunit benchNo tests found, exit 1No tests found, exit 1No tests found, exit 1A typo in a path or in the
bench_prefix produces a green run that measurednothing. In CI that is a benchmark job passing without executing a single
benchmark — the same silent-green shape as #1145 and #1147, on a subcommand
whose whole output is numbers nobody will notice are missing.
Not filing the other one
A
bench_function whose body fails (a command that does not exist) isreported as a normal result with a timing. That looks wrong, but the documented
failure conditions for
benchare all timing-based —@max_ms, baselinetolerance, a missing baseline — and a body may legitimately exit non-zero. Out
of scope without a maintainer's view.
Fix
Match
test: say nothing was found and exit non-zero. The message can borrowthe existing wording rather than inventing a new one.