mirror of
https://github.com/tmux-plugins/tpm.git
synced 2025-11-02 23:36:03 +00:00
Refactor the tests for travis
This commit is contained in:
18
run-tests
18
run-tests
@@ -2,6 +2,9 @@
|
||||
|
||||
CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
# running test suite is successful by default
|
||||
tests_exit_value=0
|
||||
|
||||
run_vagrant() {
|
||||
vagrant up
|
||||
}
|
||||
@@ -14,24 +17,15 @@ stop_vagrant() {
|
||||
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
|
||||
}
|
||||
|
||||
run_tests() {
|
||||
local test_file
|
||||
local test_dir_path="~/tpm/tests/"
|
||||
for test_file in $(test_files); do
|
||||
echo "Running test: $test_file"
|
||||
vagrant ssh -c "${test_dir_path}${test_file}"
|
||||
done
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user