Index: build/unittest.sh =================================================================== diff -u -r5baa9c718398de12ecefa71c51ab238b8ff2676e -r3c40c9798b5f45667bfa8115a22ae3ff584e6183 --- build/unittest.sh (.../unittest.sh) (revision 5baa9c718398de12ecefa71c51ab238b8ff2676e) +++ build/unittest.sh (.../unittest.sh) (revision 3c40c9798b5f45667bfa8115a22ae3ff584e6183) @@ -1,26 +1,34 @@ #!/bin/bash # Local example $./run.unittest.sh :0 5.12.5 /media/sf_VMSHARE - echo " ------------------------------ Definisions " -#Setting up Display number -if [[ "$1" = "" ]]; then - DISPLAY_NO=:10.0 -else - DISPLAY_NO=$1 + +DISPLAY_NO=:10.0 +QT_VER="" +SERVER_DIR="/media/XDrive" + +DENALI_SQUISH=denaliSquish +DENALI_QTTEST=denaliTest + +if [ ! -z "$RUN_FOR_LOCAL" ];then #is local + DISPLAY_NO=:0 + QT_VER="5.12.5" + SERVER_DIR="/media/sf_VMSHARE" + #Setting up Display number + if [ ! -z "$1" ]; then + DISPLAY_NO=$1 + fi + + #setup Qt dir version + if [ ! -z "$2" ]; then + QT_VER=$2 + fi + + #Setting up server folder + if [ ! -z "$1" ]; then + SERVER_DIR=$3 + fi fi -#setup Qt dir version -if [[ "$2" = "" ]]; then - QT_VER="" -else - QT_VER=$2 -fi -#Setting up server folder -if [[ "$3" = "" ]]; then - SERVER_DIR="/media/XDrive" -else - SERVER_DIR=$3 -fi SQUISH_SERVER_PORT=4322 BUID_DIR=build @@ -42,38 +50,54 @@ mkdir -p $REPORT/$LOG echo " ------------------------------ Clone Denali " -if [[ "$RUN_FOR_LOCAL" = "" ]]; then +if [ -z "$RUN_FOR_LOCAL" ]; then git clone ssh://git@dvm-linux02:7999/ui/application.git else cp -r ../../Project/application application fi +echo " ------------------------------ Clone the Test Suites" +if [ -z "$RUN_FOR_LOCAL" ]; then + git clone ssh://git@dvm-linux02:7999/ui/testsuites.git +else + cp -r ../../Project/testsuites testsuites +fi + echo " ------------------------------ Build Application " mkdir $BUID_DIR cd $BUID_DIR -echo " ------------------------------ Configure The Project for Coverage" +if [ -z "$RUN_QTTEST" ]; then +echo " ------------------------------ QtTest : Configure The Project for Coverage" # Coco Build - Instrumentation -$QT_DIR/bin/qmake ../application/denali.pro -spec linux-g++ CONFIG+=qtquickcompiler CONFIG+=CodeCoverage +$QT_DIR/bin/qmake ../application/denali.pro -spec linux-g++ CONFIG+=qtquickcompiler CONFIG+=testcase CONFIG+=CodeCoverage TARGET=$DENALI_QTTEST /usr/bin/make LINK=csg++ AR=csar CXX=csg++ CC=csgcc -j4 -cd .. - -echo " ------------------------------ Clone the Test Suites" -if [[ "$RUN_FOR_LOCAL" = "" ]]; then - git clone ssh://git@dvm-linux02:7999/ui/testsuites.git -else - cp -r ../../Project/testsuites testsuites +/usr/bin/make clean +./$DENALI_QTTEST 1>$REPORT/$LOG/qttest.log 2>$REPORT/$LOG/qttest.err fi +echo " ------------------------------ Squish : Configure The Project for Coverage" +# Coco Build - Instrumentation +$QT_DIR/bin/qmake ../application/denali.pro -spec linux-g++ CONFIG+=qtquickcompiler CONFIG+=CodeCoverage TARGET=$DENALI_SQUISH +/usr/bin/make LINK=csg++ AR=csar CXX=csg++ CC=csgcc -j4 +/usr/bin/make clean + +cd .. + echo " ------------------------------ Starting the Squish Server" -$SQUISH_DIR/bin/squishserver addAUT $(pwd)/$BUID_DIR/denali --port=$SQUISH_SERVER_PORT 1>$REPORT/$LOG/squishqtserver.log 2>$REPORT/$LOG/squishqtserver.err & +$SQUISH_DIR/bin/squishserver --config addAUT $DENALI_SQUISH $(pwd)/$BUID_DIR/ 1>$REPORT/$LOG/squishqtserver.log 2>$REPORT/$LOG/squishqtserver.err +$SQUISH_DIR/bin/squishserver 1>>$REPORT/$LOG/squishqtserver.log 2>>$REPORT/$LOG/squishqtserver.err & #--port=$SQUISH_SERVER_PORT echo " ------------------------------ Starting tests" -$SQUISH_DIR/bin/squishrunner --testsuite testsuites --exitCodeOnFail 13 --reportgen html,$REPORT/UnitTest 1>$REPORT/$LOG/squishqtrunner.log 2>$REPORT/$LOG/squishqtrunner.err +$SQUISH_DIR/bin/squishrunner --testsuite testsuites --exitCodeOnFail 13 --reportgen html,$REPORT/UnitTest 1>$REPORT/$LOG/squishqtrunner.log 2>$REPORT/$LOG/squishqtrunner.err UNITTEST_RESULT=$? +echo " ------------------------------ Merging the excecution report databases" +cmmerge -o $BUID_DIR/denali.csmes $BUID_DIR/$DENALI_SQUISH.csmes $BUID_DIR/$DENALI_QTTEST.csmes + echo " ------------------------------ Importing the excecution report into the coverage database" -cmcsexeimport -p merge -m $BUID_DIR/denali.csmes -t UnitTest01 $BUID_DIR/denali.csexe 1>$REPORT/$LOG/cmcsexeimport.log 2>$REPORT/$LOG/cmcsexeimport.err +cmcsexeimport -m $BUID_DIR/denali.csmes -t QtTest -e $BUID_DIR/$DENALI_QTTEST.csexe 1>$REPORT/$LOG/cmcsexeimport_qttest.log 2>$REPORT/$LOG/cmcsexeimport_qttest.err +cmcsexeimport -m $BUID_DIR/denali.csmes -t Squish -e $BUID_DIR/$DENALI_SQUISH.csexe 1>$REPORT/$LOG/cmcsexeimport_squish.log 2>$REPORT/$LOG/cmcsexeimport_squish.err echo " ------------------------------ Generating the coverage report" cmreport --csmes=$BUID_DIR/denali.csmes --html=$REPORT/Coverage/index 1>$REPORT/$LOG/cmreport.log 2>$REPORT/$LOG/cmreport.err @@ -84,8 +108,8 @@ sync;sync;sync; echo " ------------------------------ Stoping the Squish Server" -$SQUISH_DIR/bin/squishserver --port=$SQUISH_SERVER_PORT --stop -if [[ "$StopOnUnitTestError" = "" ]]; then +$SQUISH_DIR/bin/squishserver --stop #--port=$SQUISH_SERVER_PORT +if [ -z "$StopOnUnitTestError" ]; then exit $UNITTEST_RESULT else exit 0