blob: 5ff837e0e2fcb5ff1aa8ae204a9ba806adc71565 [file] [log] [blame]
Justin Shepherd0d9bbd12011-08-11 12:57:44 -05001#!/bin/bash
2
3function usage {
Aaron Lee2355a4b2011-10-13 13:43:16 -05004 echo "Usage: [OPTIONS] [SUITES]"
5 echo "Run all of the test suites"
Justin Shepherd0d9bbd12011-08-11 12:57:44 -05006 echo ""
Justin Shepherd0d9bbd12011-08-11 12:57:44 -05007 echo " -h, --help Print this usage message"
8 echo ""
Aaron Lee2355a4b2011-10-13 13:43:16 -05009 echo " The suites should be listed by the name of their directory."
10 echo " All other options are passed directly to the suites."
Justin Shepherd0d9bbd12011-08-11 12:57:44 -050011 exit
12}
13
14function process_option {
15 case "$1" in
16 -h|--help) usage;;
Aaron Lee2355a4b2011-10-13 13:43:16 -050017 -*|--*) test_opts="$test_opts $1";;
18 *) tests="$tests $1"
Justin Shepherd0d9bbd12011-08-11 12:57:44 -050019 esac
20}
21
Justin Shepherd0d9bbd12011-08-11 12:57:44 -050022for arg in "$@"; do
23 process_option $arg
24done
25
Aaron Lee2355a4b2011-10-13 13:43:16 -050026echo $test_opts
27
Justin Shepherd0d9bbd12011-08-11 12:57:44 -050028function run_tests {
Aaron Lee2355a4b2011-10-13 13:43:16 -050029 for test_dir in $tests
30 do
31 cd $test_dir
32 test_cmd="./run_tests.sh ${test_opts}"
33 echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
34 echo $test_cmd
35 echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
36 $test_cmd
37 cd ..
38 done
Justin Shepherd0d9bbd12011-08-11 12:57:44 -050039}
40
Justin Shepherd0d9bbd12011-08-11 12:57:44 -050041run_tests || exit