#!/bin/bash echo " ------------------------------ Definisions " 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" REPORT_DIR="$timeStamp-BuildNo-$buildNumber-$buildPlan" REPORT=Report 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 echo " ------------------------------ Create the Report output/log folder" mkdir $REPORT echo " ------------------------------ Clone Denali " git clone ssh://git@dvm-linux02:7999/ui/application.git echo " ------------------------------ Build Application " mkdir $BUID_DIR cd $BUID_DIR 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 /usr/bin/make LINK=csg++ AR=csar CXX=csg++ CC=csgcc -j4 cd .. echo " ------------------------------ Clone the Test Suites" git clone ssh://git@dvm-linux02:7999/ui/testsuites.git echo " ------------------------------ Starting the Squish Server" $SQUISH_DIR/bin/squishserver addAUT $BUID_DIR/denali --port=$SQUISH_SERVER_PORT 1>$REPORT/server.log 2>$REPORT/server.err & echo " ------------------------------ Starting tests" $SQUISH_DIR/bin/squishrunner addAUT $BUID_DIR/denali --testsuite testsuites --exitCodeOnFail 13 --reportgen html,$REPORT/UnitTest sleep 5 echo " ------------------------------ Importing the excecution report into the coverage database" cmcsexeimport -m $BUID_DIR/denali.csmes -t UnitTest01 $BUID_DIR/denali.csexe 1>$REPORT/cmcsexeimport.log 2>$REPORT/cmcsexeimport.err echo " ------------------------------ Generating the coverage report" cmreport --csmes=$BUID_DIR/denali.csmes --html=$REPORT/Coverage/index 1>$REPORT/cmreport.log 2>$REPORT/cmreport.err echo " ------------------------------ Copy the reports to server" mkdir $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