mirror of https://github.com/tmux-plugins/tpm
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
727 B
38 lines
727 B
9 years ago
|
#!/usr/bin/env bash
|
||
|
|
||
|
CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||
|
|
||
|
run_vagrant() {
|
||
9 years ago
|
vagrant up
|
||
9 years ago
|
}
|
||
|
|
||
9 years ago
|
# Halt vagrant after tests are done running, unless KEEP_RUNNING environment
|
||
|
# variable is set to 'true'.
|
||
9 years ago
|
stop_vagrant() {
|
||
9 years ago
|
if [ -z "$KEEP_RUNNING" ]; then
|
||
|
vagrant halt
|
||
|
fi
|
||
|
}
|
||
|
|
||
|
test_files() {
|
||
|
ls -1 ./tests/ | # test files are in `./tests/` dir
|
||
|
grep -i '^test' | # test file names start with 'test'
|
||
|
xargs # file names in one line
|
||
9 years ago
|
}
|
||
|
|
||
|
run_tests() {
|
||
9 years ago
|
local test_file
|
||
9 years ago
|
local test_dir_path="~/tpm/tests/"
|
||
9 years ago
|
for test_file in $(test_files); do
|
||
|
echo "Running test: $test_file"
|
||
|
vagrant ssh -c "${test_dir_path}${test_file}"
|
||
|
done
|
||
9 years ago
|
}
|
||
|
|
||
|
main() {
|
||
9 years ago
|
run_vagrant
|
||
|
run_tests
|
||
|
stop_vagrant
|
||
9 years ago
|
}
|
||
|
main
|