tempest/run_tests.sh
Aaron Lee 78dbb64366 Making run_test.sh python version and directory
agnostic

Refactored some of the shell scripts to handle
being run from another directory, as well as to
not force the use of 2.6

edit: format the comments

Change-Id: Id92b9dc82743598b7c570e431cad423c8a2ee95d
2011-10-18 14:24:26 -05:00

42 lines
858 B
Bash
Executable File

#!/bin/bash
function usage {
echo "Usage: [OPTIONS] [SUITES]"
echo "Run all of the test suites"
echo ""
echo " -h, --help Print this usage message"
echo ""
echo " The suites should be listed by the name of their directory."
echo " All other options are passed directly to the suites."
exit
}
function process_option {
case "$1" in
-h|--help) usage;;
-*|--*) test_opts="$test_opts $1";;
*) tests="$tests $1"
esac
}
for arg in "$@"; do
process_option $arg
done
echo $test_opts
function run_tests {
base_dir=$(dirname $0)
for test_dir in $tests
do
test_cmd="${base_dir}/${test_dir}/run_tests.sh ${test_opts}"
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
echo $test_cmd
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
$test_cmd
done
}
run_tests || exit