3 TEMP=`getopt -o hsr --long help,serial,rerun -n 'execute.sh' -- "$@"`
5 if [ $? != 0 ] ; then echo "Terminating..." >&2 ; exit 1 ; fi
7 # Note the quotes around `$TEMP': they are essential!
12 echo -e "Usage: execute.sh\t\tExecute test cases from all modules in parallel"
13 echo -e " execute.sh <testmodule>\tExecute test cases from the given module in parallel"
14 echo -e " execute.sh -s\t\tExecute test cases in serial using Testkit-Lite"
15 echo -e " execute.sh -r\t\tExecute test cases in parallel, re-running failed test cases in serial afterwards"
16 echo -e " execute.sh <testcase>\tFind and execute the given test case"
25 -s|--serial) opt_serial=1 ; shift ;;
26 -r|--rerun) opt_rerun="-r" ; shift ;;
28 *) echo "Internal error $1!" ; exit 1 ;;
34 scripts/tctestsgen.sh $1 `pwd` desktop $2
35 testkit-lite -f `pwd`/tests.xml -o tct-${1}-core-tests.xml -A --comm localhost
36 scripts/add_style.pl $1
41 # Clean up old test results
42 rm -f tct*core-tests.xml
44 # Clean up old coverage data
45 if [ -d ../build/tizen ] ; then
46 rm -f ../build/tizen/dali-core/.libs/*.gcda
49 find build \( -name "*.gcda" \) -exec rm '{}' \;
54 if [ $opt_serial = 1 ] ; then
55 # Run all test case executables serially, create XML output
59 for mod in `ls -1 src/ | grep -v CMakeList `
61 if [ $mod != 'common' ] && [ $mod != 'manual' ]; then
63 echo -ne "$ASCII_BOLD"
64 echo -e "Executing $mod$ASCII_RESET"
72 # if $1 is an executable filename, execute it·
76 # Execute each test executable in turn, using parallel execution
77 for mod in `ls -1 src/ | grep -v CMakeList | grep -v common | grep -v manual`
80 echo -e "Executing $mod$ASCII_RESET"
81 build/src/$mod/tct-$mod-core $opt_rerun
84 elif [ -f "build/src/$1/tct-$1-core" ] ; then
85 # First argument is an executable filename - execute only that with any
89 build/src/$module/tct-$module-core $opt_rerun $*
92 # First argument is not an executable. Is it a test case name?
93 # Try executing each executable with the test case name until success/known failure
94 for mod in `ls -1 src/ | grep -v CMakeList | grep -v common | grep -v manual`
96 output=`build/src/$mod/tct-$mod-core $1`
98 if [ $ret -ne 6 ] ; then
100 if [ $ret -eq 0 ] ; then echo -e "\nPassed" ; fi