Files
scm_breeze/run_tests.sh
Matthew Rothenberg c234916b2b scripts should exit rather than return
some shells are pickier about this.  darwin uses a newer version of sh
that complains about it.  this is the ‘proper’ behavior in either
scenario.
2014-10-16 17:08:29 -04:00

27 lines
580 B
Bash
Executable File

#!/bin/sh
# Run SCM Breeze shUnit2 tests
failed=false
# allow list of shells to run tests in to be overriden by environment variable
# if empty or null, use defaults
if [ -z "$TEST_SHELLS" ]; then
TEST_SHELLS="bash zsh"
fi
echo "== Will run all tests with following shells: ${TEST_SHELLS}"
for test in $(find test/lib -name *_test.sh); do
for shell in $TEST_SHELLS; do
echo "== Running tests with [$shell]: $test"
$shell $test || failed=true
done
done
if [ "$failed" = "true" ]; then
echo "Tests failed!"
exit 1;
else
echo "All tests passed!"
exit 0;
fi