Index: build/unittest.sh =================================================================== diff -u -r984d1de0de9ddfad694d17127b9e4b9fe7e42ad7 -rda002bda7f668f9bca3e959d7cdd4f8498a1a1e9 --- build/unittest.sh (.../unittest.sh) (revision 984d1de0de9ddfad694d17127b9e4b9fe7e42ad7) +++ build/unittest.sh (.../unittest.sh) (revision da002bda7f668f9bca3e959d7cdd4f8498a1a1e9) @@ -41,19 +41,14 @@ # --- setup local or server Environment - DISPLAY_NO=:10.0 + export DISPLAY_NO=97 QT_VER="" DENALI_SQUISH=denaliSquish if [ ! -z "$RUN_FOR_LOCAL" ];then #is local - DISPLAY_NO=:0 QT_VER="5.12.5" SERVER_DIR="/media/sf_VMSHARE" - #Setting up Display number - if [ ! -z "$1" ]; then - DISPLAY_NO=$1 - fi #setup Qt dir version if [ ! -z "$2" ]; then @@ -77,13 +72,15 @@ PROJECT_CHECKOUT_INDEX=8 COMMON_CHECKOUT_INDEX=9 - setBuildVariables ${buildSpecs[@]} - REPORT_DIR=$(getRemoteCopyAddress "DEN_UI" ${buildSpecs[$PROJECT_CHECKOUT_INDEX]}) - STATUS_REPORT=$(createStatusReport "application" $REPORT_DIR) - # Call this function to check if the repository has to be tagged or not - tagUIRepository - getCommitHashes $STATUS_REPORT ${buildSpecs[$PROJECT_NAME_INDEX]} ${buildSpecs[$PROJECT_CHECKOUT_INDEX]} \ - ${buildSpecs[$COMMON_CHECKOUT_INDEX]} + if [ ! -z "$RUN_FOR_LOCAL" ];then #is local + setBuildVariables ${buildSpecs[@]} + REPORT_DIR=$(getRemoteCopyAddress "DEN_UI" ${buildSpecs[$PROJECT_CHECKOUT_INDEX]}) + STATUS_REPORT=$(createStatusReport "application" $REPORT_DIR) + # Call this function to check if the repository has to be tagged or not + tagUIRepository + getCommitHashes $STATUS_REPORT ${buildSpecs[$PROJECT_NAME_INDEX]} ${buildSpecs[$PROJECT_CHECKOUT_INDEX]} \ + ${buildSpecs[$COMMON_CHECKOUT_INDEX]} + fi BUID_DIR=build BUILD_PATH=$WORKING_DIR/$BUID_DIR @@ -181,22 +178,59 @@ UNITTEST_RESULT=$((UNITTEST_RESULT+$?)) } +function start_xvfb() { + # Starts a virtual display + if [ $# -eq 0 ] + then + echo "Usage: $0 new_display_number" + return 1 + fi + echo "start_xvfb: Display: $1" + + xvfb-run --server-num=$1 --server-args="-ac -screen 0 1280x1024x24" dbus-run-session xfwm4 & + PID=$! + echo "PID: $PID" + + XFWM4PID=`pstree -T -p $PID | grep xfwm4 | sed 's/^.*xfwm4.*(\([0-9]\+\))/\1/'` + echo $XFWM4PID > $HOME/.xvfb_xfwm4_$1.pid + echo "XFWM4PID: $XFWM4PID" + return 0 +} + +function stop_xvfb() { + # Stops the specified virtual display + echo "stop_xvfb: Display: $1" + + if [ $# -eq 0 ] + then + echo "Usage: $0 new_display_number" + return 1 + fi + + kill `cat $HOME/.xvfb_xfwm4_$1.pid` + rm $HOME/.xvfb_xfwm4_$1.pid + return 0 +} + function start_SquishServer() { echo " ------------------------------ Starting the Squish Server" + start_xvfb $DISPLAY + $SQUISH_DIR/bin/squishserver \ --config addAUT $DENALI_SQUISH \ $WORKING_DIR/$BUID_DIR/ \ 2> $LOG_PATH/squishqtserver.err \ | tee $LOG_PATH/squishqtserver.log - $SQUISH_DIR/bin/squishserver \ + DISPLAY=:$DISPLAY $SQUISH_DIR/bin/squishserver \ 1>> $LOG_PATH/squishqtserver.log \ 2>> $LOG_PATH/squishqtserver.err & # has to be & } function stop_SquishServer() { echo " ------------------------------ Stoping the Squish Server" $SQUISH_DIR/bin/squishserver --stop + stop_xvfb $DISPLAY } function start_SquishRunner() { @@ -385,6 +419,7 @@ setup_Script_Environment setup_System_Environment # has to be after setup_Script_Environment ran + clone_Repositories make_Directories