Index: build/unittest.sh =================================================================== diff -u --- build/unittest.sh (revision 0) +++ build/unittest.sh (revision 80a98344e74215c6131d1f9f3d57694a60ed6062) @@ -0,0 +1,69 @@ +#!/bin/sh + +# --------------------------- Definisions +buildDirectory=${bamboo.build.working.directory} +buildNumber=${bamboo.buildNumber} +timeStamp=${bamboo.buildTimeStamp} +buildPlan=${bamboo.shortPlanName} + +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" + +export PATH=$PATH:/opt/SquishCoco/bin:/opt/SquishCoco/wrapper/bin +export DISPLAY=:10.0 + +# --------------------------- 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 + +# --------------------------- Start Squish server +echo "Starting squishserver on port=$SQUISH_SERVER_PORT..." +$SQUISH_DIR/bin/squishserver --port $SQUISH_SERVER_PORT 1>Report/server.log 2>Report/server.err & +sleep 5 + +# --------------------------- Register the AUT +echo "Register AUT..." +$SQUISH_DIR/bin/squishserver --port $SQUISH_SERVER_PORT --config addAUT $PWD/$BUID_DIR/denali + +# --------------------------- Run the Squish runner +echo "Starting tests..." +$SQUISH_DIR/bin/squishrunner --port $SQUISH_SERVER_PORT --testsuite testsuites --exitCodeOnFail 13 --reportgen html,Report/UnitTest + +# --------------------------- Stop Squish server +echo "Stopping squishserver..." +$SQUISH_DIR/bin/squishserver --port $SQUISH_SERVER_PORT --stop +sleep 5 + +# --------------------------- 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