Commit a1660043 authored by Emmanuel Promayon's avatar Emmanuel Promayon

Merge branch 'feature/gitab-runner-on-win7' into 'develop'

NEW check bash shell executor on win7 gitlab runner

See merge request !85
parents 9c16745b 511e52d9
#!/bin/bash
CONTAINER_ID=$(cat /proc/self/cgroup | head -n 1 | cut -d '/' -f3)
if [ "$OS" == "win7" ]; then
# there is no docker on windows
CONTAINER_ID=0
else
CONTAINER_ID=$(cat /proc/self/cgroup | head -n 1 | cut -d '/' -f3)
fi
# default stage is coverage
if [[ "$CAMITK_CI_STAGE" == "" ]]; then
......
#!/bin/bash
# Uncomment next line to print each bash command before it is executed
#set -x
echo "Job $CI_JOB_NAME"
......@@ -9,7 +11,20 @@ fi
echo "Build"
xvfb-run --auto-servernum --server-args="-screen 0 1024x768x24" \
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" \
-DCTEST_SOURCE_DIRECTORY="$PROJECT_SOURCE_DIR" \
-DCTEST_BINARY_DIRECTORY="$PROJECT_BUILD_DIR" \
-S $PROJECT_SOURCE_DIR/sdk/cmake/ctest/ci-build.cmake > >(tee ${PROJECT_LOG_DIR}/build.log | grep --line-buffered -e "- Building" -e "Compiler errors" -e "Compiler warnings") 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" \
......@@ -19,3 +34,4 @@ xvfb-run --auto-servernum --server-args="-screen 0 1024x768x24" \
-DCTEST_SOURCE_DIRECTORY="$PROJECT_SOURCE_DIR" \
-DCTEST_BINARY_DIRECTORY="$PROJECT_BUILD_DIR" \
-S $PROJECT_SOURCE_DIR/sdk/cmake/ctest/ci-build.cmake > >(tee ${PROJECT_LOG_DIR}/build.log | grep --line-buffered -e "\[100%] Built target") 2>&1
fi
#!/bin/bash
# Uncomment next line to print each bash command before it is executed
#set -x
echo "Job $CI_JOB_NAME"
......@@ -16,7 +18,8 @@ if [ "$CAMITK_CI_MODE" == "Nightly" ]; then
echo "Nightly Build, start from scratch";
fi
xvfb-run --auto-servernum --server-args="-screen 0 1024x768x24" \
if [ "$OS" == "win7" ]; then
# there is no xvfb on windows
ctest -VV \
-DCTEST_SITE="$CDASH_SITE" \
-DCI_MODE="$CAMITK_CI_MODE" \
......@@ -26,3 +29,17 @@ xvfb-run --auto-servernum --server-args="-screen 0 1024x768x24" \
-DCTEST_SOURCE_DIRECTORY="$PROJECT_SOURCE_DIR" \
-DCTEST_BINARY_DIRECTORY="$PROJECT_BUILD_DIR" \
-S $PROJECT_SOURCE_DIR/sdk/cmake/ctest/ci-configure.cmake > >(tee ${PROJECT_LOG_DIR}/configure.log) 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" \
-DCTEST_SOURCE_DIRECTORY="$PROJECT_SOURCE_DIR" \
-DCTEST_BINARY_DIRECTORY="$PROJECT_BUILD_DIR" \
-S $PROJECT_SOURCE_DIR/sdk/cmake/ctest/ci-configure.cmake > >(tee ${PROJECT_LOG_DIR}/configure.log) 2>&1
fi
......@@ -224,108 +224,152 @@ debian_stable_coverage:
coverage: '/ lines......: \d+\.\d+/'
# -------------------------------------
# ubuntu LTS jobs
# -------------------------------------
.define_os: &ubuntu_lts_image
# The default image "ubuntu:latest" from docker.io does not have all the build toolchain and dependencies
# → use custom build local image: camitk/ubuntu:lts-camitk
image: camitk/ubuntu:lts-camitk
variables:
# OS Id
OS: "ubuntu-lts"
# the name of the current machine
CDASH_SITE: "[Gitlab Runner] Ubuntu LTS"
# compiler-arch-buildtype string
COMPILER_CONFIG: "GCC-64bits-Debug"
# path to the intended build directory
PROJECT_BUILD_DIR: "/opt/build/${OS}-${CI_COMMIT_REF_SLUG}"
# path to the intended log directory (cannot be an absolute path)
PROJECT_LOG_DIR: "${OS}-${CI_COMMIT_REF_SLUG}/log"
# debug for now
#CI_DEBUG_TRACE: "true"
tags:
- ubuntu:lts
ubuntu_lts_check:
<<: *ubuntu_lts_image
<<: *default_job_config
<<: *check_pipeline_script
## -------------------------------------
## ubuntu LTS jobs
## -------------------------------------
#.define_os: &ubuntu_lts_image
## The default image "ubuntu:latest" from docker.io does not have all the build toolchain and dependencies
## → use custom build local image: camitk/ubuntu:lts-camitk
#image: camitk/ubuntu:lts-camitk
#variables:
## OS Id
#OS: "ubuntu-lts"
## the name of the current machine
#CDASH_SITE: "[Gitlab Runner] Ubuntu LTS"
## compiler-arch-buildtype string
#COMPILER_CONFIG: "GCC-64bits-Debug"
## path to the intended build directory
#PROJECT_BUILD_DIR: "/opt/build/${OS}-${CI_COMMIT_REF_SLUG}"
## path to the intended log directory (cannot be an absolute path)
#PROJECT_LOG_DIR: "${OS}-${CI_COMMIT_REF_SLUG}/log"
## debug for now
##CI_DEBUG_TRACE: "true"
#tags:
#- ubuntu:lts
#ubuntu_lts_check:
#<<: *ubuntu_lts_image
#<<: *default_job_config
#<<: *check_pipeline_script
#ubuntu_lts_configure:
#<<: *ubuntu_lts_image
#<<: *default_job_config
#<<: *configure_artifacts
#<<: *configure_script
#ubuntu_lts_build:
#<<: *ubuntu_lts_image
#<<: *default_job_config
#<<: *build_artifacts
#<<: *build_script
#ubuntu_lts_test:
#<<: *ubuntu_lts_image
#<<: *default_job_config
#<<: *test_artifacts
#<<: *test_script
#ubuntu_lts_coverage:
#<<: *ubuntu_lts_image
#<<: *default_job_config
#<<: *coverage_artifacts
#<<: *coverage_script
## on Ubuntu:
#coverage: '/ Percentage Coverage: \d+\.\d+/'
## -------------------------------------
## debian oldstable jobs
## -------------------------------------
#.define_os: &debian_oldstable_image
## The default image "debian:oldstable" from docker.io does not have all the build toolchain and dependencies
## → use custom build local image: camitk/debian:oldstable-camitk
#image: camitk/debian:oldstable-camitk
#variables:
## OS Id
#OS: "debian-oldstable"
## the name of the current machine
#CDASH_SITE: "[Gitlab Runner] Debian old stable"
## compiler-arch-buildtype string
#COMPILER_CONFIG: "GCC-64bits-Debug"
## path to the intended build directory
#PROJECT_BUILD_DIR: "/opt/build/${OS}-${CI_COMMIT_REF_SLUG}"
## path to the intended log directory (cannot be an absolute path)
#PROJECT_LOG_DIR: "${OS}-${CI_COMMIT_REF_SLUG}/log"
#tags:
#- debian:oldstable
#debian_oldstable_check:
#<<: *debian_oldstable_image
#<<: *default_job_config
#<<: *check_pipeline_script
#debian_oldstable_configure:
#<<: *debian_oldstable_image
#<<: *default_job_config
#<<: *configure_artifacts
#<<: *configure_script
#debian_oldstable_build:
#<<: *debian_oldstable_image
#<<: *default_job_config
#<<: *build_artifacts
#<<: *build_script
#debian_oldstable_test:
#<<: *debian_oldstable_image
#<<: *default_job_config
#<<: *test_artifacts
#<<: *test_script
#debian_oldstable_coverage:
#<<: *debian_oldstable_image
#<<: *default_job_config
#<<: *coverage_artifacts
#<<: *coverage_script
#coverage: '/ lines......: \d+\.\d+/'
ubuntu_lts_configure:
<<: *ubuntu_lts_image
<<: *default_job_config
<<: *configure_artifacts
<<: *configure_script
ubuntu_lts_build:
<<: *ubuntu_lts_image
<<: *default_job_config
<<: *build_artifacts
<<: *build_script
ubuntu_lts_test:
<<: *ubuntu_lts_image
<<: *default_job_config
<<: *test_artifacts
<<: *test_script
ubuntu_lts_coverage:
<<: *ubuntu_lts_image
<<: *default_job_config
<<: *coverage_artifacts
<<: *coverage_script
# on Ubuntu:
coverage: '/ Percentage Coverage: \d+\.\d+/'
# -------------------------------------
# debian oldstable jobs
# win7 jobs
# -------------------------------------
.define_os: &debian_oldstable_image
# The default image "debian:oldstable" from docker.io does not have all the build toolchain and dependencies
# → use custom build local image: camitk/debian:oldstable-camitk
image: camitk/debian:oldstable-camitk
.define_os: &win7_config
# on windows the executor is just a shell (not a docker)
variables:
# OS Id
OS: "debian-oldstable"
OS: "win7"
# the name of the current machine
CDASH_SITE: "[Gitlab Runner] Debian old stable"
# compiler-arch-buildtype string
COMPILER_CONFIG: "GCC-64bits-Debug"
CDASH_SITE: "[Gitlab Runner] Win7"
# compiler-arch-buildtype string (Ninja would be better instead of MSVC2015 to speed up compilation on VM)
COMPILER_CONFIG: "MSVC2015-64bits-Debug"
# path to the intended build directory
PROJECT_BUILD_DIR: "/opt/build/${OS}-${CI_COMMIT_REF_SLUG}"
PROJECT_BUILD_DIR: "/c/dev/gitlab-runner/builds/${OS}-${CI_COMMIT_REF_SLUG}"
# path to the intended log directory (cannot be an absolute path)
PROJECT_LOG_DIR: "${OS}-${CI_COMMIT_REF_SLUG}/log"
tags:
- debian:oldstable
- win7
debian_oldstable_check:
<<: *debian_oldstable_image
win7_check:
<<: *win7_config
<<: *default_job_config
<<: *check_pipeline_script
debian_oldstable_configure:
<<: *debian_oldstable_image
win7_configure:
<<: *win7_config
<<: *default_job_config
<<: *configure_artifacts
<<: *configure_script
debian_oldstable_build:
<<: *debian_oldstable_image
win7_build:
<<: *win7_config
<<: *default_job_config
<<: *build_artifacts
<<: *build_script
debian_oldstable_test:
<<: *debian_oldstable_image
win7_test:
<<: *win7_config
<<: *default_job_config
<<: *test_artifacts
<<: *test_script
debian_oldstable_coverage:
<<: *debian_oldstable_image
<<: *default_job_config
<<: *coverage_artifacts
<<: *coverage_script
coverage: '/ lines......: \d+\.\d+/'
#!/bin/bash
# Uncomment next line to print each bash command before it is executed
#set -x
echo "Job $CI_JOB_NAME"
......@@ -9,7 +11,9 @@ fi
echo "Test"
xvfb-run --auto-servernum --server-args="-screen 0 1024x768x24" \
if [ "$OS" == "win7" ]; then
# there is no xvfb on windows
ctest -VV \
-DCTEST_SITE="$CDASH_SITE" \
-DCI_MODE="$CAMITK_CI_MODE" \
......@@ -20,6 +24,20 @@ xvfb-run --auto-servernum --server-args="-screen 0 1024x768x24" \
-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
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
......
......@@ -33,6 +33,8 @@
#include "Pressure.h"
#include "Acceleration.h"
#include <functional> // for std::greater
//--------- static factory -------------
Load* Load::LoadFactory(std::string type) {
Load* newOne = NULL;
......@@ -185,7 +187,7 @@ void Load::addEvent(ValueEvent* ve) {
eventList.push_back(ve);
//-- sort the list by date
#if defined(_WIN32) && !defined(__MINGW32__) && ((_MSC_VER > 1700) || (_MSC_VER < 1600)) // MSVC<10 and MSVC11+ (VS 2012+) only, see http://msdn.microsoft.com/en-us/library/b0084kay%28v=vs.100%29.aspx
#if defined(_WIN32) && !defined(__MINGW32__) && (_MSC_VER <= 1100) // for MSVC < 11, see https://msdn.microsoft.com/en-us/library/b0084kay.aspx
std::sort(eventList.begin(), eventList.end(), std::greater); // use the greater() method (see above)
#else
std::sort(eventList.begin(), eventList.end(), std::greater<ValueEvent*>()); // use the greater() method (see above)
......
......@@ -18,9 +18,14 @@ camitk_add_test(EXECUTABLE_ARGS "-h" PROJECT_NAME ${TEST_BASENAME} TEST_SUFF
# should pass because invoking cepgenerator with a faulty arguments results in printing
# an "Argument error" message (and exit failure)
camitk_add_test(EXECUTABLE_ARGS "-badarg"
PASS_REGULAR_EXPRESSION "unknown option '-badarg'"
PROJECT_NAME ${TEST_BASENAME} TEST_SUFFIX "-")
# But on msvc with dependencies installed using the CamiTK developer package, there is a segfault generating at exit
# when freeing the xsdcxx cli_options_map (probably due to the fact the CamiTK developer package
# was compiled using an older version of MSVC2015 than the currently installed version
if (NOT MSVC_VERSION MATCHES "1900") # see https://cmake.org/cmake/help/v3.11/variable/MSVC_VERSION.html
camitk_add_test(EXECUTABLE_ARGS "-badarg"
PASS_REGULAR_EXPRESSION "unknown option '-badarg'"
PROJECT_NAME ${TEST_BASENAME} TEST_SUFFIX "-")
endif()
camitk_add_test(EXECUTABLE_ARGS "-f missingdir"
PASS_REGULAR_EXPRESSION "Argument error: please provide an output directory."
......
......@@ -85,7 +85,7 @@ cleanup() {
cd
fi
# finally cleanup working dir
# TODO rm -rf $workingDir
rm -rf $workingDir
# use the backup value (otherwise the result of the "rm -rf" command above will
# be used, and that's probably always 0 !)
exit $currentExitValue
......@@ -106,6 +106,7 @@ checkValueId=1 # test id starts at 1
echo "===== Creating temporary directory ====="
workingDir=$(mktemp --tmpdir -d camitk-test-tmp.XXXXXXXXXX)
echo "===== Temporary directory set to $workingDir ====="
if [ $# -lt 1 -o "$1" != "-inbuild" ] ; then
echo "===== Testing installed camitk version ====="
......@@ -127,8 +128,33 @@ else
CMAKE_OPTIONS="$CMAKE_OPTIONS -DCMAKE_MODULE_PATH:PATH=$3/sdk/cmake/modules;$3/sdk/cmake/modules/macros"
fi
echo "===== Check OS ====="
unameOS=$(uname)
if [[ "$unameOS" =~ ^MINGW64.* || "$unameOS" =~ ^MSYS_NT.* ]]; then
osName="Windows"
else
osName="Linux"
fi
echo "===== Uname is $unameOS ===== OS is $osName ====="
# check if current build is on windows debug version
if [ ! -f $camitkGenerator ]; then
echo "===== Not found: $camitkGenerator on $osName ====="
if [[ "$osName" == "Windows" ]]; then
echo "===== camitk-cepgenerator binary not found, using Debug version on Windows ====="
# try with debug postfix
camitkGenerator=$camitkGenerator-debug
camitkConfig=$camitkConfig-debug
fi
fi
getWorkingDirExtensionCount() {
echo $(xvfb-run --auto-servernum --server-num=1 $camitkConfig --config | grep "^ - \[W\] " | wc -l)
if [[ "$osName" == "Windows" ]]; then
# no virtual X11
echo $($camitkConfig --config | grep "^ - \[W\] " | wc -l)
else
echo $(xvfb-run --auto-servernum --server-num=1 $camitkConfig --config | grep "^ - \[W\] " | wc -l)
fi
}
......@@ -493,9 +519,9 @@ cat <<EOF > empty.xml
</cep>
EOF
# ---------------------- complete-test-1.xml ----------------------
# ---------------------- completeTest1.xml ----------------------
# Example taken from distributed source ./sdk/libraries/cepcoreschema/testdata/complete-test-1.xml
cat <<EOF > complete-test-1.xml
cat <<EOF > completeTest1.xml
<?xml version="1.0" encoding="utf-8"?>
<cep xmlns="http://camitk.imag.fr/cepcoreschema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://camitk.imag.fr/cepcoreschema Cep.xsd">
<name>Complete test CEP 1</name>
......@@ -706,7 +732,7 @@ generateConfigureAndMake() {
cd $workingDir
rm -rf $testDirName
mkdir $testDirName
$camitkGenerator -f $1 -d $testDirName > ./generated-$testDirName
$camitkGenerator -f $1 -d $workingDir/$testDirName > ./generated-$testDirName
echo "===== generated-$testDirName ====="
cat ./generated-$testDirName
cd $testDirName
......@@ -719,13 +745,22 @@ generateConfigureAndMake() {
# configure
mkdir build
cd build
xvfb-run --auto-servernum --server-num=1 cmake $CMAKE_OPTIONS ../$srcDirName > ../cmake-log 2> ../cmake-error
if [[ "$osName" == "Windows" ]]; then
# no virtual X11 -DCMAKE_C_FLAGS:STRING="/MP" -DCMAKE_CXX_FLAGS="/MP"
cmake $CMAKE_OPTIONS -Wno-dev -G "Visual Studio 14 2015 Win64" -DCMAKE_BUILD_TYPE:STRING=Debug ../$srcDirName > ../cmake-log 2> ../cmake-error
else
xvfb-run --auto-servernum --server-num=1 cmake $CMAKE_OPTIONS ../$srcDirName > ../cmake-log 2> ../cmake-error
fi
echo "===== cmake-log ====="
cat ../cmake-log
echo "===== cmake-error ====="
cat ../cmake-error
# build (parallel)
make -j9 > ../make-log 2> ../make-error
if [[ "$osName" == "Windows" ]]; then
cmake --build . --config Debug > ../make-log 2> ../make-error
else
# build (parallel)
make -j9 > ../make-log 2> ../make-error
fi
echo "===== make-log ====="
cat ../make-log
echo "===== make-error ====="
......@@ -744,7 +779,7 @@ testcepfile() {
# check if everything is compiled and can be loaded
value=$(getWorkingDirExtensionCount)
echo "$checkValueId- Check Number of extensions for $1: $value"
echo "$(xvfb-run --auto-servernum --server-num=1 $camitkConfig --config | grep "^ - \[W\] ")"
echo "$($camitkConfig --config | grep "^ - \[W\] ")"
if [ "$value" -ne "$expectedValue" ]; then
echo "Error: unexpected number of extensions installed in the working directory ($value != $expectedValue)"
exitStatus=$checkValueId
......@@ -764,8 +799,12 @@ testcepfile() {
# --------------------------------------------------------------------------
#testcepfile cep.xml nrOfExcpectedNewExtensions
testcepfile complete-test-1.xml 3 testlib
#testcepfile cep.xml nrOfExpectedNewExtensions
if [[ "$osName" == "Windows" ]]; then
echo "Windows: skip testing cep with lib"
else
testcepfile completeTest1.xml 3 testlib
fi
testcepfile exampleComponents.xml 2
testcepfile actionsExamplesLicence.xml 2
testcepfile actionsExamplesNoLicence.xml 2
......
......@@ -24,8 +24,10 @@ set -e
cleanup() {
# backup the current exit status
currentExitValue=$?
# kill the xfvb
kill $xvfbPid
if [[ "$osName" != "Windows" ]]; then
# kill the xfvb
kill $xvfbPid
fi
# cleanup current dir (but not build dir!)
if [ "$inBuild" == "0" ] ; then
rm -rf $workingDir
......@@ -59,20 +61,44 @@ else
cd $workingDir
fi
echo "===== Configuring xvfb ====="
# Starts the server first (to avoid a distracting warning output due to OpenGL context)
Xvfb :5 -screen 0 1600x1200x24 -ac +extension GLX +render -noreset -v -fbdir $workingDir/ &
xvfbPid=$!
echo "PID of Xvfb: $xvfbPid"
export DISPLAY=:5
export XAUTHORITY=/dev/null
echo "===== Check OS ====="
unameOS=$(uname)
if [[ "$unameOS" =~ ^MINGW64.* || "$unameOS" =~ ^MSYS_NT.* ]]; then
osName="Windows"
else
osName="Linux"
fi
echo "===== Uname is $unameOS ===== OS is $osName ====="
echo "===== Get CamiTK configuration ====="
if [[ "$osName" != "Windows" ]]; then
echo "===== Configuring xvfb ====="
# Starts the server first (to avoid a distracting warning output due to OpenGL context)
Xvfb :5 -screen 0 1600x1200x24 -ac +extension GLX +render -noreset -v -fbdir $workingDir/ &
xvfbPid=$!
echo "PID of Xvfb: $xvfbPid"
export DISPLAY=:5
export XAUTHORITY=/dev/null
fi
# Check config executable
if [ "$inBuild" == "0" ] ; then
camitk-config --config > ./config-output 2>&1
camitkConfig="camitk-config"
else
bin/camitk-config --config > ./config-output 2>&1
camitkConfig="bin/camitk-config"
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
fi
echo "===== Get CamiTK configuration ====="
$camitkConfig --config > ./config-output 2>&1
camitkConfig=$(cat config-output | sed "s/QStandardPaths.*'.*'//")
echo "===== config-output ====="
......@@ -102,8 +128,8 @@ getExpectedValue() {
echo "/usr"
;;
"Current Working Directory")
# this is an upstream test, it should be ran in build dir
echo $(pwd)
# this is an upstream test, it should be ran in build dir (for windows, remplace ^/c by C:
echo $(pwd) | sed -e "s+^/c+C:+"
;;
"Number of Component Extensions")
case "$version" in
......
......@@ -66,32 +66,40 @@ endif()
set(CTEST_BUILD_NAME "${CURRENT_GIT_BRANCH} ${CURRENT_GIT_HASH} ${CI_BUILD_SETTINGS}")
if(UNIX)
set( CTEST_CMAKE_GENERATOR "Unix Makefiles" )
set(CTEST_CMAKE_GENERATOR "Unix Makefiles" )
elseif(WIN32)
if(COMPILER MATCHES "MinGW" OR "MINGW")
set( CTEST_CMAKE_GENERATOR "MinGW Makefiles" )
set(CTEST_CMAKE_GENERATOR "MinGW Makefiles" )
elseif(COMPILER MATCHES "MSVC2008")
set( CTEST_CMAKE_GENERATOR "Visual Studio 9 2008" )
set(CTEST_CMAKE_GENERATOR "Visual Studio 9 2008" )
elseif(COMPILER MATCHES "MSVC2010" AND ARCH MATCHES "32bits")
set( CTEST_CMAKE_GENERATOR "Visual Studio 10" )
set( CMAKE_MAKE_PROGRAM "C:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/VCExpress.exe") # Do not use MSBuild.exe as it won't work
set(CTEST_CMAKE_GENERATOR "Visual Studio 10" )
set(CMAKE_MAKE_PROGRAM "C:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/VCExpress.exe") # Do not use MSBuild.exe as it won't work
elseif(COMPILER MATCHES "MSVC2010" AND ARCH MATCHES "64bits")
set( CTEST_CMAKE_GENERATOR "Visual Studio 10 Win64" )
set( CMAKE_MAKE_PROGRAM "C:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/VCExpress.exe") # Do not use MSBuild.exe as it won't work
set(CTEST_CMAKE_GENERATOR "Visual Studio 10 Win64" )
set(CMAKE_MAKE_PROGRAM "C:/Program Files (x86)/Microsoft Visual Studio 10.0/Common7/IDE/VCExpress.exe") # Do not use MSBuild.exe as it won't work
elseif(COMPILER MATCHES "MSVC2012" AND ARCH MATCHES "32bits")
set( CTEST_CMAKE_GENERATOR "Visual Studio 11" )
set( CMAKE_MAKE_PROGRAM "C:/Program Files (x86)/Microsoft Visual Studio 11.0/Common7/IDE/WDExpress.exe") # Do not use MSBuild.exe as it won't work
set(CTEST_CMAKE_GENERATOR "Visual Studio 11" )
set(CMAKE_MAKE_PROGRAM "C:/Program Files (x86)/Microsoft Visual Studio 11.0/Common7/IDE/WDExpress.exe") # Do not use MSBuild.exe as it won't work
elseif(COMPILER MATCHES "MSVC2012" AND ARCH MATCHES "64bits")
set( CTEST_CMAKE_GENERATOR "Visual Studio 11 Win64" )
set( CMAKE_MAKE_PROGRAM "C:/Program Files (x86)/Microsoft Visual Studio 11.0/Common7/IDE/WDExpress.exe") # Do not use MSBuild.exe as it won't work
set(CTEST_CMAKE_GENERATOR "Visual Studio 11 Win64" )
set(CMAKE_MAKE_PROGRAM "C:/Program Files (x86)/Microsoft Visual Studio 11.0/Common7/IDE/WDExpress.exe") # Do not use MSBuild.exe as it won't work
elseif(COMPILER MATCHES "MSVC2013" AND ARCH MATCHES "32bits")
set( CTEST_CMAKE_GENERATOR "Visual Studio 12" )
set(CTEST_CMAKE_GENERATOR "Visual Studio 12" )
elseif(COMPILER MATCHES "MSVC2013" AND ARCH MATCHES "64bits")
set( CTEST_CMAKE_GENERATOR "Visual Studio 12 Win64" )
set(CTEST_CMAKE_GENERATOR "Visual Studio 12 Win64" )
elseif(COMPILER MATCHES "MSVC2015" AND ARCH MATCHES "64bits")
set( CTEST_CMAKE_GENERATOR "Visual Studio 14 2015 Win64" )
set(CTEST_CMAKE_GENERATOR "Visual Studio 14 2015 Win64" )
# /EHsc is for removing warning in memory management in exception handling
set(CMAKE_C_FLAGS "/EHsc ${CMAKE_C_FLAGS}")
set(CMAKE_CXX_FLAGS "/EHsc ${CMAKE_CXX_FLAGS}")
elseif(COMPILER MATCHES "MSVC2017" AND ARCH MATCHES "64bits")
set( CTEST_CMAKE_GENERATOR "Visual Studio 15 2017 Win64" )
set(CTEST_CMAKE_GENERATOR "Visual Studio 15 2017 Win64" )
elseif(COMPILER MATCHES "Ninja")
set(CTEST_CMAKE_GENERATOR "Ninja")
# ninja cannot find the compiler
#set(ENV{CC} "cl.exe")
#set(ENV{CXX} "cl.exe")
else()
message(FATAL_ERROR "CTEST COMPILER ERROR : No proper compiler found, please check ctest command syntax.")
endif()
......@@ -104,25 +112,33 @@ else()
message(FATAL_ERROR "NO BUILD TYPE : Please provide a build type: Debug or Release")
<