diff --git a/.gitlab/build.sh b/.gitlab/build.sh index fbb075db8e2b13832d0de8a07fbdb51a84560f23..956c9fdbd971442a512cad110496359d472ff9e7 100755 --- a/.gitlab/build.sh +++ b/.gitlab/build.sh @@ -9,7 +9,7 @@ if ! grep -q TRIGGER_STAGE_BUILD "${PROJECT_LOG_DIR}/trigger-stage.txt"; then exit 1; fi -echo "Build" +echo "===== build =====" if [ "$OS" == "win7" ]; then # there is no xvfb on windows diff --git a/.gitlab/configure.sh b/.gitlab/configure.sh index d74501a5cfa49b12a49520cae50e82193e7076fe..b5bb7fcdc703a871ba6cf2c24bc7f62085ed3c5c 100755 --- a/.gitlab/configure.sh +++ b/.gitlab/configure.sh @@ -9,7 +9,7 @@ if ! grep -q TRIGGER_STAGE_CONFIGURE "${PROJECT_LOG_DIR}/trigger-stage.txt"; the exit 1; fi -echo "Configure step" +echo "===== configure =====" # Clean build directory # note: cannot build outside the source tree otherwise artifacts cannot be collected diff --git a/.gitlab/coverage.sh b/.gitlab/coverage.sh index e1670360a7c13867d83b76dfa7249d44f02e282e..e5fb7afc59cd1199bb5cd7d15a274505aeaa95db 100755 --- a/.gitlab/coverage.sh +++ b/.gitlab/coverage.sh @@ -7,7 +7,7 @@ if ! grep -q TRIGGER_STAGE_COVERAGE "${PROJECT_LOG_DIR}/trigger-stage.txt"; then exit 1; fi -echo "Coverage" +echo "===== coverage =====" # coverage for some reason seems to always exit with non-zero code. Force exit 0 xvfb-run --auto-servernum --server-args="-screen 0 1024x768x24" \ diff --git a/.gitlab/test.sh b/.gitlab/test.sh index 2e4d9733e3b7548bbe5cb68feddb556995509386..0bfb737a0fdb6704db0a8bd3de27de649aa63fec 100755 --- a/.gitlab/test.sh +++ b/.gitlab/test.sh @@ -9,36 +9,38 @@ if ! grep -q TRIGGER_STAGE_TEST "${PROJECT_LOG_DIR}/trigger-stage.txt"; then exit 1; fi -echo "Test" - - -if [ "$OS" == "win7" ]; then - # there is no xvfb on windows - ctest -VV \ - -DCTEST_SITE="$CDASH_SITE" \ - -DCI_MODE="$CAMITK_CI_MODE" \ - -DCI_ID="P $CI_PIPELINE_ID - J $CI_BUILD_ID" \ - -DCI_BRANCH="$CI_COMMIT_REF_NAME" \ - -DCI_BUILD_SETTINGS="$COMPILER_CONFIG" \ - -DCI_PROJECT_LOG_DIRECTORY="$CI_PROJECT_DIR/$PROJECT_LOG_DIR" \ - -DCTEST_SOURCE_DIRECTORY="$PROJECT_SOURCE_DIR" \ - -DCTEST_BINARY_DIRECTORY="$PROJECT_BUILD_DIR" \ - -S $PROJECT_SOURCE_DIR/sdk/cmake/ctest/ci-test.cmake > >(tee ${PROJECT_LOG_DIR}/test.log | grep --line-buffered -e "Test \#") 2>&1 -else - # on Linux, xvfb is required to run the tests - xvfb-run --auto-servernum --server-args="-screen 0 1024x768x24" \ - ctest -VV \ - -DCTEST_SITE="$CDASH_SITE" \ - -DCI_MODE="$CAMITK_CI_MODE" \ - -DCI_ID="P $CI_PIPELINE_ID - J $CI_BUILD_ID" \ - -DCI_BRANCH="$CI_COMMIT_REF_NAME" \ - -DCI_BUILD_SETTINGS="$COMPILER_CONFIG" \ - -DCI_PROJECT_LOG_DIRECTORY="$CI_PROJECT_DIR/$PROJECT_LOG_DIR" \ - -DCTEST_SOURCE_DIRECTORY="$PROJECT_SOURCE_DIR" \ - -DCTEST_BINARY_DIRECTORY="$PROJECT_BUILD_DIR" \ - -S $PROJECT_SOURCE_DIR/sdk/cmake/ctest/ci-test.cmake > >(tee ${PROJECT_LOG_DIR}/test.log | grep --line-buffered -e "Test \#") 2>&1 +echo "===== test =====" + + +if [[ "$osName" != "win7" ]]; then + echo "===== Configuring xvfb =====" + # Starts the server first (try to avoid unexpected and random "QXcbConnection: Could not connect to display :99") + # see also https://doc.qt.io/qt-5/embedded-linux.html#linuxfb + export DISPLAY=":98" + #-ac +extension GLX +render -noreset -v -fbdir $workingDir/ &> ${PROJECT_LOG_DIR}/test.log & + Xvfb $DISPLAY -screen 0 1600x1200x24 &> ${PROJECT_LOG_DIR}/test.log & + trap "kill $! || true" EXIT + sleep 10 + export XAUTHORITY=/dev/null fi +ctest -VV \ + -DCTEST_SITE="$CDASH_SITE" \ + -DCI_MODE="$CAMITK_CI_MODE" \ + -DCI_ID="P $CI_PIPELINE_ID - J $CI_BUILD_ID" \ + -DCI_BRANCH="$CI_COMMIT_REF_NAME" \ + -DCI_BUILD_SETTINGS="$COMPILER_CONFIG" \ + -DCI_PROJECT_LOG_DIRECTORY="$CI_PROJECT_DIR/$PROJECT_LOG_DIR" \ + -DCTEST_SOURCE_DIRECTORY="$PROJECT_SOURCE_DIR" \ + -DCTEST_BINARY_DIRECTORY="$PROJECT_BUILD_DIR" \ + -S $PROJECT_SOURCE_DIR/sdk/cmake/ctest/ci-test.cmake > >(tee ${PROJECT_LOG_DIR}/test.log | grep --line-buffered -e "Test \#") 2>&1 + + +# if [[ "$OS" != "win7" ]]; then +# # shutdown xvfb +# kill $xvfbPid +# fi + # as ctest return a strange 255 error, check the log if grep --quiet "Fatal error" $CI_PROJECT_DIR/$PROJECT_LOG_DIR/ci-test.log; then echo "Found fatal error in $CI_PROJECT_DIR/$PROJECT_LOG_DIR/ci-test.log" diff --git a/sdk/applications/config/testing/config-test.sh b/sdk/applications/config/testing/config-test.sh index 436d66a29756e0bafd179800c59a3f0df0d7fe8b..3ea4804d0029e4e7c710395bf1d064b9e83eb9cc 100644 --- a/sdk/applications/config/testing/config-test.sh +++ b/sdk/applications/config/testing/config-test.sh @@ -24,10 +24,10 @@ set -e cleanup() { # backup the current exit status currentExitValue=$? - if [[ "$osName" != "Windows" ]]; then - # kill the xfvb - kill $xvfbPid - fi + if [[ "$osName" != "Windows" ]]; then + # kill the xfvb + kill $xvfbPid + fi # cleanup current dir (but not build dir!) if [ "$inBuild" == "0" ] ; then rm -rf $workingDir @@ -89,12 +89,12 @@ fi echo "===== Checking $camitkConfig =====" # check if current build is on windows debug version if ! hash -lt ${camitkConfig} 2>/dev/null; then - echo "===== Not found: $camitkConfig on $osName =====" - if [[ "$osName" == "Windows" ]]; then - echo "===== camitk-config binary not found, using Debug version on Windows =====" - # try with debug postfix - camitkConfig=$camitkConfig-debug - fi + echo "===== Not found: $camitkConfig on $osName =====" + if [[ "$osName" == "Windows" ]]; then + echo "===== camitk-config binary not found, using Debug version on Windows =====" + # try with debug postfix + camitkConfig=$camitkConfig-debug + fi fi echo "===== Get CamiTK configuration ====="