test.bash: pass all `.bats` files to `bats`
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Fri, 15 May 2020 19:35:00 +0000 (15:35 -0400)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Fri, 22 May 2020 16:30:18 +0000 (12:30 -0400)
This makes `bats` accumulate tests and run all of them with a global
progress, which is much better.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
tests/test.bash

index 74cf16b12d94e75565c3a120c3eb663dcadeea8b..aabce21c2d57d3761ef60cebceb64db7fa78b9cd 100755 (executable)
@@ -40,21 +40,10 @@ test_dirs=(
   "config/pass/everything"
 )
 bats_bin="$(pwd)/bats/bin/bats"
-rc=0
 
 if [ -z "${CC+x}" ]; then
   # default to gcc
   export CC=gcc
 fi
 
-for d in "${test_dirs[@]}"; do
-  pushd "$d" >/dev/null
-  $bats_bin "${@}" .
-  if [ $? -ne 0 ]; then
-    # latch error, but continue other tests
-    rc=1
-  fi
-  popd >/dev/null
-done
-
-exit $rc
+"$bats_bin" "${test_dirs[@]}"
This page took 0.02432 seconds and 4 git commands to generate.