diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2024-07-26 13:38:51 -0400 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2024-08-01 15:47:43 -0400 |
commit | 871f9f005e06c40ac9fd28d55198fe42a9539c66 (patch) | |
tree | a9ae193d5ff326223ae1a0949b04470a93d120ca /tests | |
parent | 7780379b27b868fe240d7ec1ceb6902280029731 (diff) | |
download | bfs-871f9f005e06c40ac9fd28d55198fe42a9539c66.tar.xz |
tests: Fix line number reported when wait -n fails
Diffstat (limited to 'tests')
-rw-r--r-- | tests/run.sh | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/run.sh b/tests/run.sh index 115a036..1b1e600 100644 --- a/tests/run.sh +++ b/tests/run.sh @@ -94,9 +94,10 @@ reap_test() { # Wait for a background test to finish wait_test() { - local pid + local pid line while true; do + line=$((LINENO + 1)) wait -n -ppid ret=$? @@ -106,7 +107,7 @@ wait_test() { # Interrupted by signal continue else - debug "${BASH_SOURCE[0]}" $((LINENO - 3)) "${RED}error $ret${RST}" >&$DUPERR + debug "${BASH_SOURCE[0]}" $line "${RED}error $ret${RST}" >&$DUPERR exit 1 fi done |