summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2024-07-26 13:38:51 -0400
committerTavian Barnes <tavianator@tavianator.com>2024-08-01 15:47:43 -0400
commit871f9f005e06c40ac9fd28d55198fe42a9539c66 (patch)
treea9ae193d5ff326223ae1a0949b04470a93d120ca
parent7780379b27b868fe240d7ec1ceb6902280029731 (diff)
downloadbfs-871f9f005e06c40ac9fd28d55198fe42a9539c66.tar.xz
tests: Fix line number reported when wait -n fails
-rw-r--r--tests/run.sh5
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