3 TEMP=`getopt -o hsSm --long 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 [-s|-S|-r] [module|testcase]"
13 echo -e " execute.sh\t\tExecute test cases from all modules in parallel"
14 echo -e " execute.sh [module]\tExecute test cases from the given module in parallel"
15 echo -e " execute.sh -s [module]\t\tExecute test cases in serial using Testkit-Lite"
16 echo -e " execute.sh -S [module]\t\tExecute test cases in serial"
17 echo -e " execute.sh <testcase>\tFind and execute the given test case"
27 -s|--tct) opt_tct=1 ; shift ;;
28 -S|--serial) opt_serial="-s" ; shift ;;
29 -m|--modules) opt_modules=1 ; shift ;;
31 *) echo "Internal error $1!" ; exit 1 ;;
37 scripts/tctestsgen.sh $1 `pwd` desktop $2
38 testkit-lite -f `pwd`/tests.xml -o tct-${1}-core-tests.xml -A --comm localhost
39 scripts/add_style.pl $1
42 function summary_start
44 start=`date +"%Y-%m-%d_%H_%M_%S"`
45 cat > summary.xml <<EOF
46 <?xml version="1.0" encoding="UTF-8"?>
47 <?xml-stylesheet type="text/xsl" href="./style/summary.xsl"?>
48 <result_summary plan_name="Core">
49 <other xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:string" />
50 <summary test_plan_name="Dali">
51 <start_at>$start</start_at>
52 <end_at>$start</end_at>
59 cat >> summary.xml <<EOF
64 if [ $opt_modules == 1 ] ; then
70 # Clean up old test results
71 rm -f tct*core-tests.xml
73 # Clean up old coverage data
74 if [ -d ../build/tizen ] ; then
75 rm -f ../build/tizen/dali-core/.libs/*.gcda
78 find build \( -name "*.gcda" \) -exec rm '{}' \;
83 modules=`ls -1 src/ | grep -v CMakeList | grep -v common | grep -v manual`
84 if [ -f summary.xml ] ; then unlink summary.xml ; fi
86 if [ $opt_tct == 1 ] ; then
88 # Run all test case executables serially, create XML output
94 if [ $mod != 'common' ] && [ $mod != 'manual' ]; then
96 echo -ne "$ASCII_BOLD"
97 echo -e "Executing $mod$ASCII_RESET"
106 # Execute test cases using own test harness
108 if [ -z "$1" ] ; then
110 # Execute each test executable in turn (by default, runs tests in parallel)
114 echo -e "$ASCII_BOLD"
115 echo -e "Executing $mod$ASCII_RESET"
116 build/src/$mod/tct-$mod-core -r $opt_serial
120 elif [ -f "build/src/$1/tct-$1-core" ] ; then
121 # First argument is an executable filename - execute only that with any
122 # remaining arguments
126 build/src/$module/tct-$module-core -r $opt_serial $*
130 # First argument is not an executable. Is it a test case name?
131 # Try executing each executable with the test case name until success/known failure
134 output=`build/src/$mod/tct-$mod-core $1`
136 if [ $ret -ne 6 ] ; then
138 if [ $ret -eq 0 ] ; then echo -e "\nPassed" ; fi
146 if [ -f summary.xml ] ; then
147 scripts/output_summary.pl