4 # @author MyungJoo Ham <myungjoo.ham@gmail.com>
7 # @brief This executes test groups and reports aggregated test results.
8 # @exit 0 if all PASSED. Positive if some FAILED.
10 # If there is no arguments specified, this will search for all "runTest.sh" in
11 # the subdirectory of this file and regard them as the test groups.
13 # If --help or -h is given, this will show detailed description.
16 BASEPATH=`dirname "$0"`
17 BASENAME=`basename "$0"`
19 source ${BASEPATH}/ssat-api.sh
32 printf "usage: ${BASENAME} [--help] [<path>] [--testcase <filename>]\n\n"
33 printf "These are common ${Red}ssat${NC} commands used:\n\n"
34 printf "Test all test-groups in the current ($(pwd)) directory, recursively\n"
35 printf " (no options specified)\n"
36 printf " $ ${BASENAME}\n"
38 printf "Test all test-groups in the specified directory, recursively\n"
40 printf " $ ${BASENAME} /home/username/test\n"
41 printf " If there are multiple paths, the last one will be used\n"
43 printf "Search for \"filename\" as the testcase scripts\n"
44 printf " --testcase or -t\n"
45 printf " $ ${BASENAME} --testcase cases.sh\n"
46 printf " Search for cases.sh instead of runTest.sh\n"
48 printf "Shows this message\n"
49 printf " --help or -h\n"
50 printf " $ ${BASENAME} --help \n"
59 *) # Unknown, which is probably target (the path to root-dir of test groups).
64 if [[ ${#TARGET} -eq 0 ]]
69 find $TARGET -name $TESTCASE -print0 | while read -d $'\0' file
71 CASEBASEPATH=`dirname "$file"`
78 # gather reports & publish them.