split tests up by shell for concurrency

More parallelism = faster tests.  Also better isolation for changes that
might only break on zsh or bash respectively.

This is defined via env variable, so someone running locally will have
all tests run sequentially as before.
This commit is contained in:
Matthew Rothenberg
2014-10-15 14:12:24 -04:00
parent 802f4987c3
commit b6fd7ae829
2 changed files with 15 additions and 2 deletions

View File

@@ -2,6 +2,12 @@ os:
- linux - linux
- osx - osx
env:
- TEST_SHELLS="zsh bash"
- TEST_SHELLS=bash
- TEST_SHELLS=zsh
- HI=mom
install: install:
- ./test/support/travisci_deps.sh - ./test/support/travisci_deps.sh

View File

@@ -3,8 +3,15 @@
failed=false 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 test in $(find test/lib -name *_test.sh); do
for shell in bash zsh; do for shell in $TEST_SHELLS; do
echo "== Running tests with [$shell]: $test" echo "== Running tests with [$shell]: $test"
$shell $test || failed=true $shell $test || failed=true
done done