3 TEMP=`getopt -o dhsSm --long debug,help,serial,tct,modules -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 [-d][-s|-S|-r] [module|testcase]"
13 echo -e " execute.sh\t\tExecute test cases from all modules in parallel"
14 echo -e " execute.sh -d <testcase>\tDebug testcase"
15 echo -e " execute.sh [module]\tExecute test cases from the given module in parallel"
16 echo -e " execute.sh -s [module]\t\tExecute test cases in serial using Testkit-Lite"
17 echo -e " execute.sh -S [module]\t\tExecute test cases in serial"
18 echo -e " execute.sh <testcase>\tFind and execute the given test case"
29 -d|--debug) opt_debug=1 ; shift ;;
30 -s|--tct) opt_tct=1 ; shift ;;
31 -S|--serial) opt_serial="-s" ; shift ;;
32 -m|--modules) opt_modules=1 ; shift ;;
34 *) echo "Internal error $1!" ; exit 1 ;;
40 scripts/tctestsgen.sh $1 `pwd` desktop $2
41 testkit-lite -f `pwd`/tests.xml -o tct-${1}-core-tests.xml -A --comm localhost
42 scripts/add_style.pl $1
45 function summary_start
47 start=`date +"%Y-%m-%d_%H_%M_%S"`
48 cat > summary.xml <<EOF
49 <?xml version="1.0" encoding="UTF-8"?>
50 <?xml-stylesheet type="text/xsl" href="./style/summary.xsl"?>
51 <result_summary plan_name="Core">
52 <other xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:string" />
53 <summary test_plan_name="Dali">
54 <start_at>$start</start_at>
55 <end_at>$start</end_at>
62 cat >> summary.xml <<EOF
67 if [ $opt_modules == 1 ] ; then
73 # Clean up old test results
74 rm -f tct*core-tests.xml
76 # Clean up old coverage data
77 if [ -d ../build/tizen ] ; then
78 rm -f ../build/tizen/dali-toolkit/.libs/*.gcda
81 find build \( -name "*.gcda" \) -exec rm '{}' \;
86 modules=`ls -1 src/ | grep -v CMakeList | grep -v common | grep -v manual`
87 if [ -f summary.xml ] ; then unlink summary.xml ; fi
89 if [ $opt_tct == 1 ] ; then
91 # Run all test case executables serially, create XML output
97 if [ $mod != 'common' ] && [ $mod != 'manual' ]; then
99 echo -ne "$ASCII_BOLD"
100 echo -e "Executing $mod$ASCII_RESET"
109 # Execute test cases using own test harness
111 if [ -z "$1" ] ; then
113 # Execute each test executable in turn (by default, runs tests in parallel)
117 echo -e "$ASCII_BOLD"
118 echo -e "Executing $mod$ASCII_RESET"
119 build/src/$mod/tct-$mod-core -r $opt_serial
123 elif [ -f "build/src/$1/tct-$1-core" ] ; then
124 # First argument is an executable filename - execute only that with any
125 # remaining arguments
129 build/src/$module/tct-$module-core -r $opt_serial $*
133 # First argument is not an executable. Is it a test case name?
134 # Try executing each executable with the test case name until success/known failure
137 output=`build/src/$mod/tct-$mod-core $1`
139 if [ $ret -ne 6 ] ; then
140 if [ $opt_debug -ne 0 ] ; then
141 gdb --args build/src/$mod/tct-$mod-core $1
144 if [ $ret -eq 0 ] ; then echo -e "\nPassed" ; fi
153 if [ -f summary.xml ] ; then
154 scripts/output_summary.pl