From 871f9f005e06c40ac9fd28d55198fe42a9539c66 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Fri, 26 Jul 2024 13:38:51 -0400 Subject: tests: Fix line number reported when wait -n fails --- tests/run.sh | 5 +++-- 1 file 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 -- cgit v1.2.3