Justin Shepherd | 0d9bbd1 | 2011-08-11 12:57:44 -0500 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 3 | function usage { |
Aaron Lee | 2355a4b | 2011-10-13 13:43:16 -0500 | [diff] [blame] | 4 | echo "Usage: [OPTIONS] [SUITES]" |
| 5 | echo "Run all of the test suites" |
Justin Shepherd | 0d9bbd1 | 2011-08-11 12:57:44 -0500 | [diff] [blame] | 6 | echo "" |
Justin Shepherd | 0d9bbd1 | 2011-08-11 12:57:44 -0500 | [diff] [blame] | 7 | echo " -h, --help Print this usage message" |
| 8 | echo "" |
Aaron Lee | 2355a4b | 2011-10-13 13:43:16 -0500 | [diff] [blame] | 9 | echo " The suites should be listed by the name of their directory." |
| 10 | echo " All other options are passed directly to the suites." |
Justin Shepherd | 0d9bbd1 | 2011-08-11 12:57:44 -0500 | [diff] [blame] | 11 | exit |
| 12 | } |
| 13 | |
| 14 | function process_option { |
| 15 | case "$1" in |
| 16 | -h|--help) usage;; |
Aaron Lee | 2355a4b | 2011-10-13 13:43:16 -0500 | [diff] [blame] | 17 | -*|--*) test_opts="$test_opts $1";; |
| 18 | *) tests="$tests $1" |
Justin Shepherd | 0d9bbd1 | 2011-08-11 12:57:44 -0500 | [diff] [blame] | 19 | esac |
| 20 | } |
| 21 | |
Justin Shepherd | 0d9bbd1 | 2011-08-11 12:57:44 -0500 | [diff] [blame] | 22 | for arg in "$@"; do |
| 23 | process_option $arg |
| 24 | done |
| 25 | |
Aaron Lee | 2355a4b | 2011-10-13 13:43:16 -0500 | [diff] [blame] | 26 | echo $test_opts |
| 27 | |
Justin Shepherd | 0d9bbd1 | 2011-08-11 12:57:44 -0500 | [diff] [blame] | 28 | function run_tests { |
Aaron Lee | 78dbb64 | 2011-10-18 10:27:02 -0500 | [diff] [blame] | 29 | base_dir=$(dirname $0) |
Aaron Lee | 2355a4b | 2011-10-13 13:43:16 -0500 | [diff] [blame] | 30 | for test_dir in $tests |
| 31 | do |
Aaron Lee | 78dbb64 | 2011-10-18 10:27:02 -0500 | [diff] [blame] | 32 | test_cmd="${base_dir}/${test_dir}/run_tests.sh ${test_opts}" |
Aaron Lee | 2355a4b | 2011-10-13 13:43:16 -0500 | [diff] [blame] | 33 | echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" |
| 34 | echo $test_cmd |
| 35 | echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" |
| 36 | $test_cmd |
Aaron Lee | 78dbb64 | 2011-10-18 10:27:02 -0500 | [diff] [blame] | 37 | |
Aaron Lee | 2355a4b | 2011-10-13 13:43:16 -0500 | [diff] [blame] | 38 | done |
Justin Shepherd | 0d9bbd1 | 2011-08-11 12:57:44 -0500 | [diff] [blame] | 39 | } |
| 40 | |
Justin Shepherd | 0d9bbd1 | 2011-08-11 12:57:44 -0500 | [diff] [blame] | 41 | run_tests || exit |