From e234f76a7cea0364c9fa6e07bf1c62ef3a962d6f Mon Sep 17 00:00:00 2001 From: spo Date: Tue, 18 Aug 2015 14:56:47 +0300 Subject: [PATCH] Use VNC for SQUISH tests --- env_squish.sh | 3 ++ linux_run.sh | 2 +- salome_kill.sh | 1 - salome_run.sh | 8 +++-- test.squish/shared/testdata/SalomeApp.xml | 10 +++--- .../suite_ISSUES/shared/scripts/common.py | 2 +- test.squish/suite_ISSUES/tst_crash_1/test.py | 2 +- test_squish.sh | 33 +++++++++++++++++++ 8 files changed, 50 insertions(+), 11 deletions(-) create mode 100755 test_squish.sh diff --git a/env_squish.sh b/env_squish.sh index 05a0ea4ed..0d714838b 100644 --- a/env_squish.sh +++ b/env_squish.sh @@ -4,3 +4,6 @@ export SQUISH_GRABWINDOW_CLASSES=AppElements_ViewPort,OCCViewer_ViewPort3d SQUISH_DIR=/dn23/NEWGEOM/NEWGEOM_JENKINS_BUILD_AREA/tools/squish-5.1.1-qt48x-linux64 export PATH=${SQUISH_DIR}/bin:${PATH} + +export SQUISH_LICENSEKEY_DIR=/dn23/NEWGEOM/NEWGEOM_JENKINS_BUILD_AREA/tools +export HOME=$(pwd)/HOME diff --git a/linux_run.sh b/linux_run.sh index b8968cc17..1193d2808 100755 --- a/linux_run.sh +++ b/linux_run.sh @@ -3,4 +3,4 @@ source env.sh source env_standalone.sh -${INSTALL_DIR}/bin/GeomApp +${INSTALL_DIR}/bin/GeomApp "$@" diff --git a/salome_kill.sh b/salome_kill.sh index da53b608e..24bb40a77 100755 --- a/salome_kill.sh +++ b/salome_kill.sh @@ -3,5 +3,4 @@ source env.sh source env_salome.sh -#${PYTHONBIN} "${KERNEL_ROOT_DIR}/bin/salome/killSalome.py" ${KERNEL_ROOT_DIR}/bin/salome/killSalome.py diff --git a/salome_run.sh b/salome_run.sh index 003d5fcf9..cb4f8255c 100755 --- a/salome_run.sh +++ b/salome_run.sh @@ -1,6 +1,10 @@ -#!/bin/bash -x +#!/bin/bash -ex -export SALOME_PORT=2900 +if [ "$#" = 1 ]; then + export SALOME_PORT="$1" +else + export SALOME_PORT=2900 +fi source env.sh source env_salome.sh diff --git a/test.squish/shared/testdata/SalomeApp.xml b/test.squish/shared/testdata/SalomeApp.xml index 07890c8c5..da472b70e 100644 --- a/test.squish/shared/testdata/SalomeApp.xml +++ b/test.squish/shared/testdata/SalomeApp.xml @@ -88,7 +88,7 @@ Changes made in this file can be lost!
- +
@@ -110,9 +110,9 @@ Changes made in this file can be lost! - - - + + +
@@ -128,7 +128,7 @@ Changes made in this file can be lost! - +
diff --git a/test.squish/suite_ISSUES/shared/scripts/common.py b/test.squish/suite_ISSUES/shared/scripts/common.py index 7a22b9e36..a4586b248 100644 --- a/test.squish/suite_ISSUES/shared/scripts/common.py +++ b/test.squish/suite_ISSUES/shared/scripts/common.py @@ -154,7 +154,7 @@ def part_create(): clickTab(waitForObject(":General.qt_tabwidget_tabbar_QTabBar"), "Part") clickButton(waitForObject(":Operations.New part_AppElements_Button")) -def extrusion_feature(points, to_size, from_size): +def extrusion_feature(points, to_size=0, from_size=0): clickTab(waitForObject(":General.qt_tabwidget_tabbar_QTabBar"), "Features") clickButton(waitForObject(":Extrusion.Extrusion_AppElements_Button")) diff --git a/test.squish/suite_ISSUES/tst_crash_1/test.py b/test.squish/suite_ISSUES/tst_crash_1/test.py index 3087f9d1b..3754249af 100644 --- a/test.squish/suite_ISSUES/tst_crash_1/test.py +++ b/test.squish/suite_ISSUES/tst_crash_1/test.py @@ -1,7 +1,7 @@ def main(): source(findFile("scripts", "common.py")) - startApplication("GeomApp") + startApplication("linux_run.sh") set_defaults() part_create() diff --git a/test_squish.sh b/test_squish.sh new file mode 100755 index 000000000..7f0ac4f68 --- /dev/null +++ b/test_squish.sh @@ -0,0 +1,33 @@ +#!/bin/bash -x + +set -e + +if [ "$#" = 1 ]; then + SQUISHSERVER_PORT=$1 +else + SQUISHSERVER_PORT=4320 +fi + +source env_squish.sh + +for aut in linux_run.sh salome_run.sh; do + squishserver --config addAUT ${aut} $(pwd) +done +squishserver --verbose --port=${SQUISHSERVER_PORT} --daemon + +RETVAL=0 +for suite in ./test.squish/suite_* +do + set +e + squishrunner --port=${SQUISHSERVER_PORT} --testsuite ${suite} --reportgen stdout --exitCodeOnFail 1 + EXIT_CODE=$? + set -e + if [ ${EXIT_CODE} = '1' ]; then RETVAL=1; fi +done + +squishserver --verbose --port=${SQUISHSERVER_PORT} --stop +for aut in linux_run.sh salome_run.sh; do + squishserver --config removeAUT ${aut} $(pwd) +done + +exit ${RETVAL} -- 2.30.2