#!/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/SquishCoco/bin:/opt/SquishCoco/wrapper/bin export DISPLAY=:10.0 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" # 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 Suite" echo "Clone Test Suites..." git clone ssh://git@dvm-linux02:7999/ui/testsuites.git echo "--------------------------- Run the Squish runner" echo "Starting tests..." $SQUISH_DIR/bin/squishrunner addAUT $BUID_DIR/denali --testsuite testsuites --local --exitCodeOnFail 13 --reportgen html,$REPORT/UnitTest 1>$REPORT/runner.log 2>$REPORT/runner.err echo "--------------------------- 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 .. echo "--------------------------- Importing the excecution report into the coverage database" cmcsexeimport -m $PWD/$BUID_DIR/denali.csmes -t UnitTest01 $PWD/$BUID_DIR/denali.csexe echo "--------------------------- Generating the coverage report" cmreport --csmes=$PWD/$BUID_DIR/denali.csmes --html=$REPORT/Coverage/index echo "--------------------------- Copy the reports" mkdir $REMOTE_DIR/$REPORT_DIR cp -rd Report/* $REMOTE_DIR/$REPORT_DIR