mirror of
https://github.com/tmux-plugins/tpm.git
synced 2025-11-02 23:36:03 +00:00
Change testing directory structure
This commit is contained in:
37
run-tests
Executable file
37
run-tests
Executable file
@@ -0,0 +1,37 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
main() {
|
||||
run_vagrant
|
||||
run_tests
|
||||
stop_vagrant
|
||||
}
|
||||
main
|
||||
Reference in New Issue
Block a user