]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
test-lib: Fix a bash-4.4 issue.
authorAndre Noll <maan@tuebingen.mpg.de>
Sun, 25 Sep 2016 13:56:43 +0000 (15:56 +0200)
committerAndre Noll <maan@tuebingen.mpg.de>
Tue, 4 Oct 2016 08:56:36 +0000 (10:56 +0200)
Apparently bash-4.4 changed how unquoted here strings are treated.
We want to process only the first line of the output, so the right
thing to do is to ask awk to exit after processing the first line.
This works regardless of the bash version.

t/test-lib.sh

index 99e575d3b66d0f54e9746647eee1af4eba84fa2c..1f9913e3cf9ba49b4cb76cc5b985d914cb527b69 100644 (file)
@@ -156,7 +156,7 @@ test_require_executables()
 test_duration()
 {
        local t=$(exec 2>&1 1>/dev/null; time -p "$@")
 test_duration()
 {
        local t=$(exec 2>&1 1>/dev/null; time -p "$@")
-       result=$(awk '{print $2 * 1000}' <<< $t)
+       result=$(awk '{print $2 * 1000; exit 0}' <<< "$t")
 }
 
 test_expect_success()
 }
 
 test_expect_success()