1
0
Fork 0
mirror of synced 2024-12-13 19:05:45 -05:00
tpm/run-tests
2014-11-20 02:09:24 +01:00

31 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