Release 0.31.0
🔧 New features
Code coverage tracking
Track line coverage for your bash scripts using the new coverage options. See the full coverage documentation for details.
bashunit --coverage tests/bashunit --coverage-report coverage/lcov.info tests/bashunit --coverage-report-html coverage/ tests/Coverage is tracked using Bash's DEBUG trap mechanism. You can customize which paths to track and exclude:
bashunit --coverage --coverage-paths src/ lib/ tests/bashunit --coverage --coverage-exclude "tests/*,vendor/*" tests/The report shows covered and uncovered lines with color-coded highlighting, making it easy to identify gaps in your test coverage.
Minimum coverage threshold
Enforce a minimum coverage percentage with --coverage-min:
bashunit --coverage --coverage-min 80 tests/Coverage: 75.5% (below minimum 80%)
Exit code: 1The test run fails if coverage falls below the threshold, useful for CI pipelines.
Color-coded coverage output
Console coverage output uses color-coded thresholds:
- Below 50%: red
- 50-80%: yellow
- Above 80%: green
Lifecycle hook visibility
See exactly how long your setup and teardown scripts take:
Running set_up_before_script... done (2.3s)
✓ Passed: My test 45 ms
Running tear_down_after_script... done (0.5s)This helps identify slow setup and teardown operations that may be affecting your test suite performance. The output is suppressed in failures-only and parallel modes.
🐛 Bug fixes
- Fixed
benchcommand not working in standalone/installed bashunit (missingbenchmark.shin build) - Fixed
helper::get_latest_tagreturning version with^{}suffix from annotated git tags - Skip files with no matching tests when using
--filter - Fixed simple output without before/after script timing
See the full changelog on GitHub