From: David Steele Date: Thu, 10 Jul 2014 14:39:13 +0000 (+0100) Subject: Updated automated test scripts for faster cycle time X-Git-Tag: dali_1.0.1~10 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=commitdiff_plain;h=441d0d644e9047c09a1bc8f275c2eb8d28bee4e4 Updated automated test scripts for faster cycle time Change-Id: I68b13ecdf724773f4d9a234e9902b1b34cef6136 Signed-off-by: David Steele --- diff --git a/automated-tests/.gitignore-with-autogenerated-files b/automated-tests/.gitignore-with-autogenerated-files new file mode 100644 index 0000000..f039d8a --- /dev/null +++ b/automated-tests/.gitignore-with-autogenerated-files @@ -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 index 0000000..8f3f9e2 --- /dev/null +++ b/automated-tests/.gitignore-without-autogenerated-files @@ -0,0 +1,3 @@ +*.xml +build +build.log diff --git a/automated-tests/build.sh b/automated-tests/build.sh index 14eaf96..6c817ae 100755 --- a/automated-tests/build.sh +++ b/automated-tests/build.sh @@ -1,19 +1,42 @@ #!/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 { - (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 - else for mod in `ls -1 src/ | grep -v CMakeList ` do diff --git a/automated-tests/coverage.sh b/automated-tests/coverage.sh index 0b49287..98131bf 100755 --- a/automated-tests/coverage.sh +++ b/automated-tests/coverage.sh @@ -20,3 +20,5 @@ done cd .. ; genhtml -o build/slp/doc/coverage `find . -name dali.info` ) + +echo "Coverage output: ../build/slp/doc/coverage/index.html" diff --git a/automated-tests/execute.sh b/automated-tests/execute.sh index 3b5bd62..3bd6b06 100755 --- a/automated-tests/execute.sh +++ b/automated-tests/execute.sh @@ -10,6 +10,15 @@ function execute # 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 $* diff --git a/automated-tests/scripts/tcbuild.sh b/automated-tests/scripts/tcbuild.sh index 42eaef0..b604675 100755 --- a/automated-tests/scripts/tcbuild.sh +++ b/automated-tests/scripts/tcbuild.sh @@ -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 + 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 + cp .gitignore-with-autogenerated-files .gitignore else echo "Build requires a module name" exit 1