summaryrefslogtreecommitdiff
path: root/test/test
diff options
context:
space:
mode:
authorAnish Athalye <me@anishathalye.com>2020-01-03 15:20:00 -0500
committerAnish Athalye <me@anishathalye.com>2020-01-03 15:34:46 -0500
commit6d24613b0b453e546fa4e9defc695d8f982743c9 (patch)
tree7e5124b2606284ef761cd69fcb8892d0038d297d /test/test
parent1e1885c45a28190dc1cbde993a9ddcf1729ee4d1 (diff)
Unify Vagrant and Travis-CI tests
This patch makes the tests (including the test driver) run entirely inside Vagrant, which avoids calling the very slow `vagrant` driver many times for running the tests. On my machine, `./test` runs in 22 seconds, down from hundreds of seconds prior to this patch. This also has the nice side effect of matching how the Travis CI tests were run, so there's no need for a separate `test_travis` anymore.
Diffstat (limited to 'test/test')
-rwxr-xr-xtest/test26
1 files changed, 5 insertions, 21 deletions
diff --git a/test/test b/test/test
index c018c32..f944512 100755
--- a/test/test
+++ b/test/test
@@ -1,37 +1,21 @@
#!/usr/bin/env bash
set -e
-BASEDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
-cd "${BASEDIR}"
+export BASEDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
+cd "${BASEDIR}/test"
. "./driver-lib.bash"
+date_stamp="$(date --rfc-3339=ns)"
start="$(date +%s)"
-check_prereqs || die "prerequisites unsatsfied."
-
-# command line options
-while [[ $# > 1 ]]
-do
- key="${1}"
- case $key in
- -v|--version)
- VERSION="${2}"
- shift && shift
- ;;
- *)
- # unknown option
- break
- ;;
- esac
-done
-VERSION="${VERSION:-3.6.4}"
+check_env
declare -a tests=()
if [ $# -eq 0 ]; then
while read file; do
tests+=("${file}")
- done < <(find tests -type f -name '*.bash')
+ done < <(find tests -type f -name '*.bash' | sort)
else
tests=("$@")
fi