#!/bin/bash # --------------------------- 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/SquishCoco/bin:/opt/SquishCoco/wrapper/bin export DISPLAY=:10.0 mkdir $REPORT # --------------------------- clone denali git clone ssh://git@dvm-linux02:7999/ui/application.git # --------------------------- Build Application mkdir $BUID_DIR cd $BUID_DIR # --------------------------- configure the project # 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 .. # --------------------------- Clone the Test Suite echo "Clone Test Suites..." git clone ssh://git@dvm-linux02:7999/ui/testsuites.git # --------------------------- Run the Squish runner echo "Starting tests..." $SQUISH_DIR/bin/squishrunner addAUT $BUID_DIR/denali --testsuite testsuites --local --exitCodeOnFail 13 --reportgen html,$REPORT/UnitTest # --------------------------- Run the denali application as a test, since the Squish Qt can't run it right now. cd $BUID_DIR ./denali & sleep 5 killall denali sleep 5 cd .. # --------------------------- Importing the excecution report into the coverage database cmcsexeimport -m $PWD/$BUID_DIR/denali.csmes -t UnitTest01 $PWD/$BUID_DIR/denali.csexe # --------------------------- Generating the coverage report cmreport --csmes=$PWD/$BUID_DIR/denali.csmes --html=$REPORT/Coverage/index # --------------------------- Copy the reports mkdir $REMOTE_DIR/$REPORT_DIR cp -rd Report/* $REMOTE_DIR/$REPORT_DIR