You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,11 @@
2
2
3
3
## Unreleased
4
4
5
+
### Added
6
+
-`--test-timeout <seconds>` flag and `BASHUNIT_TEST_TIMEOUT` env var: abort an individual test that runs longer than the given number of seconds, report it as a failure and keep running the rest. Disabled by default (`0`); needs no external `timeout` command and works on Bash 3.2+ (#721)
7
+
5
8
### Fixed
9
+
- A test that exited non-zero no longer poisons the exit code of subsequent tests in the same file (the per-test exit code was accumulated instead of reset)
6
10
- Coverage report now counts backslash line-continuation lines as covered: a multi-line statement's hit is propagated forward across its continuation chain, so the lines after a trailing `\` are no longer reported as uncovered (#722)
Copy file name to clipboardExpand all lines: docs/configuration.md
+24Lines changed: 24 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -127,6 +127,30 @@ By default, when an assertion fails within a test, subsequent assertions in the
127
127
The `--stop-on-failure` flag is separate – it stops the entire test runner after a failing **test**, while assertion-level stopping happens within each test.
128
128
:::
129
129
130
+
## Test timeout
131
+
132
+
> `BASHUNIT_TEST_TIMEOUT=<seconds>`
133
+
134
+
Abort an individual test if it runs longer than the given number of seconds,
135
+
report it as a failure and keep running the remaining tests. `0` (disabled) by
136
+
default. Useful to stop a run from hanging forever on a blocked test, such as a
137
+
mock left without an implementation.
138
+
139
+
The value is expressed in whole seconds and applies per test (set up and tear
140
+
down included). It needs no external `timeout` command and works on Bash 3.2+,
141
+
including the default macOS Bash.
142
+
143
+
Similar as using `--test-timeout` option on the [command line](/command-line#test-timeout).
0 commit comments