mirror of
https://github.com/kforney/pentest-distro-builder.git
synced 2024-05-16 15:34:50 -06:00
Kaj Forney
582f5b5f5c
Former-commit-id: 09eacc3f3f761c2b3454d20356ba085d18bdb722 Former-commit-id: 89d8a1302bd2a72239fbe9ad9820be4ecda76cab
43 lines
976 B
Bash
Executable file
43 lines
976 B
Bash
Executable file
#!/usr/bin/env bash
|
|
|
|
# This file is a symlink from 'tmux-test' plugin.
|
|
# You probably don't want to edit it.
|
|
|
|
# This script should be run within an isolated enviroment (Vagrant, travis).
|
|
# Depending on what the tests do, it might NOT be safe to run this script
|
|
# directly on the development machine.
|
|
|
|
CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
|
|
|
EXIT_VALUE=0 # running a test suite is successful by default
|
|
|
|
test_files() {
|
|
ls -1 "$CURRENT_DIR" | # test files are in the current dir
|
|
\grep -i "^test" | # test file names start with "test"
|
|
xargs # file names in a single line
|
|
}
|
|
|
|
set_exit_val_to_false() {
|
|
EXIT_VALUE=1
|
|
}
|
|
|
|
run_tests() {
|
|
local test_file
|
|
for test_file in $(test_files); do
|
|
echo "Running test: $test_file"
|
|
"${CURRENT_DIR}/${test_file}"
|
|
|
|
# handling exit value
|
|
local test_exit_value="$?"
|
|
if [ "$test_exit_value" -ne 0 ]; then
|
|
set_exit_val_to_false
|
|
fi
|
|
done
|
|
}
|
|
|
|
main() {
|
|
run_tests
|
|
exit "$EXIT_VALUE"
|
|
}
|
|
main
|