Index: build/unittest.sh =================================================================== diff -u -re14be295cb3a37e35e39c7bb4f043841d3321fb4 -r8f5e61e699354797f948e8778701d5df8609aac4 --- build/unittest.sh (.../unittest.sh) (revision e14be295cb3a37e35e39c7bb4f043841d3321fb4) +++ build/unittest.sh (.../unittest.sh) (revision 8f5e61e699354797f948e8778701d5df8609aac4) @@ -1,22 +1,44 @@ #!/bin/bash echo " ------------------------------ Definisions " +# $./run.unittest.sh :0 5.12.5 /media/sf_VMSHARE +#Setting up Display number +if [[ "$1" = "" ]]; then + DISPLAY_NO=:10.0 +else + DISPLAY_NO=$1 +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 -QT_DIR="/opt/Qt/5.12.5/gcc_64/bin" -SQUISH_DIR="/opt/SquishforQt/squish-for-qt-6.5.1" -REMOTE_DIR="/media/XDrive/Users/Bamboo-Projects" +QT_DIR="/opt/Qt$QT_VER/5.12.5/gcc_64" +SQUISH_DIR="/opt/squish-for-qt-6.5.1" +COCO_DIR="/opt/SquishCoco" +REMOTE_DIR="$SERVER_DIR/Users/Bamboo-Projects" REPORT_DIR="$timeStamp-BuildNo-$buildNumber-$buildPlan" REPORT=Report -LOG=log +LOG=Logs -export PATH=$PATH:/opt/Qt5.12.5/5.12.5/gcc_64/bin/:/opt/Qt/5.12.5/gcc_64/lib -export PATH=$PATH:/opt/SquishCoco/bin/:/opt/SquishCoco/wrapper/bin/ -export LD_LIBRARY_PATH=/opt/Qt/5.12.5/gcc_64/lib -export DISPLAY=:10.0 +export PATH=$PATH:$QT_DIR/bin/:$QT_DIR/lib +export PATH=$PATH:$COCO_DIR/bin/:$COCO_DIR/wrapper/bin/ +export LD_LIBRARY_PATH=$QT_DIR/lib +export DISPLAY=$DISPLAY_NO +export SQUISH_GUI_COVERAGE=1 echo " ------------------------------ Create the Report output/log folder" -mkdir -p $REPORT/ +mkdir -p $REPORT/$LOG echo " ------------------------------ Clone Denali " git clone ssh://git@dvm-linux02:7999/ui/application.git @@ -27,7 +49,7 @@ echo " ------------------------------ Configure The Project for Coverage" # Coco Build - Instrumentation -/opt/Qt/5.12.5/gcc_64/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+=CodeCoverage /usr/bin/make LINK=csg++ AR=csar CXX=csg++ CC=csgcc -j4 cd .. @@ -38,7 +60,7 @@ $SQUISH_DIR/bin/squishserver addAUT $BUID_DIR/denali --port=$SQUISH_SERVER_PORT 1>$REPORT/$LOG/server.log 2>$REPORT/$LOG/server.err & echo " ------------------------------ Starting tests" -$SQUISH_DIR/bin/squishrunner addAUT $BUID_DIR/denali --testsuite testsuites --exitCodeOnFail 13 --reportgen html,$REPORT/UnitTest +$SQUISH_DIR/bin/squishrunner --testsuite testsuites --exitCodeOnFail 13 --reportgen html,$REPORT/UnitTest sleep 5 echo " ------------------------------ Importing the excecution report into the coverage database" @@ -48,9 +70,10 @@ cmreport --csmes=$BUID_DIR/denali.csmes --html=$REPORT/Coverage/index 1>$REPORT/$LOG/cmreport.log 2>$REPORT/$LOG/cmreport.err echo " ------------------------------ Copy the reports to server" -mkdir $REMOTE_DIR/$REPORT_DIR +mkdir -p $REMOTE_DIR/$REPORT_DIR cp -rd Report/* $REMOTE_DIR/$REPORT_DIR sync;sync;sync; echo " ------------------------------ Stoping the Squish Server" $SQUISH_DIR/bin/squishserver --port=$SQUISH_SERVER_PORT --stop +