[dali_1.0.20] Merge branch 'tizen'
[platform/core/uifw/dali-toolkit.git] / automated-tests / execute.sh
1 #!/bin/bash
2
3 TEMP=`getopt -o sr --long serial,rerun -n 'execute.sh' -- "$@"`
4
5 if [ $? != 0 ] ; then echo "Terminating..." >&2 ; exit 1 ; fi
6
7 # Note the quotes around `$TEMP': they are essential!
8 eval set -- "$TEMP"
9
10 opt_parallel=1
11 opt_rerun=""
12 while true ; do
13     case "$1" in
14         -s|--serial)   opt_parallel=0 ; shift ;;
15         -r|--rerun)    opt_rerun="-r" ; shift ;;
16         --) shift; break;;
17         *) echo "Internal error $1!" ; exit 1 ;;
18     esac
19 done
20
21 function execute
22 {
23     scripts/tctestsgen.sh $1 `pwd` desktop $2
24     testkit-lite -f `pwd`/tests.xml -o tct-${1}-core-tests.xml  -A --comm localhost
25     scripts/add_style.pl $1
26 }
27
28 # Clean up old test results
29 rm -f tct*core-tests.xml
30
31 # Clean up old coverage data
32 if [ -d ../build/tizen ] ; then
33     rm -f ../build/tizen/dali-core/.libs/*.gcda
34 fi
35
36 find build \( -name "*.gcda" \) -exec rm '{}' \;
37
38 if [ $opt_parallel = 1 ] ; then
39
40     if [ -n "$1" ] ; then
41         if [ -f "build/src/$1/tct-$1-core" ] ; then
42             build/src/$1/tct-$1-core -p $opt_rerun
43         fi
44     else
45         for mod in `ls -1 src/ | grep -v CMakeList `
46         do
47             if [ $mod != 'common' ] && [ $mod != 'manual' ]; then
48                 echo EXECUTING $mod
49                 build/src/$mod/tct-$mod-core -p $opt_rerun
50             fi
51         done
52     fi
53
54 else
55     if [ -n "$1" ] ; then
56         execute $1 $*
57     else
58         for mod in `ls -1 src/ | grep -v CMakeList `
59         do
60             if [ $mod != 'common' ] && [ $mod != 'manual' ]; then
61                 echo EXECUTING $mod
62                 execute $mod $*
63             fi
64         done
65     fi
66
67     scripts/summarize.pl
68 fi