Updated automated test scripts for faster cycle time 35/24335/4
authorDavid Steele <david.steele@partner.samsung.com>
Thu, 10 Jul 2014 14:39:13 +0000 (15:39 +0100)
committerAdeel Kazmi <adeel.kazmi@samsung.com>
Fri, 11 Jul 2014 11:45:52 +0000 (04:45 -0700)
Change-Id: I68b13ecdf724773f4d9a234e9902b1b34cef6136
Signed-off-by: David Steele <david.steele@partner.samsung.com>
automated-tests/.gitignore-with-autogenerated-files [new file with mode: 0644]
automated-tests/.gitignore-without-autogenerated-files [new file with mode: 0644]
automated-tests/build.sh
automated-tests/coverage.sh
automated-tests/execute.sh
automated-tests/scripts/tcbuild.sh

diff --git a/automated-tests/.gitignore-with-autogenerated-files b/automated-tests/.gitignore-with-autogenerated-files
new file mode 100644 (file)
index 0000000..f039d8a
--- /dev/null
@@ -0,0 +1,4 @@
+*.xml
+build
+build.log
+tct*core.h
diff --git a/automated-tests/.gitignore-without-autogenerated-files b/automated-tests/.gitignore-without-autogenerated-files
new file mode 100644 (file)
index 0000000..8f3f9e2
--- /dev/null
@@ -0,0 +1,3 @@
+*.xml
+build
+build.log
index 14eaf96..6c817ae 100755 (executable)
@@ -1,19 +1,42 @@
 #!/bin/bash
 
 #!/bin/bash
 
-rm -rf build
-mkdir build
+TEMP=`getopt -o rn --long rebuild,no-gen \
+     -n 'genmake' -- "$@"`
+
+if [ $? != 0 ] ; then echo "Terminating..." >&2 ; exit 1 ; fi
+
+# Note the quotes around `$TEMP': they are essential!
+eval set -- "$TEMP"
+
+opt_rebuild=false
+opt_generate=true
+
+while true ; do
+    case "$1" in
+        -r|--rebuild) opt_rebuild=true ; shift ;;
+        -n|--no-gen)  opt_generate=false ; shift ;;
+        --) shift ; break ;;
+        *) shift ;;   # Ignore
+    esac
+done
+
+if [ false == $opt_rebuild -o ! -d "build" ] ; then
+    rm -rf build
+    mkdir build
+fi
 
 function build
 {
 
 function build
 {
-  (cd src/$1; ../../scripts/tcheadgen.sh tct-$1-core.h)
-  if [ $? -ne 0 ]; then echo "Aborting..."; exit 1; fi
-  (cd build ; cmake .. -DMODULE=$1 ; make -j7 )
+    if [ $opt_generate == true -o $opt_rebuild == false ] ; then
+        (cd src/$1; ../../scripts/tcheadgen.sh tct-$1-core.h)
+        if [ $? -ne 0 ]; then echo "Aborting..."; exit 1; fi
+    fi
+    (cd build ; cmake .. -DMODULE=$1 ; make -j7 )
 }
 
 if [ -n "$1" ] ; then
   echo BUILDING ONLY $1
   build $1
 }
 
 if [ -n "$1" ] ; then
   echo BUILDING ONLY $1
   build $1
-
 else
   for mod in `ls -1 src/ | grep -v CMakeList `
   do
 else
   for mod in `ls -1 src/ | grep -v CMakeList `
   do
index 0b49287..98131bf 100755 (executable)
@@ -20,3 +20,5 @@ done
     cd .. ;
     genhtml -o build/slp/doc/coverage `find . -name dali.info`
 )
     cd .. ;
     genhtml -o build/slp/doc/coverage `find . -name dali.info`
 )
+
+echo "Coverage output: ../build/slp/doc/coverage/index.html"
index 3b5bd62..3bd6b06 100755 (executable)
@@ -10,6 +10,15 @@ function execute
 # Clean up old test results
 rm -f tct*core-tests.xml
 
 # Clean up old test results
 rm -f tct*core-tests.xml
 
+# Clean up old coverage data
+if [ -d ../build/slp ] ; then
+    rm -f ../build/slp/dali-core/.libs/*.gcda
+elif [ -d ../build/tizen ] ; then
+    rm -f ../build/tizen/dali-core/.libs/*.gcda
+fi
+
+find build -name "*.gcda" -exec rm '{}' \;
+
 if [ -n "$1" ] ; then
   echo EXECUTING ONLY $1
   execute $*
 if [ -n "$1" ] ; then
   echo EXECUTING ONLY $1
   execute $*
index 42eaef0..b604675 100755 (executable)
@@ -93,10 +93,12 @@ function build {
         (cd src/$1; ../../scripts/tcheadgen.sh tct-$1-core.h)
         if [ $? -ne 0 ]; then echo "Aborting..."; exit 1; fi
         cp packaging/core-$1-tests.spec ../packaging
         (cd src/$1; ../../scripts/tcheadgen.sh tct-$1-core.h)
         if [ $? -ne 0 ]; then echo "Aborting..."; exit 1; fi
         cp packaging/core-$1-tests.spec ../packaging
+        cp .gitignore-without-autogenerated-files .gitignore
         gbs build -A armv7l --spec core-$1-tests.spec --include-all --keep-packs | \
             tee build.log | stdbuf -o0 sed -e 's/error:/\x1b[1;91m&\x1b[0m/' \
                                            -e 's/warning:/\x1b[93m&\x1b[0m/'
         rm ../packaging/core-$1-tests.spec
         gbs build -A armv7l --spec core-$1-tests.spec --include-all --keep-packs | \
             tee build.log | stdbuf -o0 sed -e 's/error:/\x1b[1;91m&\x1b[0m/' \
                                            -e 's/warning:/\x1b[93m&\x1b[0m/'
         rm ../packaging/core-$1-tests.spec
+        cp .gitignore-with-autogenerated-files .gitignore
     else
         echo "Build requires a module name"
         exit 1
     else
         echo "Build requires a module name"
         exit 1