tpm/run-tests
2014-11-20 02:09:24 +01:00

32 lines
535 B
Bash
Executable File

#!/usr/bin/env bash
CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# running test suite is successful by default
tests_exit_value=0
run_vagrant() {
vagrant up
}
# Halt vagrant after tests are done running, unless KEEP_RUNNING environment
# variable is set to 'true'.
stop_vagrant() {
if [ -z "$KEEP_RUNNING" ]; then
vagrant halt
fi
}
run_tests() {
vagrant ssh -c "cd ~/tpm; ./tests/run-tests-within-vm"
tests_exit_value=$?
}
main() {
run_vagrant
run_tests
stop_vagrant
exit "$tests_exit_value"
}
main