Fix: return proper exit code on test failure
authorMichael Jeanson <mjeanson@efficios.com>
Tue, 17 Oct 2017 18:50:48 +0000 (14:50 -0400)
committerMichael Jeanson <mjeanson@efficios.com>
Tue, 17 Oct 2017 18:50:48 +0000 (14:50 -0400)
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
tests/test.bash

index cc50e71e098c24b00c143ff5deab1227531e11e6..ec3f492ffd1ab32020285243dd63b0ec2a695cd0 100755 (executable)
@@ -42,20 +42,19 @@ test_dirs=(
 bats_bin="$(pwd)/bats/bin/bats"
 rc=0
 
-if [ -z ${CC+x} ]; then
+if [ -z "${CC+x}" ]; then
   # default to gcc
   export CC=gcc
 fi
 
-for d in ${test_dirs[@]}; do
-  pushd $d
-  $bats_bin $@ .
-  popd
-
+for d in "${test_dirs[@]}"; do
+  pushd "$d"
+  $bats_bin "${@}" .
   if [ $? -ne 0 ]; then
     # latch error, but continue other tests
     rc=1
   fi
+  popd
 done
 
 exit $rc
This page took 0.024745 seconds and 4 git commands to generate.