Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow using CTEST_USE_LAUNCHERS even when tests are disabled #772

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ matrix:
- gcc-mingw-w64-x86-64
- gcc-mingw-w64
- os: linux
compiler: x86_64-w64-mingw32-gcc
compiler: i686-w64-mingw32-gcc
env: OPJ_CI_ARCH=i386 OPJ_CI_BUILD_CONFIGURATION=Release
addons:
apt:
Expand Down
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,11 @@ if(BUILD_TESTING)
endif()
endif()

# Allow the use of CTEST_USE_LAUNCHERS even when not including CTest (mingw builds)
# CTestUseLaunchers module is only available starting cmake >= 3.0. Using OPTIONAL flag
# to cope with it
include(CTestUseLaunchers OPTIONAL)

#-----------------------------------------------------------------------------
# install all targets referenced as OPENJPEGTargets
install(EXPORT OpenJPEGTargets DESTINATION ${OPENJPEG_INSTALL_PACKAGE_DIR})
Expand Down
11 changes: 11 additions & 0 deletions tools/ctest_scripts/travis-ci.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,15 @@ else()
set( JPYLYZER_EXT "py" )
endif()

# Choose CTest reporting mode.
if(NOT "${CTEST_CMAKE_GENERATOR}" MATCHES "Make")
# Launchers work only with Makefile generators.
set(CTEST_USE_LAUNCHERS 0)
elseif(NOT DEFINED CTEST_USE_LAUNCHERS)
# The setting is ignored by CTest < 2.8 so we need no version test.
set(CTEST_USE_LAUNCHERS 1)
endif()

if ("$ENV{OPJ_BUILD_CONFIGURATION}" STREQUAL "")
set( CTEST_BUILD_CONFIGURATION "Release")
else()
Expand Down Expand Up @@ -112,6 +121,8 @@ OPJ_DATA_ROOT:PATH=$ENV{PWD}/data
# jpylyzer is available with on GitHub: https://github.com/openpreserve/jpylyzer
JPYLYZER_EXECUTABLE=$ENV{PWD}/jpylyzer/jpylyzer.${JPYLYZER_EXT}

# Better build error/warning reports on the dashboard
CTEST_USE_LAUNCHERS:BOOL=${CTEST_USE_LAUNCHERS}
" )

#---------------------
Expand Down
4 changes: 2 additions & 2 deletions tools/travis-ci/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ if [ "${COVERITY_SCAN_BRANCH:-}" == "1" ] || [ "${OPJ_CI_ABI_CHECK:-}" == "1" ];
exit 0
fi

if [ "${OPJ_CI_ASAN:-}" == "1" ]; then
if [ "${TRAVIS_OS_NAME:-}" == "linux" ]; then
# We need a new version of cmake than travis-ci provides
wget --no-check-certificate -qO - https://cmake.org/files/v3.5/cmake-3.5.2-Linux-x86_64.tar.gz | tar -xz
# copy to a directory that will not changed every version
Expand All @@ -62,7 +62,7 @@ if [ "${OPJ_CI_SKIP_TESTS:-}" != "1" ]; then
git clone --depth=1 --branch=${OPJ_DATA_BRANCH} git://github.com/uclouvain/openjpeg-data.git data

# We need jpylyzer for the test suite
JPYLYZER_VERSION="1.17.0"
JPYLYZER_VERSION="1.17.0"
echo "Retrieving jpylyzer"
if [ "${APPVEYOR:-}" == "True" ]; then
wget --local-encoding=UTF-8 -q http://dl.bintray.com/openplanets/opf-windows/jpylyzer_${JPYLYZER_VERSION}_win32.zip
Expand Down