From 897d2c0b757dc906b9d69d5759b69b051fa47a1f Mon Sep 17 00:00:00 2001 From: mayeut Date: Sat, 12 Sep 2015 02:34:14 +0200 Subject: [PATCH 01/27] Enhance travis run script --- tools/travis-ci/run.sh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tools/travis-ci/run.sh b/tools/travis-ci/run.sh index a1396cfef..d95475e54 100755 --- a/tools/travis-ci/run.sh +++ b/tools/travis-ci/run.sh @@ -10,12 +10,15 @@ set -o pipefail ## Fail on error in pipe # Set-up some variables OPJ_SOURCE_DIR=$(cd $(dirname $0)/../.. && pwd) -if [ "${TRAVIS_REPO_SLUG:-}" == "uclouvain/openjpeg" ]; then - OPJ_SITE="travis-ci.org" - OPJ_DO_SUBMIT=1 +OPJ_DO_SUBMIT=0 # Do not flood cdash +if [ "${TRAVIS_REPO_SLUG:-}" != "" ]; then + OPJ_OWNER=$(echo "${TRAVIS_REPO_SLUG}" | sed 's/\(^.*\)\/.*/\1/') + OPJ_SITE="${OPJ_OWNER}.travis-ci.org" + if [ "${OPJ_OWNER}" == "uclouvain" ]; then + OPJ_DO_SUBMIT=1 + fi else OPJ_SITE="$(hostname)" - OPJ_DO_SUBMIT=0 # Do not flood cdash fi if [ "${TRAVIS_OS_NAME:-}" == "" ]; then From 41a96aee5af59cc18f4292becc9f5122f6589f2d Mon Sep 17 00:00:00 2001 From: mayeut Date: Sat, 12 Sep 2015 02:59:49 +0200 Subject: [PATCH 02/27] Fix fetching of openjpeg-data MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fetch from master branch if TRAVIS_BRANCH doesn’t exist --- tools/travis-ci/install.sh | 14 +++++++++++--- tools/travis-ci/run.sh | 2 +- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/tools/travis-ci/install.sh b/tools/travis-ci/install.sh index d1ce88852..9130ee95e 100755 --- a/tools/travis-ci/install.sh +++ b/tools/travis-ci/install.sh @@ -22,12 +22,20 @@ trap exit ERR # travis-ci doesn't dump cmake version in system info, let's print it cmake --version +OPJ_SOURCE_DIR=$(cd $(dirname $0)/../.. && pwd) + # We need test data if [ "${TRAVIS_BRANCH:-}" == "" ]; then - TRAVIS_BRANCH=master #default to master + TRAVIS_BRANCH=$(git -C ${OPJ_SOURCE_DIR} branch | grep '*' | tr -d '*[[:blank:]]') #default to same branch as we're setting up +fi +OPJ_DATA_HAS_BRANCH=$(git ls-remote --heads git://github.com/uclouvain/openjpeg-data.git ${TRAVIS_BRANCH} | wc -l) +if [ ${OPJ_DATA_HAS_BRANCH} -ne 0 ]; then + OPJ_DATA_BRANCH=${TRAVIS_BRANCH} +else + OPJ_DATA_BRANCH=master #default to master fi -echo "Cloning openjpeg-data from ${TRAVIS_BRANCH} branch" -git clone --depth=1 --branch=${TRAVIS_BRANCH} git://github.com/uclouvain/openjpeg-data.git data +echo "Cloning openjpeg-data from ${OPJ_DATA_BRANCH} branch" +git clone --depth=1 --branch=${OPJ_DATA_BRANCH} git://github.com/uclouvain/openjpeg-data.git data # We need jpylyzer for the test suite echo "Retrieving jpylyzer" diff --git a/tools/travis-ci/run.sh b/tools/travis-ci/run.sh index d95475e54..36bcc0d45 100755 --- a/tools/travis-ci/run.sh +++ b/tools/travis-ci/run.sh @@ -60,7 +60,7 @@ fi if [ "${TRAVIS_BRANCH:-}" == "" ]; then echo "Guessing branch" - TRAVIS_BRANCH=$(git -C ../openjpeg branch | grep '*' | tr -d '*[[:blank:]]') #default to master + TRAVIS_BRANCH=$(git -C ${OPJ_SOURCE_DIR} branch | grep '*' | tr -d '*[[:blank:]]') #default to master fi OPJ_BUILDNAME=${OPJ_OS_NAME}-${OPJ_CC_VERSION}-${TRAVIS_BRANCH} From 9258f8f6a7019e785a0b8c6c593637d4a89bfbce Mon Sep 17 00:00:00 2001 From: mayeut Date: Sat, 12 Sep 2015 03:02:42 +0200 Subject: [PATCH 03/27] Use make to unzip kakadu --- tools/travis-ci/install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/travis-ci/install.sh b/tools/travis-ci/install.sh index 9130ee95e..f487ed364 100755 --- a/tools/travis-ci/install.sh +++ b/tools/travis-ci/install.sh @@ -51,7 +51,7 @@ chmod +x jpylyzer/jpylyzer/jpylyzer.py if [ "${OPJ_NONCOMMERCIAL:-}" == "1" ]; then if [ "${TRAVIS_OS_NAME:-}" == "linux" ]; then echo "Retrieving Kakadu" - wget -q http://kakadusoftware.com/wp-content/uploads/2014/06/KDU77_Demo_Apps_for_Linux-x86-64_150710.zip | tar -x + wget -q http://kakadusoftware.com/wp-content/uploads/2014/06/KDU77_Demo_Apps_for_Linux-x86-64_150710.zip cmake -E tar -xf KDU77_Demo_Apps_for_Linux-x86-64_150710.zip mv KDU77_Demo_Apps_for_Linux-x86-64_150710 kdu fi From 79819087544a29a792eb43b99638da401b7430ac Mon Sep 17 00:00:00 2001 From: mayeut Date: Sat, 12 Sep 2015 03:13:45 +0200 Subject: [PATCH 04/27] Fix unbound variable --- tools/travis-ci/install.sh | 2 +- tools/travis-ci/run.sh | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/tools/travis-ci/install.sh b/tools/travis-ci/install.sh index f487ed364..5808f2792 100755 --- a/tools/travis-ci/install.sh +++ b/tools/travis-ci/install.sh @@ -49,7 +49,7 @@ chmod +x jpylyzer/jpylyzer/jpylyzer.py # so long as such use or re-distribution is accompanied with this copyright notice and is not for commercial gain. # Note: Binaries can only be used for non-commercial purposes. if [ "${OPJ_NONCOMMERCIAL:-}" == "1" ]; then - if [ "${TRAVIS_OS_NAME:-}" == "linux" ]; then + if [ "${TRAVIS_OS_NAME:-}" == "linux" ] || uname -s | grep -i Linux &> /dev/null; then echo "Retrieving Kakadu" wget -q http://kakadusoftware.com/wp-content/uploads/2014/06/KDU77_Demo_Apps_for_Linux-x86-64_150710.zip cmake -E tar -xf KDU77_Demo_Apps_for_Linux-x86-64_150710.zip diff --git a/tools/travis-ci/run.sh b/tools/travis-ci/run.sh index 36bcc0d45..65cc1c47a 100755 --- a/tools/travis-ci/run.sh +++ b/tools/travis-ci/run.sh @@ -82,7 +82,11 @@ fi set -x if [ "${OPJ_NONCOMMERCIAL:-}" == "1" ] && [ -d kdu ]; then if [ "${TRAVIS_OS_NAME}" == "linux" ]; then - export LD_LIBRARY_PATH=${PWD}/kdu:${LD_LIBRARY_PATH} + if [ "${LD_LIBRARY_PATH:-}" == "" ]; then + export LD_LIBRARY_PATH=${PWD}/kdu + else + export LD_LIBRARY_PATH=${PWD}/kdu:${LD_LIBRARY_PATH} + fi fi export PATH=${PWD}/kdu:${PATH} fi From 175eceb02022722f9a83feb1955453c6eee2dee7 Mon Sep 17 00:00:00 2001 From: mayeut Date: Sat, 12 Sep 2015 03:19:42 +0200 Subject: [PATCH 05/27] Fix matrix --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 2bdeea7e1..93c970d9b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,7 +9,7 @@ compiler: matrix: exclude: - os: osx - - compiler: gcc + compiler: gcc install: - ./tools/travis-ci/install.sh From 1e2dcaf7b3e95615a697a362bced6ef656b3822b Mon Sep 17 00:00:00 2001 From: mayeut Date: Sat, 12 Sep 2015 05:26:19 +0200 Subject: [PATCH 06/27] Add ctest script --- tools/ctest_scripts/travis-ci.cmake | 80 +++++++++++++++++++++++++++++ tools/travis-ci/run.sh | 30 ++++------- 2 files changed, 90 insertions(+), 20 deletions(-) create mode 100644 tools/ctest_scripts/travis-ci.cmake diff --git a/tools/ctest_scripts/travis-ci.cmake b/tools/ctest_scripts/travis-ci.cmake new file mode 100644 index 000000000..841d926c3 --- /dev/null +++ b/tools/ctest_scripts/travis-ci.cmake @@ -0,0 +1,80 @@ +# ----------------------------------------------------------------------------- +# Travis-ci ctest script for OpenJPEG project +# This will compile/run tests/upload to cdash OpenJPEG +# Results will be available at: http://my.cdash.org/index.php?project=OPENJPEG +# ----------------------------------------------------------------------------- + +cmake_minimum_required(VERSION 2.8) + +set(ENV{LANG} en_US.UTF-8) +set( CTEST_DASHBOARD_ROOT "$ENV{PWD}/build" ) +set( CTEST_CMAKE_GENERATOR "Unix Makefiles") # Always makefile in travis-ci environment +set( BUILD_PLATFORM "x86_64" ) + +# To execute part of the encoding test suite, kakadu binaries are needed to decode encoded image and compare +# it to the baseline. Kakadu binaries are freely available for non-commercial purposes +# at http://www.kakadusoftware.com. +# Here's the copyright notice from kakadu: +# Copyright is owned by NewSouth Innovations Pty Limited, commercial arm of the UNSW Australia in Sydney. +# You are free to trial these executables and even to re-distribute them, +# so long as such use or re-distribution is accompanied with this copyright notice and is not for commercial gain. +# Note: Binaries can only be used for non-commercial purposes. +if ("$ENV{OPJ_NONCOMMERCIAL}" STREQUAL "1") + set(KDUPATH $ENV{PWD}/kdu) + set(ENV{LD_LIBRARY_PATH} ${KDUPATH}) + set(ENV{PATH} $ENV{PATH}:${KDUPATH}) +endif() + +# Options +set( CACHE_CONTENTS " + +# Build kind +CMAKE_BUILD_TYPE:STRING=${CTEST_BUILD_CONFIGURATION} + +# Warning level +CMAKE_C_FLAGS:STRING= -Wall -Wextra -Wconversion -Wpedantic -Wno-unused-parameter -Wdeclaration-after-statement + +# Use to activate the test suite +BUILD_TESTING:BOOL=TRUE + +# Build Thirdparty, useful but not required for test suite +BUILD_THIRDPARTY:BOOL=TRUE + +# JPEG2000 test files are available with git clone https://github.com/uclouvain/openjpeg-data.git +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.py + +" ) + +#--------------------- +#1. openjpeg specific: +set( CTEST_PROJECT_NAME "OPENJPEG" ) +if(NOT EXISTS $ENV{OPJ_SOURCE_DIR}) + message(FATAL_ERROR "OPJ_SOURCE_DIR not defined or does not exist:$ENV{OPJ_SOURCE_DIR}") +endif() +set( CTEST_SOURCE_DIRECTORY "$ENV{OPJ_SOURCE_DIR}") +set( CTEST_BINARY_DIRECTORY "${CTEST_DASHBOARD_ROOT}") + +#--------------------- +# Files to submit to the dashboard +set (CTEST_NOTES_FILES +${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME} +${CTEST_BINARY_DIRECTORY}/CMakeCache.txt ) + +ctest_empty_binary_directory( "${CTEST_BINARY_DIRECTORY}" ) +file(WRITE "${CTEST_BINARY_DIRECTORY}/CMakeCache.txt" "${CACHE_CONTENTS}") + +# Perform a Experimental build +ctest_start(Experimental) +#ctest_update(SOURCE "${CTEST_SOURCE_DIRECTORY}") +ctest_configure(BUILD "${CTEST_BINARY_DIRECTORY}") +ctest_read_custom_files(${CTEST_BINARY_DIRECTORY}) +ctest_build(BUILD "${CTEST_BINARY_DIRECTORY}") +ctest_test(BUILD "${CTEST_BINARY_DIRECTORY}" PARALLEL_LEVEL 2) + +if ("$ENV{OPJ_DO_SUBMIT}" STREQUAL "1") + ctest_submit() +endif() +ctest_empty_binary_directory( "${CTEST_BINARY_DIRECTORY}" ) diff --git a/tools/travis-ci/run.sh b/tools/travis-ci/run.sh index 65cc1c47a..58b86c1a1 100755 --- a/tools/travis-ci/run.sh +++ b/tools/travis-ci/run.sh @@ -8,9 +8,12 @@ set -o errexit ## set -e : exit the script if any statement returns a non-true set -o pipefail ## Fail on error in pipe # Set-up some variables +OPJ_BUILD_CONFIGURATION=Release OPJ_SOURCE_DIR=$(cd $(dirname $0)/../.. && pwd) -OPJ_DO_SUBMIT=0 # Do not flood cdash +if [ "${OPJ_DO_SUBMIT:-}" == "" ]; then + OPJ_DO_SUBMIT=0 # Do not flood cdash by default +fi if [ "${TRAVIS_REPO_SLUG:-}" != "" ]; then OPJ_OWNER=$(echo "${TRAVIS_REPO_SLUG}" | sed 's/\(^.*\)\/.*/\1/') OPJ_SITE="${OPJ_OWNER}.travis-ci.org" @@ -63,11 +66,11 @@ if [ "${TRAVIS_BRANCH:-}" == "" ]; then TRAVIS_BRANCH=$(git -C ${OPJ_SOURCE_DIR} branch | grep '*' | tr -d '*[[:blank:]]') #default to master fi -OPJ_BUILDNAME=${OPJ_OS_NAME}-${OPJ_CC_VERSION}-${TRAVIS_BRANCH} +OPJ_BUILDNAME=${OPJ_OS_NAME}-${OPJ_CC_VERSION}-x86_64-${TRAVIS_BRANCH} if [ "${TRAVIS_PULL_REQUEST:-}" != "false" ] && [ "${TRAVIS_PULL_REQUEST:-}" != "" ]; then OPJ_BUILDNAME=${OPJ_BUILDNAME}-pr${TRAVIS_PULL_REQUEST} fi -OPJ_BUILDNAME=${OPJ_BUILDNAME}-Release-3rdP +OPJ_BUILDNAME=${OPJ_BUILDNAME}-${OPJ_BUILD_CONFIGURATION}-3rdP if [ "${OPJ_NONCOMMERCIAL:-}" == "1" ] && [ -d kdu ]; then echo " @@ -80,21 +83,8 @@ Note: Binaries can only be used for non-commercial purposes. fi set -x -if [ "${OPJ_NONCOMMERCIAL:-}" == "1" ] && [ -d kdu ]; then - if [ "${TRAVIS_OS_NAME}" == "linux" ]; then - if [ "${LD_LIBRARY_PATH:-}" == "" ]; then - export LD_LIBRARY_PATH=${PWD}/kdu - else - export LD_LIBRARY_PATH=${PWD}/kdu:${LD_LIBRARY_PATH} - fi - fi - export PATH=${PWD}/kdu:${PATH} -fi +# This will print configuration +export OPJ_DO_SUBMIT=${OPJ_DO_SUBMIT} +export OPJ_SOURCE_DIR=${OPJ_SOURCE_DIR} -mkdir build -cd build -cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=Release -DBUILD_CODEC=ON -DBUILD_THIRDPARTY=ON -DBUILD_TESTING=ON -DOPJ_DATA_ROOT=${PWD}/../data -DJPYLYZER_EXECUTABLE=${PWD}/../jpylyzer/jpylyzer/jpylyzer.py -DSITE=${OPJ_SITE} -DBUILDNAME=${OPJ_BUILDNAME} ${OPJ_SOURCE_DIR} -ctest -D ExperimentalStart -ctest -D ExperimentalBuild -V -ctest -D ExperimentalTest -j2 || true -ctest -D ExperimentalSubmit || true +ctest -S ${OPJ_SOURCE_DIR}/tools/ctest_scripts/travis-ci.cmake -V -D CTEST_BUILD_NAME:STRING=${OPJ_BUILDNAME} -D CTEST_SITE:STRING=${OPJ_SITE} -D CTEST_BUILD_CONFIGURATION:STRING=${OPJ_BUILD_CONFIGURATION} From b97aadcf3ea89952a796f1385d5a14958f102d0a Mon Sep 17 00:00:00 2001 From: mayeut Date: Sat, 12 Sep 2015 05:44:52 +0200 Subject: [PATCH 07/27] Fix travis build with make 2.8.7 --- tools/ctest_scripts/travis-ci.cmake | 21 +++++++++++++++++++-- tools/travis-ci/run.sh | 7 +++++-- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/tools/ctest_scripts/travis-ci.cmake b/tools/ctest_scripts/travis-ci.cmake index 841d926c3..8d5b92392 100644 --- a/tools/ctest_scripts/travis-ci.cmake +++ b/tools/ctest_scripts/travis-ci.cmake @@ -6,10 +6,27 @@ cmake_minimum_required(VERSION 2.8) -set(ENV{LANG} en_US.UTF-8) +set( ENV{LANG} en_US.UTF-8) set( CTEST_DASHBOARD_ROOT "$ENV{PWD}/build" ) set( CTEST_CMAKE_GENERATOR "Unix Makefiles") # Always makefile in travis-ci environment -set( BUILD_PLATFORM "x86_64" ) + +if ("$ENV{OPJ_BUILD_CONFIGURATION}" STREQUAL "") + set( CTEST_BUILD_CONFIGURATION "Release") +else() + set( CTEST_BUILD_CONFIGURATION "$ENV{OPJ_BUILD_CONFIGURATION}") +endif() + +if ("$ENV{OPJ_SITE}" STREQUAL "") + set( CTEST_SITE "Unknown") +else() + set( CTEST_SITE "$ENV{OPJ_SITE}") +endif() + +if ("$ENV{OPJ_BUILDNAME}" STREQUAL "") + set( CTEST_BUILD_NAME "Unknown-${CTEST_BUILD_CONFIGURATION}") +else() + set( CTEST_BUILD_NAME "$ENV{OPJ_BUILDNAME}") +endif() # To execute part of the encoding test suite, kakadu binaries are needed to decode encoded image and compare # it to the baseline. Kakadu binaries are freely available for non-commercial purposes diff --git a/tools/travis-ci/run.sh b/tools/travis-ci/run.sh index 58b86c1a1..75c01dc9c 100755 --- a/tools/travis-ci/run.sh +++ b/tools/travis-ci/run.sh @@ -84,7 +84,10 @@ fi set -x # This will print configuration -export OPJ_DO_SUBMIT=${OPJ_DO_SUBMIT} +export OPJ_SITE=${OPJ_SITE} +export OPJ_BUILDNAME=${OPJ_BUILDNAME} export OPJ_SOURCE_DIR=${OPJ_SOURCE_DIR} +export OPJ_BUILD_CONFIGURATION=${OPJ_BUILD_CONFIGURATION} +export OPJ_DO_SUBMIT=${OPJ_DO_SUBMIT} -ctest -S ${OPJ_SOURCE_DIR}/tools/ctest_scripts/travis-ci.cmake -V -D CTEST_BUILD_NAME:STRING=${OPJ_BUILDNAME} -D CTEST_SITE:STRING=${OPJ_SITE} -D CTEST_BUILD_CONFIGURATION:STRING=${OPJ_BUILD_CONFIGURATION} +ctest -S ${OPJ_SOURCE_DIR}/tools/ctest_scripts/travis-ci.cmake -V From cc2ae754507abe10730cde4d40af36dbb0829703 Mon Sep 17 00:00:00 2001 From: mayeut Date: Sat, 12 Sep 2015 05:50:57 +0200 Subject: [PATCH 08/27] Fix build with gcc 4.6.3 --- tools/ctest_scripts/travis-ci.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/ctest_scripts/travis-ci.cmake b/tools/ctest_scripts/travis-ci.cmake index 8d5b92392..826b0aa32 100644 --- a/tools/ctest_scripts/travis-ci.cmake +++ b/tools/ctest_scripts/travis-ci.cmake @@ -49,7 +49,7 @@ set( CACHE_CONTENTS " CMAKE_BUILD_TYPE:STRING=${CTEST_BUILD_CONFIGURATION} # Warning level -CMAKE_C_FLAGS:STRING= -Wall -Wextra -Wconversion -Wpedantic -Wno-unused-parameter -Wdeclaration-after-statement +CMAKE_C_FLAGS:STRING= -Wall -Wextra -Wconversion -Wno-unused-parameter -Wdeclaration-after-statement # Use to activate the test suite BUILD_TESTING:BOOL=TRUE From b7069ce2b2ade8a1af44dade35db81d7a08cf0fc Mon Sep 17 00:00:00 2001 From: mayeut Date: Sat, 12 Sep 2015 13:03:50 +0200 Subject: [PATCH 09/27] Download kakadu on osx --- tools/travis-ci/install.sh | 83 ++++++++++++++++++++++++-------------- 1 file changed, 52 insertions(+), 31 deletions(-) diff --git a/tools/travis-ci/install.sh b/tools/travis-ci/install.sh index 5808f2792..202be7516 100755 --- a/tools/travis-ci/install.sh +++ b/tools/travis-ci/install.sh @@ -22,37 +22,58 @@ trap exit ERR # travis-ci doesn't dump cmake version in system info, let's print it cmake --version -OPJ_SOURCE_DIR=$(cd $(dirname $0)/../.. && pwd) +# We don't need anything for coverity scan builds -# We need test data -if [ "${TRAVIS_BRANCH:-}" == "" ]; then - TRAVIS_BRANCH=$(git -C ${OPJ_SOURCE_DIR} branch | grep '*' | tr -d '*[[:blank:]]') #default to same branch as we're setting up -fi -OPJ_DATA_HAS_BRANCH=$(git ls-remote --heads git://github.com/uclouvain/openjpeg-data.git ${TRAVIS_BRANCH} | wc -l) -if [ ${OPJ_DATA_HAS_BRANCH} -ne 0 ]; then - OPJ_DATA_BRANCH=${TRAVIS_BRANCH} -else - OPJ_DATA_BRANCH=master #default to master -fi -echo "Cloning openjpeg-data from ${OPJ_DATA_BRANCH} branch" -git clone --depth=1 --branch=${OPJ_DATA_BRANCH} git://github.com/uclouvain/openjpeg-data.git data - -# We need jpylyzer for the test suite -echo "Retrieving jpylyzer" -wget -qO - https://github.com/openpreserve/jpylyzer/archive/1.14.2.tar.gz | tar -xz -mv jpylyzer-1.14.2 jpylyzer -chmod +x jpylyzer/jpylyzer/jpylyzer.py - -# When OPJ_NONCOMMERCIAL=1, kakadu trial binaries are used for testing. Here's the copyright notice from kakadu: -# Copyright is owned by NewSouth Innovations Pty Limited, commercial arm of the UNSW Australia in Sydney. -# You are free to trial these executables and even to re-distribute them, -# so long as such use or re-distribution is accompanied with this copyright notice and is not for commercial gain. -# Note: Binaries can only be used for non-commercial purposes. -if [ "${OPJ_NONCOMMERCIAL:-}" == "1" ]; then - if [ "${TRAVIS_OS_NAME:-}" == "linux" ] || uname -s | grep -i Linux &> /dev/null; then - echo "Retrieving Kakadu" - wget -q http://kakadusoftware.com/wp-content/uploads/2014/06/KDU77_Demo_Apps_for_Linux-x86-64_150710.zip - cmake -E tar -xf KDU77_Demo_Apps_for_Linux-x86-64_150710.zip - mv KDU77_Demo_Apps_for_Linux-x86-64_150710 kdu +if [ "${COVERITY_SCAN_BRANCH:-}" != 1 ]; then + + OPJ_SOURCE_DIR=$(cd $(dirname $0)/../.. && pwd) + + # We need test data + if [ "${TRAVIS_BRANCH:-}" == "" ]; then + TRAVIS_BRANCH=$(git -C ${OPJ_SOURCE_DIR} branch | grep '*' | tr -d '*[[:blank:]]') #default to same branch as we're setting up + fi + OPJ_DATA_HAS_BRANCH=$(git ls-remote --heads git://github.com/uclouvain/openjpeg-data.git ${TRAVIS_BRANCH} | wc -l) + if [ ${OPJ_DATA_HAS_BRANCH} -ne 0 ]; then + OPJ_DATA_BRANCH=${TRAVIS_BRANCH} + else + OPJ_DATA_BRANCH=master #default to master + fi + echo "Cloning openjpeg-data from ${OPJ_DATA_BRANCH} branch" + git clone --depth=1 --branch=${OPJ_DATA_BRANCH} git://github.com/uclouvain/openjpeg-data.git data + + # We need jpylyzer for the test suite + echo "Retrieving jpylyzer" + wget -qO - https://github.com/openpreserve/jpylyzer/archive/1.14.2.tar.gz | tar -xz + mv jpylyzer-1.14.2 jpylyzer + chmod +x jpylyzer/jpylyzer/jpylyzer.py + + # When OPJ_NONCOMMERCIAL=1, kakadu trial binaries are used for testing. Here's the copyright notice from kakadu: + # Copyright is owned by NewSouth Innovations Pty Limited, commercial arm of the UNSW Australia in Sydney. + # You are free to trial these executables and even to re-distribute them, + # so long as such use or re-distribution is accompanied with this copyright notice and is not for commercial gain. + # Note: Binaries can only be used for non-commercial purposes. + if [ "${OPJ_NONCOMMERCIAL:-}" == "1" ]; then + if [ "${TRAVIS_OS_NAME:-}" == "linux" ] || uname -s | grep -i Linux &> /dev/null; then + echo "Retrieving Kakadu" + wget -q http://kakadusoftware.com/wp-content/uploads/2014/06/KDU77_Demo_Apps_for_Linux-x86-64_150710.zip + cmake -E tar -xf KDU77_Demo_Apps_for_Linux-x86-64_150710.zip + mv KDU77_Demo_Apps_for_Linux-x86-64_150710 kdu + elif [ "${TRAVIS_OS_NAME:-}" == "osx" ] || uname -s | grep -i Darwin &> /dev/null; then + echo "Retrieving Kakadu" + wget -q http://kakadusoftware.com/wp-content/uploads/2014/06/KDU77_Demo_Apps_for_OSX109_150710.dmg_.zip + cmake -E tar -xf KDU77_Demo_Apps_for_OSX109_150710.dmg_.zip + wget -q http://downloads.sourceforge.net/project/catacombae/HFSExplorer/0.23/hfsexplorer-0.23-bin.zip + mkdir hfsexplorer && cmake -E chdir hfsexplorer tar -xf ../hfsexplorer-0.23-bin.zip + ./hfsexplorer/bin/unhfs.sh -o ./ -fsroot Kakadu-demo-apps.pkg KDU77_Demo_Apps_for_OSX109_150710.dmg + pkgutil --expand Kakadu-demo-apps.pkg ./kdu + cd kdu + cat libkduv77r.pkg/Payload | gzip -d | cpio -id + cat kduexpand.pkg/Payload | gzip -d | cpio -id + cat kducompress.pkg/Payload | gzip -d | cpio -id + install_name_tool -id ${PWD}/libkdu_v77R.dylib libkdu_v77R.dylib + install_name_tool -change /usr/local/lib/libkdu_v77R.dylib ${PWD}/libkdu_v77R.dylib kdu_compress + install_name_tool -change /usr/local/lib/libkdu_v77R.dylib ${PWD}/libkdu_v77R.dylib kdu_expand + fi fi fi + From 52c36b495597b8d07d39d070dd521ca4118113bd Mon Sep 17 00:00:00 2001 From: mayeut Date: Sat, 12 Sep 2015 15:48:23 +0200 Subject: [PATCH 10/27] Add 32 bit build --- .travis.yml | 10 ++++++++++ tools/ctest_scripts/travis-ci.cmake | 14 +++++++++++++- tools/travis-ci/install.sh | 7 ++----- tools/travis-ci/run.sh | 20 ++++++++++++++++---- 4 files changed, 41 insertions(+), 10 deletions(-) diff --git a/.travis.yml b/.travis.yml index 93c970d9b..c9b5282a5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,11 +5,21 @@ os: compiler: - gcc - clang +env: + - OPJ_CI_ARCH=x86_64 + - OPJ_CI_ARCH=i386 matrix: exclude: - os: osx compiler: gcc + - compiler: clang + env: OPJ_CI_ARCH=x86 + +addons: + apt: + packages: + - gcc-multilib install: - ./tools/travis-ci/install.sh diff --git a/tools/ctest_scripts/travis-ci.cmake b/tools/ctest_scripts/travis-ci.cmake index 826b0aa32..7c1c25ff1 100644 --- a/tools/ctest_scripts/travis-ci.cmake +++ b/tools/ctest_scripts/travis-ci.cmake @@ -28,6 +28,18 @@ else() set( CTEST_BUILD_NAME "$ENV{OPJ_BUILDNAME}") endif() +if (NOT "$ENV{OPJ_CI_ARCH}" STREQUAL "") + if (APPLE) + set(CCFLAGS_ARCH "-arch $ENV{OPJ_CI_ARCH}") + else() + if ("$ENV{OPJ_CI_ARCH}" MATCHES "^i[3-6]86$") + set(CCFLAGS_ARCH "-m32 -march=$ENV{OPJ_CI_ARCH}") + elseif ("$ENV{OPJ_CI_ARCH}" STREQUAL "x86_64") + set(CCFLAGS_ARCH "-m64") + endif() + endif() +endif() + # To execute part of the encoding test suite, kakadu binaries are needed to decode encoded image and compare # it to the baseline. Kakadu binaries are freely available for non-commercial purposes # at http://www.kakadusoftware.com. @@ -49,7 +61,7 @@ set( CACHE_CONTENTS " CMAKE_BUILD_TYPE:STRING=${CTEST_BUILD_CONFIGURATION} # Warning level -CMAKE_C_FLAGS:STRING= -Wall -Wextra -Wconversion -Wno-unused-parameter -Wdeclaration-after-statement +CMAKE_C_FLAGS:STRING= ${CCFLAGS_ARCH} -Wall -Wextra -Wconversion -Wno-unused-parameter -Wdeclaration-after-statement # Use to activate the test suite BUILD_TESTING:BOOL=TRUE diff --git a/tools/travis-ci/install.sh b/tools/travis-ci/install.sh index 202be7516..ceb77b8ac 100755 --- a/tools/travis-ci/install.sh +++ b/tools/travis-ci/install.sh @@ -17,14 +17,11 @@ function exit_handler () exit "${exit_code}" } trap exit_handler EXIT -trap exit ERR - -# travis-ci doesn't dump cmake version in system info, let's print it -cmake --version +trap exit ERR # We don't need anything for coverity scan builds -if [ "${COVERITY_SCAN_BRANCH:-}" != 1 ]; then +if [ "${COVERITY_SCAN_BRANCH:-}" != "1" ] && [ "${OPJ_CI_SKIP_TESTS:-}" != "1" ]; then OPJ_SOURCE_DIR=$(cd $(dirname $0)/../.. && pwd) diff --git a/tools/travis-ci/run.sh b/tools/travis-ci/run.sh index 75c01dc9c..7fdaec726 100755 --- a/tools/travis-ci/run.sh +++ b/tools/travis-ci/run.sh @@ -55,10 +55,19 @@ elif [ "${TRAVIS_OS_NAME}" == "linux" ]; then elif [ "${CC}" == "clang" ]; then OPJ_CC_VERSION=clang$(${CC} --version | grep version | sed 's/.*version \([^0-9.]*[0-9.]*\).*/\1/') else - echo "Compiler not supported: ${CC}" + echo "Compiler not supported: ${CC}"; exit 1 fi else - echo "OS not supported: ${TRAVIS_OS_NAME}" + echo "OS not supported: ${TRAVIS_OS_NAME}"; exit 1 +fi + +if [ "${OPJ_CI_ARCH:-}" == "" ]; then + echo "Guessing build architecture" + MACHINE_ARCH=$(uname -m) + if [ "${MACHINE_ARCH}" == "x86_64" ]; then + export OPJ_CI_ARCH=x86_64 + fi + echo "${OPJ_CI_ARCH}" fi if [ "${TRAVIS_BRANCH:-}" == "" ]; then @@ -66,13 +75,13 @@ if [ "${TRAVIS_BRANCH:-}" == "" ]; then TRAVIS_BRANCH=$(git -C ${OPJ_SOURCE_DIR} branch | grep '*' | tr -d '*[[:blank:]]') #default to master fi -OPJ_BUILDNAME=${OPJ_OS_NAME}-${OPJ_CC_VERSION}-x86_64-${TRAVIS_BRANCH} +OPJ_BUILDNAME=${OPJ_OS_NAME}-${OPJ_CC_VERSION}-${OPJ_CI_ARCH}-${TRAVIS_BRANCH} if [ "${TRAVIS_PULL_REQUEST:-}" != "false" ] && [ "${TRAVIS_PULL_REQUEST:-}" != "" ]; then OPJ_BUILDNAME=${OPJ_BUILDNAME}-pr${TRAVIS_PULL_REQUEST} fi OPJ_BUILDNAME=${OPJ_BUILDNAME}-${OPJ_BUILD_CONFIGURATION}-3rdP -if [ "${OPJ_NONCOMMERCIAL:-}" == "1" ] && [ -d kdu ]; then +if [ "${OPJ_NONCOMMERCIAL:-}" == "1" ] && [ "${OPJ_CI_SKIP_TESTS:-}" != "1" ] && [ -d kdu ]; then echo " Testing will use Kakadu trial binaries. Here's the copyright notice from kakadu: Copyright is owned by NewSouth Innovations Pty Limited, commercial arm of the UNSW Australia in Sydney. @@ -84,6 +93,9 @@ fi set -x # This will print configuration +# travis-ci doesn't dump cmake version in system info, let's print it +cmake --version + export OPJ_SITE=${OPJ_SITE} export OPJ_BUILDNAME=${OPJ_BUILDNAME} export OPJ_SOURCE_DIR=${OPJ_SOURCE_DIR} From 82c238f50455a4caf835222c3b246a4091df9310 Mon Sep 17 00:00:00 2001 From: mayeut Date: Sat, 12 Sep 2015 15:52:13 +0200 Subject: [PATCH 11/27] Fix OPJ_CI_SKIP_TESTS --- .travis.yml | 2 +- tools/ctest_scripts/travis-ci.cmake | 38 +++++++++++++++++------------ 2 files changed, 23 insertions(+), 17 deletions(-) diff --git a/.travis.yml b/.travis.yml index c9b5282a5..6fd10240f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,7 +14,7 @@ matrix: - os: osx compiler: gcc - compiler: clang - env: OPJ_CI_ARCH=x86 + env: OPJ_CI_ARCH=i386 addons: apt: diff --git a/tools/ctest_scripts/travis-ci.cmake b/tools/ctest_scripts/travis-ci.cmake index 7c1c25ff1..4e6c50df2 100644 --- a/tools/ctest_scripts/travis-ci.cmake +++ b/tools/ctest_scripts/travis-ci.cmake @@ -40,19 +40,24 @@ if (NOT "$ENV{OPJ_CI_ARCH}" STREQUAL "") endif() endif() -# To execute part of the encoding test suite, kakadu binaries are needed to decode encoded image and compare -# it to the baseline. Kakadu binaries are freely available for non-commercial purposes -# at http://www.kakadusoftware.com. -# Here's the copyright notice from kakadu: -# Copyright is owned by NewSouth Innovations Pty Limited, commercial arm of the UNSW Australia in Sydney. -# You are free to trial these executables and even to re-distribute them, -# so long as such use or re-distribution is accompanied with this copyright notice and is not for commercial gain. -# Note: Binaries can only be used for non-commercial purposes. -if ("$ENV{OPJ_NONCOMMERCIAL}" STREQUAL "1") - set(KDUPATH $ENV{PWD}/kdu) - set(ENV{LD_LIBRARY_PATH} ${KDUPATH}) - set(ENV{PATH} $ENV{PATH}:${KDUPATH}) -endif() +if(NOT "$ENV{OPJ_CI_SKIP_TESTS}" STREQUAL "1") + # To execute part of the encoding test suite, kakadu binaries are needed to decode encoded image and compare + # it to the baseline. Kakadu binaries are freely available for non-commercial purposes + # at http://www.kakadusoftware.com. + # Here's the copyright notice from kakadu: + # Copyright is owned by NewSouth Innovations Pty Limited, commercial arm of the UNSW Australia in Sydney. + # You are free to trial these executables and even to re-distribute them, + # so long as such use or re-distribution is accompanied with this copyright notice and is not for commercial gain. + # Note: Binaries can only be used for non-commercial purposes. + if ("$ENV{OPJ_NONCOMMERCIAL}" STREQUAL "1" ) + set(KDUPATH $ENV{PWD}/kdu) + set(ENV{LD_LIBRARY_PATH} ${KDUPATH}) + set(ENV{PATH} $ENV{PATH}:${KDUPATH}) + endif() + set(BUILD_TESTING "TRUE") +else() + set(BUILD_TESTING "FALSE") +endif(NOT "$ENV{OPJ_CI_SKIP_TESTS}" STREQUAL "1") # Options set( CACHE_CONTENTS " @@ -64,7 +69,7 @@ CMAKE_BUILD_TYPE:STRING=${CTEST_BUILD_CONFIGURATION} CMAKE_C_FLAGS:STRING= ${CCFLAGS_ARCH} -Wall -Wextra -Wconversion -Wno-unused-parameter -Wdeclaration-after-statement # Use to activate the test suite -BUILD_TESTING:BOOL=TRUE +BUILD_TESTING:BOOL=${BUILD_TESTING} # Build Thirdparty, useful but not required for test suite BUILD_THIRDPARTY:BOOL=TRUE @@ -101,8 +106,9 @@ ctest_start(Experimental) ctest_configure(BUILD "${CTEST_BINARY_DIRECTORY}") ctest_read_custom_files(${CTEST_BINARY_DIRECTORY}) ctest_build(BUILD "${CTEST_BINARY_DIRECTORY}") -ctest_test(BUILD "${CTEST_BINARY_DIRECTORY}" PARALLEL_LEVEL 2) - +if(NOT "$ENV{OPJ_CI_SKIP_TESTS}" STREQUAL "1") + ctest_test(BUILD "${CTEST_BINARY_DIRECTORY}" PARALLEL_LEVEL 2) +endif() if ("$ENV{OPJ_DO_SUBMIT}" STREQUAL "1") ctest_submit() endif() From 41730e8cc6bc522a41f548f12e5a0ef88f2c451b Mon Sep 17 00:00:00 2001 From: mayeut Date: Sat, 12 Sep 2015 16:11:56 +0200 Subject: [PATCH 12/27] Travis add debug config --- .travis.yml | 6 ++++++ tools/travis-ci/run.sh | 8 +++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 6fd10240f..3b37fc0e3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,6 +8,8 @@ compiler: env: - OPJ_CI_ARCH=x86_64 - OPJ_CI_ARCH=i386 + - OPJ_CI_BUILD_CONFIGURATION=Release + - OPJ_CI_BUILD_CONFIGURATION=Debug matrix: exclude: @@ -15,6 +17,10 @@ matrix: compiler: gcc - compiler: clang env: OPJ_CI_ARCH=i386 + - compiler: gcc + env: OPJ_CI_BUILD_CONFIGURATION=Debug + - os: osx + env: OPJ_CI_BUILD_CONFIGURATION=Debug addons: apt: diff --git a/tools/travis-ci/run.sh b/tools/travis-ci/run.sh index 7fdaec726..d1fae91fb 100755 --- a/tools/travis-ci/run.sh +++ b/tools/travis-ci/run.sh @@ -8,7 +8,9 @@ set -o errexit ## set -e : exit the script if any statement returns a non-true set -o pipefail ## Fail on error in pipe # Set-up some variables -OPJ_BUILD_CONFIGURATION=Release +if [ "${OPJ_CI_BUILD_CONFIGURATION:-}" == "" ]; then + export OPJ_CI_BUILD_CONFIGURATION=Release #default +fi OPJ_SOURCE_DIR=$(cd $(dirname $0)/../.. && pwd) if [ "${OPJ_DO_SUBMIT:-}" == "" ]; then @@ -79,7 +81,7 @@ OPJ_BUILDNAME=${OPJ_OS_NAME}-${OPJ_CC_VERSION}-${OPJ_CI_ARCH}-${TRAVIS_BRANCH} if [ "${TRAVIS_PULL_REQUEST:-}" != "false" ] && [ "${TRAVIS_PULL_REQUEST:-}" != "" ]; then OPJ_BUILDNAME=${OPJ_BUILDNAME}-pr${TRAVIS_PULL_REQUEST} fi -OPJ_BUILDNAME=${OPJ_BUILDNAME}-${OPJ_BUILD_CONFIGURATION}-3rdP +OPJ_BUILDNAME=${OPJ_BUILDNAME}-${OPJ_CI_BUILD_CONFIGURATION}-3rdP if [ "${OPJ_NONCOMMERCIAL:-}" == "1" ] && [ "${OPJ_CI_SKIP_TESTS:-}" != "1" ] && [ -d kdu ]; then echo " @@ -99,7 +101,7 @@ cmake --version export OPJ_SITE=${OPJ_SITE} export OPJ_BUILDNAME=${OPJ_BUILDNAME} export OPJ_SOURCE_DIR=${OPJ_SOURCE_DIR} -export OPJ_BUILD_CONFIGURATION=${OPJ_BUILD_CONFIGURATION} +export OPJ_BUILD_CONFIGURATION=${OPJ_CI_BUILD_CONFIGURATION} export OPJ_DO_SUBMIT=${OPJ_DO_SUBMIT} ctest -S ${OPJ_SOURCE_DIR}/tools/ctest_scripts/travis-ci.cmake -V From 4f157f3cf00b14875c219f62a8c91bb3bab3977d Mon Sep 17 00:00:00 2001 From: mayeut Date: Sat, 12 Sep 2015 16:16:19 +0200 Subject: [PATCH 13/27] Fix matrix for debug build --- .travis.yml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3b37fc0e3..afca88876 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,21 +6,20 @@ compiler: - gcc - clang env: - - OPJ_CI_ARCH=x86_64 - - OPJ_CI_ARCH=i386 - - OPJ_CI_BUILD_CONFIGURATION=Release - - OPJ_CI_BUILD_CONFIGURATION=Debug + - OPJ_CI_ARCH=x86_64 OPJ_CI_BUILD_CONFIGURATION=Release + - OPJ_CI_ARCH=i386 OPJ_CI_BUILD_CONFIGURATION=Release + - OPJ_CI_ARCH=x86_64 OPJ_CI_BUILD_CONFIGURATION=Debug matrix: exclude: - os: osx compiler: gcc - compiler: clang - env: OPJ_CI_ARCH=i386 + env: OPJ_CI_ARCH=i386 OPJ_CI_BUILD_CONFIGURATION=Release - compiler: gcc - env: OPJ_CI_BUILD_CONFIGURATION=Debug + env: OPJ_CI_ARCH=x86_64 OPJ_CI_BUILD_CONFIGURATION=Debug - os: osx - env: OPJ_CI_BUILD_CONFIGURATION=Debug + env: OPJ_CI_ARCH=x86_64 OPJ_CI_BUILD_CONFIGURATION=Debug addons: apt: From fc131a1339fb9370f7bda8b68a1f4221d92dc6ad Mon Sep 17 00:00:00 2001 From: mayeut Date: Sat, 12 Sep 2015 16:36:19 +0200 Subject: [PATCH 14/27] Travis ASan build --- tools/ctest_scripts/travis-ci.cmake | 10 +++ tools/travis-ci/install.sh | 101 +++++++++++++++------------- tools/travis-ci/run.sh | 7 ++ 3 files changed, 72 insertions(+), 46 deletions(-) diff --git a/tools/ctest_scripts/travis-ci.cmake b/tools/ctest_scripts/travis-ci.cmake index 4e6c50df2..36596a09c 100644 --- a/tools/ctest_scripts/travis-ci.cmake +++ b/tools/ctest_scripts/travis-ci.cmake @@ -40,6 +40,13 @@ if (NOT "$ENV{OPJ_CI_ARCH}" STREQUAL "") endif() endif() +if ("$ENV{OPJ_CI_ASAN}" STREQUAL "1") + set(OPJ_HAS_MEMCHECK TRUE) + set(CTEST_MEMORYCHECK_TYPE "AddressSanitizer") + set(CCFLAGS_ARCH "${CCFLAGS_ARCH} -g -fsanitize=address -fno-omit-frame-pointer") + +endif() + if(NOT "$ENV{OPJ_CI_SKIP_TESTS}" STREQUAL "1") # To execute part of the encoding test suite, kakadu binaries are needed to decode encoded image and compare # it to the baseline. Kakadu binaries are freely available for non-commercial purposes @@ -108,6 +115,9 @@ ctest_read_custom_files(${CTEST_BINARY_DIRECTORY}) ctest_build(BUILD "${CTEST_BINARY_DIRECTORY}") if(NOT "$ENV{OPJ_CI_SKIP_TESTS}" STREQUAL "1") ctest_test(BUILD "${CTEST_BINARY_DIRECTORY}" PARALLEL_LEVEL 2) + if(OPJ_HAS_MEMCHECK) + ctest_memcheck(BUILD "${CTEST_BINARY_DIRECTORY}" PARALLEL_LEVEL 2) + endif() endif() if ("$ENV{OPJ_DO_SUBMIT}" STREQUAL "1") ctest_submit() diff --git a/tools/travis-ci/install.sh b/tools/travis-ci/install.sh index ceb77b8ac..11dcf26cb 100755 --- a/tools/travis-ci/install.sh +++ b/tools/travis-ci/install.sh @@ -21,56 +21,65 @@ trap exit ERR # We don't need anything for coverity scan builds -if [ "${COVERITY_SCAN_BRANCH:-}" != "1" ] && [ "${OPJ_CI_SKIP_TESTS:-}" != "1" ]; then +if [ "${COVERITY_SCAN_BRANCH:-}" != "1" ]; then - OPJ_SOURCE_DIR=$(cd $(dirname $0)/../.. && pwd) - - # We need test data - if [ "${TRAVIS_BRANCH:-}" == "" ]; then - TRAVIS_BRANCH=$(git -C ${OPJ_SOURCE_DIR} branch | grep '*' | tr -d '*[[:blank:]]') #default to same branch as we're setting up - fi - OPJ_DATA_HAS_BRANCH=$(git ls-remote --heads git://github.com/uclouvain/openjpeg-data.git ${TRAVIS_BRANCH} | wc -l) - if [ ${OPJ_DATA_HAS_BRANCH} -ne 0 ]; then - OPJ_DATA_BRANCH=${TRAVIS_BRANCH} - else - OPJ_DATA_BRANCH=master #default to master + if [ "${OPJ_CI_ASAN:-}" == "1" ]; then + # We need a new version of cmake than travis-ci provides + wget -qO - http://www.cmake.org/files/v3.3/cmake-3.3.1-Linux-x86_64.tar.gz | tar -xz + # copy to a directory that will not changed every version + mv cmake-3.3.1-Linux-x86_64 cmake-install fi - echo "Cloning openjpeg-data from ${OPJ_DATA_BRANCH} branch" - git clone --depth=1 --branch=${OPJ_DATA_BRANCH} git://github.com/uclouvain/openjpeg-data.git data - # We need jpylyzer for the test suite - echo "Retrieving jpylyzer" - wget -qO - https://github.com/openpreserve/jpylyzer/archive/1.14.2.tar.gz | tar -xz - mv jpylyzer-1.14.2 jpylyzer - chmod +x jpylyzer/jpylyzer/jpylyzer.py + if [ "${OPJ_CI_SKIP_TESTS:-}" != "1" ]; then + + OPJ_SOURCE_DIR=$(cd $(dirname $0)/../.. && pwd) + + # We need test data + if [ "${TRAVIS_BRANCH:-}" == "" ]; then + TRAVIS_BRANCH=$(git -C ${OPJ_SOURCE_DIR} branch | grep '*' | tr -d '*[[:blank:]]') #default to same branch as we're setting up + fi + OPJ_DATA_HAS_BRANCH=$(git ls-remote --heads git://github.com/uclouvain/openjpeg-data.git ${TRAVIS_BRANCH} | wc -l) + if [ ${OPJ_DATA_HAS_BRANCH} -ne 0 ]; then + OPJ_DATA_BRANCH=${TRAVIS_BRANCH} + else + OPJ_DATA_BRANCH=master #default to master + fi + echo "Cloning openjpeg-data from ${OPJ_DATA_BRANCH} branch" + git clone --depth=1 --branch=${OPJ_DATA_BRANCH} git://github.com/uclouvain/openjpeg-data.git data - # When OPJ_NONCOMMERCIAL=1, kakadu trial binaries are used for testing. Here's the copyright notice from kakadu: - # Copyright is owned by NewSouth Innovations Pty Limited, commercial arm of the UNSW Australia in Sydney. - # You are free to trial these executables and even to re-distribute them, - # so long as such use or re-distribution is accompanied with this copyright notice and is not for commercial gain. - # Note: Binaries can only be used for non-commercial purposes. - if [ "${OPJ_NONCOMMERCIAL:-}" == "1" ]; then - if [ "${TRAVIS_OS_NAME:-}" == "linux" ] || uname -s | grep -i Linux &> /dev/null; then - echo "Retrieving Kakadu" - wget -q http://kakadusoftware.com/wp-content/uploads/2014/06/KDU77_Demo_Apps_for_Linux-x86-64_150710.zip - cmake -E tar -xf KDU77_Demo_Apps_for_Linux-x86-64_150710.zip - mv KDU77_Demo_Apps_for_Linux-x86-64_150710 kdu - elif [ "${TRAVIS_OS_NAME:-}" == "osx" ] || uname -s | grep -i Darwin &> /dev/null; then - echo "Retrieving Kakadu" - wget -q http://kakadusoftware.com/wp-content/uploads/2014/06/KDU77_Demo_Apps_for_OSX109_150710.dmg_.zip - cmake -E tar -xf KDU77_Demo_Apps_for_OSX109_150710.dmg_.zip - wget -q http://downloads.sourceforge.net/project/catacombae/HFSExplorer/0.23/hfsexplorer-0.23-bin.zip - mkdir hfsexplorer && cmake -E chdir hfsexplorer tar -xf ../hfsexplorer-0.23-bin.zip - ./hfsexplorer/bin/unhfs.sh -o ./ -fsroot Kakadu-demo-apps.pkg KDU77_Demo_Apps_for_OSX109_150710.dmg - pkgutil --expand Kakadu-demo-apps.pkg ./kdu - cd kdu - cat libkduv77r.pkg/Payload | gzip -d | cpio -id - cat kduexpand.pkg/Payload | gzip -d | cpio -id - cat kducompress.pkg/Payload | gzip -d | cpio -id - install_name_tool -id ${PWD}/libkdu_v77R.dylib libkdu_v77R.dylib - install_name_tool -change /usr/local/lib/libkdu_v77R.dylib ${PWD}/libkdu_v77R.dylib kdu_compress - install_name_tool -change /usr/local/lib/libkdu_v77R.dylib ${PWD}/libkdu_v77R.dylib kdu_expand + # We need jpylyzer for the test suite + echo "Retrieving jpylyzer" + wget -qO - https://github.com/openpreserve/jpylyzer/archive/1.14.2.tar.gz | tar -xz + mv jpylyzer-1.14.2 jpylyzer + chmod +x jpylyzer/jpylyzer/jpylyzer.py + + # When OPJ_NONCOMMERCIAL=1, kakadu trial binaries are used for testing. Here's the copyright notice from kakadu: + # Copyright is owned by NewSouth Innovations Pty Limited, commercial arm of the UNSW Australia in Sydney. + # You are free to trial these executables and even to re-distribute them, + # so long as such use or re-distribution is accompanied with this copyright notice and is not for commercial gain. + # Note: Binaries can only be used for non-commercial purposes. + if [ "${OPJ_NONCOMMERCIAL:-}" == "1" ]; then + if [ "${TRAVIS_OS_NAME:-}" == "linux" ] || uname -s | grep -i Linux &> /dev/null; then + echo "Retrieving Kakadu" + wget -q http://kakadusoftware.com/wp-content/uploads/2014/06/KDU77_Demo_Apps_for_Linux-x86-64_150710.zip + cmake -E tar -xf KDU77_Demo_Apps_for_Linux-x86-64_150710.zip + mv KDU77_Demo_Apps_for_Linux-x86-64_150710 kdu + elif [ "${TRAVIS_OS_NAME:-}" == "osx" ] || uname -s | grep -i Darwin &> /dev/null; then + echo "Retrieving Kakadu" + wget -q http://kakadusoftware.com/wp-content/uploads/2014/06/KDU77_Demo_Apps_for_OSX109_150710.dmg_.zip + cmake -E tar -xf KDU77_Demo_Apps_for_OSX109_150710.dmg_.zip + wget -q http://downloads.sourceforge.net/project/catacombae/HFSExplorer/0.23/hfsexplorer-0.23-bin.zip + mkdir hfsexplorer && cmake -E chdir hfsexplorer tar -xf ../hfsexplorer-0.23-bin.zip + ./hfsexplorer/bin/unhfs.sh -o ./ -fsroot Kakadu-demo-apps.pkg KDU77_Demo_Apps_for_OSX109_150710.dmg + pkgutil --expand Kakadu-demo-apps.pkg ./kdu + cd kdu + cat libkduv77r.pkg/Payload | gzip -d | cpio -id + cat kduexpand.pkg/Payload | gzip -d | cpio -id + cat kducompress.pkg/Payload | gzip -d | cpio -id + install_name_tool -id ${PWD}/libkdu_v77R.dylib libkdu_v77R.dylib + install_name_tool -change /usr/local/lib/libkdu_v77R.dylib ${PWD}/libkdu_v77R.dylib kdu_compress + install_name_tool -change /usr/local/lib/libkdu_v77R.dylib ${PWD}/libkdu_v77R.dylib kdu_expand + fi fi fi fi - diff --git a/tools/travis-ci/run.sh b/tools/travis-ci/run.sh index d1fae91fb..67bf9af15 100755 --- a/tools/travis-ci/run.sh +++ b/tools/travis-ci/run.sh @@ -82,6 +82,9 @@ if [ "${TRAVIS_PULL_REQUEST:-}" != "false" ] && [ "${TRAVIS_PULL_REQUEST:-}" != OPJ_BUILDNAME=${OPJ_BUILDNAME}-pr${TRAVIS_PULL_REQUEST} fi OPJ_BUILDNAME=${OPJ_BUILDNAME}-${OPJ_CI_BUILD_CONFIGURATION}-3rdP +if [ "${OPJ_CI_ASAN:-}" == "1" ]; then + OPJ_BUILDNAME=${OPJ_BUILDNAME}-ASan +fi if [ "${OPJ_NONCOMMERCIAL:-}" == "1" ] && [ "${OPJ_CI_SKIP_TESTS:-}" != "1" ] && [ -d kdu ]; then echo " @@ -93,6 +96,10 @@ Note: Binaries can only be used for non-commercial purposes. " fi +if [ -d cmake-install ]; then + export PATH=${PWD}/cmake-install/bin:${PATH} +fi + set -x # This will print configuration # travis-ci doesn't dump cmake version in system info, let's print it From 6c157b60f2478f2b6776e5a94495103f46d9d500 Mon Sep 17 00:00:00 2001 From: mayeut Date: Sat, 12 Sep 2015 16:37:47 +0200 Subject: [PATCH 15/27] Fix Travis ASan build --- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index afca88876..b1fe283d3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,7 +8,7 @@ compiler: env: - OPJ_CI_ARCH=x86_64 OPJ_CI_BUILD_CONFIGURATION=Release - OPJ_CI_ARCH=i386 OPJ_CI_BUILD_CONFIGURATION=Release - - OPJ_CI_ARCH=x86_64 OPJ_CI_BUILD_CONFIGURATION=Debug + - OPJ_CI_ARCH=x86_64 OPJ_CI_BUILD_CONFIGURATION=Debug OPJ_CI_ASAN=1 matrix: exclude: @@ -17,9 +17,9 @@ matrix: - compiler: clang env: OPJ_CI_ARCH=i386 OPJ_CI_BUILD_CONFIGURATION=Release - compiler: gcc - env: OPJ_CI_ARCH=x86_64 OPJ_CI_BUILD_CONFIGURATION=Debug + env: OPJ_CI_ARCH=x86_64 OPJ_CI_BUILD_CONFIGURATION=Debug OPJ_CI_ASAN=1 - os: osx - env: OPJ_CI_ARCH=x86_64 OPJ_CI_BUILD_CONFIGURATION=Debug + env: OPJ_CI_ARCH=x86_64 OPJ_CI_BUILD_CONFIGURATION=Debug OPJ_CI_ASAN=1 addons: apt: From cde7423958e9c233233c79399553787cf0931714 Mon Sep 17 00:00:00 2001 From: mayeut Date: Sat, 12 Sep 2015 17:56:29 +0200 Subject: [PATCH 16/27] Travis add mingw --- .travis.yml | 6 +++++ tools/ctest_scripts/toolchain-mingw64.cmake | 26 +++++++++++++++++++++ tools/ctest_scripts/travis-ci.cmake | 10 +++++--- tools/travis-ci/run.sh | 13 ++++++++--- 4 files changed, 49 insertions(+), 6 deletions(-) create mode 100644 tools/ctest_scripts/toolchain-mingw64.cmake diff --git a/.travis.yml b/.travis.yml index b1fe283d3..ff334917d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,6 +5,7 @@ os: compiler: - gcc - clang + - x86_64-w64-mingw32-gcc env: - OPJ_CI_ARCH=x86_64 OPJ_CI_BUILD_CONFIGURATION=Release - OPJ_CI_ARCH=i386 OPJ_CI_BUILD_CONFIGURATION=Release @@ -14,10 +15,14 @@ matrix: exclude: - os: osx compiler: gcc + - os: osx + compiler: x86_64-w64-mingw32-gcc - compiler: clang env: OPJ_CI_ARCH=i386 OPJ_CI_BUILD_CONFIGURATION=Release - compiler: gcc env: OPJ_CI_ARCH=x86_64 OPJ_CI_BUILD_CONFIGURATION=Debug OPJ_CI_ASAN=1 + - compiler: x86_64-w64-mingw32-gcc + env: OPJ_CI_ARCH=x86_64 OPJ_CI_BUILD_CONFIGURATION=Debug OPJ_CI_ASAN=1 - os: osx env: OPJ_CI_ARCH=x86_64 OPJ_CI_BUILD_CONFIGURATION=Debug OPJ_CI_ASAN=1 @@ -25,6 +30,7 @@ addons: apt: packages: - gcc-multilib + - mingw-w64 install: - ./tools/travis-ci/install.sh diff --git a/tools/ctest_scripts/toolchain-mingw64.cmake b/tools/ctest_scripts/toolchain-mingw64.cmake new file mode 100644 index 000000000..5fe1507fd --- /dev/null +++ b/tools/ctest_scripts/toolchain-mingw64.cmake @@ -0,0 +1,26 @@ +# http://www.cmake.org/Wiki/CmakeMingw +# +# Copyright (c) 2006-2014 Mathieu Malaterre +# +# Redistribution and use is allowed according to the terms of the New +# BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. +# + +# the name of the target operating system +set(CMAKE_SYSTEM_NAME Windows) + +# which compilers to use for C and C++ +set(CMAKE_C_COMPILER x86_64-w64-mingw32-gcc) +set(CMAKE_CXX_COMPILER x86_64-w64-mingw32-g++) +set(CMAKE_RC_COMPILER x86_64-w64-mingw32-windres) + +# here is the target environment located +set(CMAKE_FIND_ROOT_PATH /usr/x86_64-w64-mingw32) + +# adjust the default behaviour of the FIND_XXX() commands: +# search headers and libraries in the target environment, search +# programs in the host environment +set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) +set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) +set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) diff --git a/tools/ctest_scripts/travis-ci.cmake b/tools/ctest_scripts/travis-ci.cmake index 36596a09c..371235a41 100644 --- a/tools/ctest_scripts/travis-ci.cmake +++ b/tools/ctest_scripts/travis-ci.cmake @@ -44,7 +44,11 @@ if ("$ENV{OPJ_CI_ASAN}" STREQUAL "1") set(OPJ_HAS_MEMCHECK TRUE) set(CTEST_MEMORYCHECK_TYPE "AddressSanitizer") set(CCFLAGS_ARCH "${CCFLAGS_ARCH} -g -fsanitize=address -fno-omit-frame-pointer") - +endif() + +if("$ENV{CC}" MATCHES ".*mingw.*") + # We are trying to use mingw + set(CTEST_CONFIGURE_OPTIONS "-DCMAKE_TOOLCHAIN_FILE=${CTEST_SCRIPT_DIRECTORY}/toolchain-mingw64.cmake") endif() if(NOT "$ENV{OPJ_CI_SKIP_TESTS}" STREQUAL "1") @@ -110,7 +114,7 @@ file(WRITE "${CTEST_BINARY_DIRECTORY}/CMakeCache.txt" "${CACHE_CONTENTS}") # Perform a Experimental build ctest_start(Experimental) #ctest_update(SOURCE "${CTEST_SOURCE_DIRECTORY}") -ctest_configure(BUILD "${CTEST_BINARY_DIRECTORY}") +ctest_configure(BUILD "${CTEST_BINARY_DIRECTORY}" OPTIONS "${CTEST_CONFIGURE_OPTIONS}") ctest_read_custom_files(${CTEST_BINARY_DIRECTORY}) ctest_build(BUILD "${CTEST_BINARY_DIRECTORY}") if(NOT "$ENV{OPJ_CI_SKIP_TESTS}" STREQUAL "1") @@ -122,4 +126,4 @@ endif() if ("$ENV{OPJ_DO_SUBMIT}" STREQUAL "1") ctest_submit() endif() -ctest_empty_binary_directory( "${CTEST_BINARY_DIRECTORY}" ) +#ctest_empty_binary_directory( "${CTEST_BINARY_DIRECTORY}" ) diff --git a/tools/travis-ci/run.sh b/tools/travis-ci/run.sh index 67bf9af15..7d056100a 100755 --- a/tools/travis-ci/run.sh +++ b/tools/travis-ci/run.sh @@ -52,9 +52,16 @@ elif [ "${TRAVIS_OS_NAME}" == "linux" ]; then if which lsb_release > /dev/null; then OPJ_OS_NAME=$(lsb_release -si)$(lsb_release -sr | sed 's/\([^0-9]*\.[0-9]*\).*/\1/') fi - if [ "${CC}" == "gcc" ]; then - OPJ_CC_VERSION=gcc$(${CC} --version | head -1 | sed 's/.*\ \([0-9.]*[0-9]\)/\1/') - elif [ "${CC}" == "clang" ]; then + if [ -z "${CC##*gcc*}" ]; then + OPJ_CC_VERSION=$(${CC} --version | head -1 | sed 's/.*\ \([0-9.]*[0-9]\)/\1/') + if [ -z "${CC##*mingw*}" ]; then + OPJ_CC_VERSION=mingw${OPJ_CC_VERSION} + # disable testing for now + export OPJ_CI_SKIP_TESTS=1 + else + OPJ_CC_VERSION=gcc${OPJ_CC_VERSION} + fi + elif [ -z "${CC##*clang*}" ]; then OPJ_CC_VERSION=clang$(${CC} --version | grep version | sed 's/.*version \([^0-9.]*[0-9.]*\).*/\1/') else echo "Compiler not supported: ${CC}"; exit 1 From ecb00ea4e44b92f89a47fffbae0d9f8cb0a27f3d Mon Sep 17 00:00:00 2001 From: mayeut Date: Sat, 12 Sep 2015 18:06:31 +0200 Subject: [PATCH 17/27] Travis mingw --- .travis.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index ff334917d..fc0c720ad 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,10 +1,10 @@ language: c os: - linux - - osx +# - osx compiler: - - gcc - - clang +# - gcc +# - clang - x86_64-w64-mingw32-gcc env: - OPJ_CI_ARCH=x86_64 OPJ_CI_BUILD_CONFIGURATION=Release @@ -30,7 +30,7 @@ addons: apt: packages: - gcc-multilib - - mingw-w64 + - gcc-mingw-w64 install: - ./tools/travis-ci/install.sh From 9add0fe298f2fd73466003b60ba9d1e94c68b6b2 Mon Sep 17 00:00:00 2001 From: mayeut Date: Sat, 12 Sep 2015 18:10:38 +0200 Subject: [PATCH 18/27] Travis mingw --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index fc0c720ad..712bf3cf9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -30,6 +30,8 @@ addons: apt: packages: - gcc-multilib + - gcc-mingw-w64-i686 + - gcc-mingw-w64-x86-64 - gcc-mingw-w64 install: From b8ba5a83577771f59ff3554598a0c9dd62004183 Mon Sep 17 00:00:00 2001 From: mayeut Date: Sat, 12 Sep 2015 18:12:38 +0200 Subject: [PATCH 19/27] Travis mingw --- .travis.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.travis.yml b/.travis.yml index 712bf3cf9..ebcbd7a32 100644 --- a/.travis.yml +++ b/.travis.yml @@ -30,6 +30,9 @@ addons: apt: packages: - gcc-multilib + - gcc-mingw-w64-base + - binutils-mingw-w64-i686 + - binutils-mingw-w64-x86-64 - gcc-mingw-w64-i686 - gcc-mingw-w64-x86-64 - gcc-mingw-w64 From 0b611c52507cbc21685dd87a40f9ed4f71fa3ab3 Mon Sep 17 00:00:00 2001 From: mayeut Date: Sat, 12 Sep 2015 18:21:25 +0200 Subject: [PATCH 20/27] Travis full matrix --- .travis.yml | 9 ++++--- tools/ctest_scripts/toolchain-mingw32.cmake | 26 +++++++++++++++++++++ tools/ctest_scripts/travis-ci.cmake | 8 +++++-- 3 files changed, 38 insertions(+), 5 deletions(-) create mode 100644 tools/ctest_scripts/toolchain-mingw32.cmake diff --git a/.travis.yml b/.travis.yml index ebcbd7a32..8e29a64a1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,10 +1,10 @@ language: c os: - linux -# - osx + - osx compiler: -# - gcc -# - clang + - gcc + - clang - x86_64-w64-mingw32-gcc env: - OPJ_CI_ARCH=x86_64 OPJ_CI_BUILD_CONFIGURATION=Release @@ -19,6 +19,9 @@ matrix: compiler: x86_64-w64-mingw32-gcc - compiler: clang env: OPJ_CI_ARCH=i386 OPJ_CI_BUILD_CONFIGURATION=Release + - os: linux + compiler: clang + env: OPJ_CI_ARCH=x86_64 OPJ_CI_BUILD_CONFIGURATION=Release - compiler: gcc env: OPJ_CI_ARCH=x86_64 OPJ_CI_BUILD_CONFIGURATION=Debug OPJ_CI_ASAN=1 - compiler: x86_64-w64-mingw32-gcc diff --git a/tools/ctest_scripts/toolchain-mingw32.cmake b/tools/ctest_scripts/toolchain-mingw32.cmake new file mode 100644 index 000000000..1728f9ea1 --- /dev/null +++ b/tools/ctest_scripts/toolchain-mingw32.cmake @@ -0,0 +1,26 @@ +# http://www.cmake.org/Wiki/CmakeMingw +# +# Copyright (c) 2006-2014 Mathieu Malaterre +# +# Redistribution and use is allowed according to the terms of the New +# BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. +# + +# the name of the target operating system +set(CMAKE_SYSTEM_NAME Windows) + +# which compilers to use for C and C++ +set(CMAKE_C_COMPILER i686-w64-mingw32-gcc) +set(CMAKE_CXX_COMPILER i686-w64-mingw32-g++) +set(CMAKE_RC_COMPILER i686-w64-mingw32-windres) + +# here is the target environment located +set(CMAKE_FIND_ROOT_PATH /usr/i686-w64-mingw32) + +# adjust the default behaviour of the FIND_XXX() commands: +# search headers and libraries in the target environment, search +# programs in the host environment +set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) +set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) +set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) diff --git a/tools/ctest_scripts/travis-ci.cmake b/tools/ctest_scripts/travis-ci.cmake index 371235a41..fafc54ee5 100644 --- a/tools/ctest_scripts/travis-ci.cmake +++ b/tools/ctest_scripts/travis-ci.cmake @@ -48,7 +48,11 @@ endif() if("$ENV{CC}" MATCHES ".*mingw.*") # We are trying to use mingw - set(CTEST_CONFIGURE_OPTIONS "-DCMAKE_TOOLCHAIN_FILE=${CTEST_SCRIPT_DIRECTORY}/toolchain-mingw64.cmake") + if ("$ENV{OPJ_CI_ARCH}" MATCHES "^i[3-6]86$") + set(CTEST_CONFIGURE_OPTIONS "-DCMAKE_TOOLCHAIN_FILE=${CTEST_SCRIPT_DIRECTORY}/toolchain-mingw32.cmake") + else() + set(CTEST_CONFIGURE_OPTIONS "-DCMAKE_TOOLCHAIN_FILE=${CTEST_SCRIPT_DIRECTORY}/toolchain-mingw64.cmake") + endif() endif() if(NOT "$ENV{OPJ_CI_SKIP_TESTS}" STREQUAL "1") @@ -126,4 +130,4 @@ endif() if ("$ENV{OPJ_DO_SUBMIT}" STREQUAL "1") ctest_submit() endif() -#ctest_empty_binary_directory( "${CTEST_BINARY_DIRECTORY}" ) +ctest_empty_binary_directory( "${CTEST_BINARY_DIRECTORY}" ) From 1621df453d493b10bc2b8d0b6332c278abfb49a4 Mon Sep 17 00:00:00 2001 From: mayeut Date: Sat, 12 Sep 2015 19:32:05 +0200 Subject: [PATCH 21/27] Travis error on new failures --- tools/ctest_scripts/travis-ci.cmake | 3 +- ...u12.04-clang3.4-x86_64-Debug-3rdP-ASan.txt | 1 + ...Ubuntu12.04-gcc4.6.3-i386-Release-3rdP.txt | 61 +++++++++++++++++++ ...Ubuntu14.04-gcc4.8.4-i386-Release-3rdP.txt | 45 ++++++++++++++ tools/travis-ci/knownfailures-all.txt | 17 ++++++ tools/travis-ci/run.sh | 35 +++++++++++ 6 files changed, 161 insertions(+), 1 deletion(-) create mode 100644 tools/travis-ci/knownfailures-Ubuntu12.04-clang3.4-x86_64-Debug-3rdP-ASan.txt create mode 100644 tools/travis-ci/knownfailures-Ubuntu12.04-gcc4.6.3-i386-Release-3rdP.txt create mode 100644 tools/travis-ci/knownfailures-Ubuntu14.04-gcc4.8.4-i386-Release-3rdP.txt create mode 100644 tools/travis-ci/knownfailures-all.txt diff --git a/tools/ctest_scripts/travis-ci.cmake b/tools/ctest_scripts/travis-ci.cmake index fafc54ee5..bab6d7abc 100644 --- a/tools/ctest_scripts/travis-ci.cmake +++ b/tools/ctest_scripts/travis-ci.cmake @@ -130,4 +130,5 @@ endif() if ("$ENV{OPJ_DO_SUBMIT}" STREQUAL "1") ctest_submit() endif() -ctest_empty_binary_directory( "${CTEST_BINARY_DIRECTORY}" ) +# Do not clean, we'll parse the log for known failure +#ctest_empty_binary_directory( "${CTEST_BINARY_DIRECTORY}" ) diff --git a/tools/travis-ci/knownfailures-Ubuntu12.04-clang3.4-x86_64-Debug-3rdP-ASan.txt b/tools/travis-ci/knownfailures-Ubuntu12.04-clang3.4-x86_64-Debug-3rdP-ASan.txt new file mode 100644 index 000000000..ab2169d3b --- /dev/null +++ b/tools/travis-ci/knownfailures-Ubuntu12.04-clang3.4-x86_64-Debug-3rdP-ASan.txt @@ -0,0 +1 @@ +NR-ENC-Bretagne2.ppm-7-compare_dec-ref-out2base diff --git a/tools/travis-ci/knownfailures-Ubuntu12.04-gcc4.6.3-i386-Release-3rdP.txt b/tools/travis-ci/knownfailures-Ubuntu12.04-gcc4.6.3-i386-Release-3rdP.txt new file mode 100644 index 000000000..bad459723 --- /dev/null +++ b/tools/travis-ci/knownfailures-Ubuntu12.04-gcc4.6.3-i386-Release-3rdP.txt @@ -0,0 +1,61 @@ +NR-ENC-issue203-32x32-bgr16.bmp-43-compare_dump2base +NR-ENC-issue203-32x32-bgr16.bmp-43-compare_dec-ref-out2base +NR-ENC-issue203-33x33-bgr16.bmp-44-compare_dump2base +NR-ENC-issue203-33x33-bgr16.bmp-44-compare_dec-ref-out2base +NR-ENC-issue203-32x32-bgra16.bmp-45-compare_dump2base +NR-ENC-issue203-33x33-bgra16.bmp-46-compare_dump2base +NR-ENC-issue203-127x64-bgr16.bmp-49-compare_dump2base +NR-ENC-issue203-127x64-bgr16.bmp-49-compare_dec-ref-out2base +NR-DEC-issue104_jpxstream.jp2-33-decode-md5 +NR-DEC-issue226.j2k-74-decode +NR-DEC-issue226.j2k-74-decode-md5 +NR-DEC-p1_06.j2k-156-decode +NR-DEC-p1_06.j2k-156-decode-md5 +NR-DEC-p1_06.j2k-164-decode-md5 +NR-C1P0-p0_04.j2k-compare2base +NR-C1P0-p0_05.j2k-compare2base +NR-C1P0-p0_06.j2k-compare2base +NR-C1P1-p1_02.j2k-compare2base +NR-C1P1-p1_03.j2k-compare2base +NR-C1P1-p1_04.j2k-compare2base +NR-C1P1-p1_05.j2k-compare2base +NR-JP2-file2.jp2-compare2base +NR-JP2-file3.jp2-compare2base +NR-RIC-subsampling_1.jp2-compare2base +NR-RIC-subsampling_2.jp2-compare2base +NR-RIC-zoo1.jp2-compare2base +NR-RIC-zoo2.jp2-compare2base +NR-DEC-_00042.j2k-2-decode-md5 +NR-DEC-buxI.j2k-9-decode-md5 +NR-DEC-CT_Phillips_JPEG2K_Decompr_Problem.j2k-13-decode-md5 +NR-DEC-Marrin.jp2-18-decode-md5 +NR-DEC-kodak_2layers_lrcp.j2c-31-decode-md5 +NR-DEC-kodak_2layers_lrcp.j2c-32-decode-md5 +NR-DEC-file409752.jp2-40-decode-md5 +NR-DEC-issue188_beach_64bitsbox.jp2-41-decode-md5 +NR-DEC-issue206_image-000.jp2-42-decode-md5 +NR-DEC-issue205.jp2-43-decode-md5 +NR-DEC-issue228.j2k-60-decode-md5 +NR-DEC-issue134.jp2-67-decode-md5 +NR-DEC-issue208.jp2-69-decode-md5 +NR-DEC-issue211.jp2-70-decode-md5 +NR-DEC-issue135.j2k-68-decode-md5 +NR-DEC-issue414.jp2-110-decode-md5 +NR-DEC-p1_04.j2k-124-decode-md5 +NR-DEC-p1_04.j2k-125-decode-md5 +NR-DEC-p1_04.j2k-126-decode-md5 +NR-DEC-p1_04.j2k-127-decode-md5 +NR-DEC-p1_04.j2k-128-decode-md5 +NR-DEC-p1_04.j2k-129-decode-md5 +NR-DEC-p1_04.j2k-131-decode-md5 +NR-DEC-p1_04.j2k-134-decode-md5 +NR-DEC-p1_04.j2k-138-decode-md5 +NR-DEC-p1_04.j2k-140-decode-md5 +NR-DEC-p0_04.j2k-166-decode-md5 +NR-DEC-p0_04.j2k-168-decode-md5 +NR-DEC-p0_04.j2k-172-decode-md5 +NR-DEC-issue205.jp2-253-decode-md5 +NR-DEC-issue559-eci-090-CIELab.jp2-255-decode-md5 +NR-DEC-issue236-ESYCC-CDEF.jp2-254-decode-md5 +NR-DEC-issue559-eci-091-CIELab.jp2-256-decode-md5 +NR-DEC-p1_06.j2k-164-decode diff --git a/tools/travis-ci/knownfailures-Ubuntu14.04-gcc4.8.4-i386-Release-3rdP.txt b/tools/travis-ci/knownfailures-Ubuntu14.04-gcc4.8.4-i386-Release-3rdP.txt new file mode 100644 index 000000000..fe66aa36a --- /dev/null +++ b/tools/travis-ci/knownfailures-Ubuntu14.04-gcc4.8.4-i386-Release-3rdP.txt @@ -0,0 +1,45 @@ +NR-C1P0-p0_04.j2k-compare2base +NR-C1P0-p0_05.j2k-compare2base +NR-C1P0-p0_06.j2k-compare2base +NR-C1P1-p1_02.j2k-compare2base +NR-C1P1-p1_03.j2k-compare2base +NR-C1P1-p1_04.j2k-compare2base +NR-C1P1-p1_05.j2k-compare2base +NR-JP2-file2.jp2-compare2base +NR-JP2-file3.jp2-compare2base +NR-RIC-subsampling_1.jp2-compare2base +NR-RIC-subsampling_2.jp2-compare2base +NR-RIC-zoo1.jp2-compare2base +NR-RIC-zoo2.jp2-compare2base +NR-DEC-_00042.j2k-2-decode-md5 +NR-DEC-buxI.j2k-9-decode-md5 +NR-DEC-CT_Phillips_JPEG2K_Decompr_Problem.j2k-13-decode-md5 +NR-DEC-Marrin.jp2-18-decode-md5 +NR-DEC-kodak_2layers_lrcp.j2c-31-decode-md5 +NR-DEC-kodak_2layers_lrcp.j2c-32-decode-md5 +NR-DEC-file409752.jp2-40-decode-md5 +NR-DEC-issue188_beach_64bitsbox.jp2-41-decode-md5 +NR-DEC-issue206_image-000.jp2-42-decode-md5 +NR-DEC-issue205.jp2-43-decode-md5 +NR-DEC-issue228.j2k-60-decode-md5 +NR-DEC-issue134.jp2-67-decode-md5 +NR-DEC-issue208.jp2-69-decode-md5 +NR-DEC-issue211.jp2-70-decode-md5 +NR-DEC-issue414.jp2-110-decode-md5 +NR-DEC-p1_04.j2k-124-decode-md5 +NR-DEC-p1_04.j2k-125-decode-md5 +NR-DEC-p1_04.j2k-126-decode-md5 +NR-DEC-p1_04.j2k-127-decode-md5 +NR-DEC-p1_04.j2k-128-decode-md5 +NR-DEC-p1_04.j2k-129-decode-md5 +NR-DEC-p1_04.j2k-131-decode-md5 +NR-DEC-p1_04.j2k-134-decode-md5 +NR-DEC-p1_04.j2k-138-decode-md5 +NR-DEC-p1_04.j2k-140-decode-md5 +NR-DEC-p0_04.j2k-166-decode-md5 +NR-DEC-p0_04.j2k-168-decode-md5 +NR-DEC-p0_04.j2k-172-decode-md5 +NR-DEC-issue205.jp2-253-decode-md5 +NR-DEC-issue236-ESYCC-CDEF.jp2-254-decode-md5 +NR-DEC-issue559-eci-090-CIELab.jp2-255-decode-md5 +NR-DEC-issue559-eci-091-CIELab.jp2-256-decode-md5 diff --git a/tools/travis-ci/knownfailures-all.txt b/tools/travis-ci/knownfailures-all.txt new file mode 100644 index 000000000..5be40caa1 --- /dev/null +++ b/tools/travis-ci/knownfailures-all.txt @@ -0,0 +1,17 @@ +NR-DEC-p1_06.j2k-164-decode +NR-ENC-issue203-32x32-bgr16.bmp-43-compare_dump2base +NR-ENC-issue203-33x33-bgr16.bmp-44-compare_dump2base +NR-ENC-issue203-32x32-bgra16.bmp-45-compare_dump2base +NR-ENC-issue203-33x33-bgra16.bmp-46-compare_dump2base +NR-ENC-issue203-127x64-bgr16.bmp-49-compare_dump2base +NR-DEC-issue104_jpxstream.jp2-33-decode-md5 +NR-DEC-issue135.j2k-68-decode-md5 +NR-DEC-issue226.j2k-74-decode-md5 +NR-DEC-p1_06.j2k-156-decode-md5 +NR-DEC-p1_06.j2k-164-decode-md5 +NR-DEC-p1_06.j2k-156-decode +NR-DEC-issue226.j2k-74-decode +NR-ENC-issue203-32x32-bgr16.bmp-43-compare_dec-ref-out2base +NR-ENC-issue203-33x33-bgr16.bmp-44-compare_dec-ref-out2base +NR-ENC-issue203-127x64-bgr16.bmp-49-compare_dec-ref-out2base +NR-DEC-broken.jpc-73-decode diff --git a/tools/travis-ci/run.sh b/tools/travis-ci/run.sh index 7d056100a..c68d2da2b 100755 --- a/tools/travis-ci/run.sh +++ b/tools/travis-ci/run.sh @@ -85,12 +85,15 @@ if [ "${TRAVIS_BRANCH:-}" == "" ]; then fi OPJ_BUILDNAME=${OPJ_OS_NAME}-${OPJ_CC_VERSION}-${OPJ_CI_ARCH}-${TRAVIS_BRANCH} +OPJ_BUILDNAME_TEST=${OPJ_OS_NAME}-${OPJ_CC_VERSION}-${OPJ_CI_ARCH} if [ "${TRAVIS_PULL_REQUEST:-}" != "false" ] && [ "${TRAVIS_PULL_REQUEST:-}" != "" ]; then OPJ_BUILDNAME=${OPJ_BUILDNAME}-pr${TRAVIS_PULL_REQUEST} fi OPJ_BUILDNAME=${OPJ_BUILDNAME}-${OPJ_CI_BUILD_CONFIGURATION}-3rdP +OPJ_BUILDNAME_TEST=${OPJ_BUILDNAME_TEST}-${OPJ_CI_BUILD_CONFIGURATION}-3rdP if [ "${OPJ_CI_ASAN:-}" == "1" ]; then OPJ_BUILDNAME=${OPJ_BUILDNAME}-ASan + OPJ_BUILDNAME_TEST=${OPJ_BUILDNAME_TEST}-ASan fi if [ "${OPJ_NONCOMMERCIAL:-}" == "1" ] && [ "${OPJ_CI_SKIP_TESTS:-}" != "1" ] && [ -d kdu ]; then @@ -119,3 +122,35 @@ export OPJ_BUILD_CONFIGURATION=${OPJ_CI_BUILD_CONFIGURATION} export OPJ_DO_SUBMIT=${OPJ_DO_SUBMIT} ctest -S ${OPJ_SOURCE_DIR}/tools/ctest_scripts/travis-ci.cmake -V + +# ctest will exit with error code 0 even if tests failed +# let's parse discarding known failure +set +x +echo " +Parsing logs for new/unknown failures +" +OPJ_CI_RESULT=0 + +awk -F: '{ print $2 }' build/Testing/Temporary/LastTestsFailed_*.log > failures.txt + +while read FAILEDTEST; do + # Start with common errors + if grep -x "${FAILEDTEST}" ${OPJ_SOURCE_DIR}/tools/travis-ci/knownfailures-all.txt > /dev/null; then + continue + fi + if [ -f ${OPJ_SOURCE_DIR}/tools/travis-ci/knownfailures-${OPJ_BUILDNAME_TEST}.txt ]; then + if grep -x "${FAILEDTEST}" ${OPJ_SOURCE_DIR}/tools/travis-ci/knownfailures-${OPJ_BUILDNAME_TEST}.txt > /dev/null; then + continue + fi + fi + echo "${FAILEDTEST}" + OPJ_CI_RESULT=1 +done < failures.txt + +# TODO parse memcheck + +if [ ${OPJ_CI_RESULT} -eq 0 ]; then + echo "No new/unknown failure found" +fi + +exit ${OPJ_CI_RESULT} From c08bd897394510513d0dcf6ff6d3cd5936c603cb Mon Sep 17 00:00:00 2001 From: mayeut Date: Sat, 12 Sep 2015 20:06:31 +0200 Subject: [PATCH 22/27] Travis fix error when no tests are done --- tools/travis-ci/run.sh | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/tools/travis-ci/run.sh b/tools/travis-ci/run.sh index c68d2da2b..ec3b7d345 100755 --- a/tools/travis-ci/run.sh +++ b/tools/travis-ci/run.sh @@ -131,26 +131,34 @@ Parsing logs for new/unknown failures " OPJ_CI_RESULT=0 -awk -F: '{ print $2 }' build/Testing/Temporary/LastTestsFailed_*.log > failures.txt - -while read FAILEDTEST; do - # Start with common errors - if grep -x "${FAILEDTEST}" ${OPJ_SOURCE_DIR}/tools/travis-ci/knownfailures-all.txt > /dev/null; then - continue - fi - if [ -f ${OPJ_SOURCE_DIR}/tools/travis-ci/knownfailures-${OPJ_BUILDNAME_TEST}.txt ]; then - if grep -x "${FAILEDTEST}" ${OPJ_SOURCE_DIR}/tools/travis-ci/knownfailures-${OPJ_BUILDNAME_TEST}.txt > /dev/null; then +OPJ_HAS_TESTS=$(find build -path 'build/Testing/Temporary*' -name 'LastTestsFailed*' | wc -l) +OPJ_HAS_TESTS=$(echo $OPJ_HAS_TESTS) #macos wc workaround + +if [ $OPJ_HAS_TESTS -ne 0 ]; then + awk -F: '{ print $2 }' build/Testing/Temporary/LastTestsFailed_*.log > failures.txt + while read FAILEDTEST; do + # Start with common errors + if grep -x "${FAILEDTEST}" ${OPJ_SOURCE_DIR}/tools/travis-ci/knownfailures-all.txt > /dev/null; then continue fi - fi - echo "${FAILEDTEST}" - OPJ_CI_RESULT=1 -done < failures.txt + if [ -f ${OPJ_SOURCE_DIR}/tools/travis-ci/knownfailures-${OPJ_BUILDNAME_TEST}.txt ]; then + if grep -x "${FAILEDTEST}" ${OPJ_SOURCE_DIR}/tools/travis-ci/knownfailures-${OPJ_BUILDNAME_TEST}.txt > /dev/null; then + continue + fi + fi + echo "${FAILEDTEST}" + OPJ_CI_RESULT=1 + done < failures.txt +fi # TODO parse memcheck if [ ${OPJ_CI_RESULT} -eq 0 ]; then echo "No new/unknown failure found" +else + echo " +New/unknown failures found!!! +" fi exit ${OPJ_CI_RESULT} From 3d295431e6c4e83528424d8ee3540072cd34d7ec Mon Sep 17 00:00:00 2001 From: mayeut Date: Sat, 12 Sep 2015 20:21:52 +0200 Subject: [PATCH 23/27] Travis set ASan build to -O1 --- tools/ctest_scripts/travis-ci.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/ctest_scripts/travis-ci.cmake b/tools/ctest_scripts/travis-ci.cmake index bab6d7abc..6d50b3f57 100644 --- a/tools/ctest_scripts/travis-ci.cmake +++ b/tools/ctest_scripts/travis-ci.cmake @@ -43,7 +43,7 @@ endif() if ("$ENV{OPJ_CI_ASAN}" STREQUAL "1") set(OPJ_HAS_MEMCHECK TRUE) set(CTEST_MEMORYCHECK_TYPE "AddressSanitizer") - set(CCFLAGS_ARCH "${CCFLAGS_ARCH} -g -fsanitize=address -fno-omit-frame-pointer") + set(CCFLAGS_ARCH "${CCFLAGS_ARCH} -O1 -g -fsanitize=address -fno-omit-frame-pointer") endif() if("$ENV{CC}" MATCHES ".*mingw.*") From 700f8cb4f8bfa15390ded3c085135a0ca900ce81 Mon Sep 17 00:00:00 2001 From: mayeut Date: Sun, 13 Sep 2015 16:09:24 +0200 Subject: [PATCH 24/27] Ignore ctest return code ctest behavior is not consistent across versions. Ignore return code & parse logs --- tools/travis-ci/run.sh | 100 +++++++++++++++++++++++++++++------------ 1 file changed, 72 insertions(+), 28 deletions(-) diff --git a/tools/travis-ci/run.sh b/tools/travis-ci/run.sh index ec3b7d345..318081be4 100755 --- a/tools/travis-ci/run.sh +++ b/tools/travis-ci/run.sh @@ -121,44 +121,88 @@ export OPJ_SOURCE_DIR=${OPJ_SOURCE_DIR} export OPJ_BUILD_CONFIGURATION=${OPJ_CI_BUILD_CONFIGURATION} export OPJ_DO_SUBMIT=${OPJ_DO_SUBMIT} -ctest -S ${OPJ_SOURCE_DIR}/tools/ctest_scripts/travis-ci.cmake -V - -# ctest will exit with error code 0 even if tests failed -# let's parse discarding known failure +ctest -S ${OPJ_SOURCE_DIR}/tools/ctest_scripts/travis-ci.cmake -V || true +# ctest will exit with various error codes depending on version. +# ignore ctest exit code & parse this ourselves set +x + +# let's parse configure/build/tests for failure + echo " -Parsing logs for new/unknown failures +Parsing logs for failures " OPJ_CI_RESULT=0 -OPJ_HAS_TESTS=$(find build -path 'build/Testing/Temporary*' -name 'LastTestsFailed*' | wc -l) -OPJ_HAS_TESTS=$(echo $OPJ_HAS_TESTS) #macos wc workaround +# 1st configure step +OPJ_CONFIGURE_XML=$(find build -path 'build/Testing/*' -name 'Configure.xml') +if [ ! -f "${OPJ_CONFIGURE_XML}" ]; then + echo "No configure log found" + OPJ_CI_RESULT=1 +else + if ! grep '0' ${OPJ_CONFIGURE_XML} &> /dev/null; then + echo "Errors were found in configure log" + OPJ_CI_RESULT=1 + fi +fi -if [ $OPJ_HAS_TESTS -ne 0 ]; then - awk -F: '{ print $2 }' build/Testing/Temporary/LastTestsFailed_*.log > failures.txt - while read FAILEDTEST; do - # Start with common errors - if grep -x "${FAILEDTEST}" ${OPJ_SOURCE_DIR}/tools/travis-ci/knownfailures-all.txt > /dev/null; then - continue - fi - if [ -f ${OPJ_SOURCE_DIR}/tools/travis-ci/knownfailures-${OPJ_BUILDNAME_TEST}.txt ]; then - if grep -x "${FAILEDTEST}" ${OPJ_SOURCE_DIR}/tools/travis-ci/knownfailures-${OPJ_BUILDNAME_TEST}.txt > /dev/null; then - continue - fi - fi - echo "${FAILEDTEST}" +# 2nd build step +# We must have one Build.xml file +OPJ_BUILD_XML=$(find build -path 'build/Testing/*' -name 'Build.xml') +if [ ! -f "${OPJ_BUILD_XML}" ]; then + echo "No build log found" + OPJ_CI_RESULT=1 +else + if grep '' ${OPJ_BUILD_XML} &> /dev/null; then + echo "Errors were found in build log" OPJ_CI_RESULT=1 - done < failures.txt + fi +fi + +if [ ${OPJ_CI_RESULT} -ne 0 ]; then + # Don't trash output with failing tests when there are configure/build errors + exit ${OPJ_CI_RESULT} fi -# TODO parse memcheck +if [ "${OPJ_CI_SKIP_TESTS:-}" != "1" ]; then + OPJ_TEST_XML=$(find build -path 'build/Testing/*' -name 'Test.xml') + if [ ! -f "${OPJ_TEST_XML}" ]; then + echo "No test log found" + OPJ_CI_RESULT=1 + else + echo "Parsing tests for new/unknown failures" + # 3rd test step + OPJ_FAILEDTEST_LOG=$(find build -path 'build/Testing/Temporary/*' -name 'LastTestsFailed_*.log') + if [ -f "${OPJ_FAILEDTEST_LOG}" ]; then + awk -F: '{ print $2 }' ${OPJ_FAILEDTEST_LOG} > failures.txt + while read FAILEDTEST; do + # Start with common errors + if grep -x "${FAILEDTEST}" ${OPJ_SOURCE_DIR}/tools/travis-ci/knownfailures-all.txt > /dev/null; then + continue + fi + if [ -f ${OPJ_SOURCE_DIR}/tools/travis-ci/knownfailures-${OPJ_BUILDNAME_TEST}.txt ]; then + if grep -x "${FAILEDTEST}" ${OPJ_SOURCE_DIR}/tools/travis-ci/knownfailures-${OPJ_BUILDNAME_TEST}.txt > /dev/null; then + continue + fi + fi + echo "${FAILEDTEST}" + OPJ_CI_RESULT=1 + done < failures.txt + fi + fi -if [ ${OPJ_CI_RESULT} -eq 0 ]; then - echo "No new/unknown failure found" -else - echo " -New/unknown failures found!!! -" + # 4th memcheck step + OPJ_MEMCHECK_XML=$(find build -path 'build/Testing/*' -name 'MemCheck.xml') + if [ -f "${OPJ_MEMCHECK_XML}" ]; then + echo "TODO parse MemCheck.xml" + fi + + if [ ${OPJ_CI_RESULT} -eq 0 ]; then + echo "No new/unknown test failure found" + else + echo " +New/unknown test failure found!!! + " + fi fi exit ${OPJ_CI_RESULT} From c6b2fdf572dee57ae861ced70f03a69ae27deaef Mon Sep 17 00:00:00 2001 From: mayeut Date: Sun, 13 Sep 2015 16:34:17 +0200 Subject: [PATCH 25/27] correct MemCheck log filename --- tools/travis-ci/run.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/travis-ci/run.sh b/tools/travis-ci/run.sh index 318081be4..c7387ab2a 100755 --- a/tools/travis-ci/run.sh +++ b/tools/travis-ci/run.sh @@ -191,9 +191,9 @@ if [ "${OPJ_CI_SKIP_TESTS:-}" != "1" ]; then fi # 4th memcheck step - OPJ_MEMCHECK_XML=$(find build -path 'build/Testing/*' -name 'MemCheck.xml') + OPJ_MEMCHECK_XML=$(find build -path 'build/Testing/*' -name 'DynamicAnalysis.xml') if [ -f "${OPJ_MEMCHECK_XML}" ]; then - echo "TODO parse MemCheck.xml" + echo "TODO parse DynamicAnalysis.xml" fi if [ ${OPJ_CI_RESULT} -eq 0 ]; then From 6e11b55441401620bcea9265d797c8c2bdba3cc2 Mon Sep 17 00:00:00 2001 From: mayeut Date: Mon, 14 Sep 2015 19:37:56 +0200 Subject: [PATCH 26/27] Travis-ci add linux gcc x86_64 Debug --- .travis.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.travis.yml b/.travis.yml index 8e29a64a1..81245f35f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,6 +10,7 @@ env: - OPJ_CI_ARCH=x86_64 OPJ_CI_BUILD_CONFIGURATION=Release - OPJ_CI_ARCH=i386 OPJ_CI_BUILD_CONFIGURATION=Release - OPJ_CI_ARCH=x86_64 OPJ_CI_BUILD_CONFIGURATION=Debug OPJ_CI_ASAN=1 + - OPJ_CI_ARCH=x86_64 OPJ_CI_BUILD_CONFIGURATION=DEBUG matrix: exclude: @@ -19,6 +20,8 @@ matrix: compiler: x86_64-w64-mingw32-gcc - compiler: clang env: OPJ_CI_ARCH=i386 OPJ_CI_BUILD_CONFIGURATION=Release + - compiler: clang + env: OPJ_CI_ARCH=x86_64 OPJ_CI_BUILD_CONFIGURATION=DEBUG - os: linux compiler: clang env: OPJ_CI_ARCH=x86_64 OPJ_CI_BUILD_CONFIGURATION=Release @@ -26,6 +29,8 @@ matrix: env: OPJ_CI_ARCH=x86_64 OPJ_CI_BUILD_CONFIGURATION=Debug OPJ_CI_ASAN=1 - compiler: x86_64-w64-mingw32-gcc env: OPJ_CI_ARCH=x86_64 OPJ_CI_BUILD_CONFIGURATION=Debug OPJ_CI_ASAN=1 + - compiler: x86_64-w64-mingw32-gcc + env: OPJ_CI_ARCH=x86_64 OPJ_CI_BUILD_CONFIGURATION=Debug - os: osx env: OPJ_CI_ARCH=x86_64 OPJ_CI_BUILD_CONFIGURATION=Debug OPJ_CI_ASAN=1 From 3ea4486bedf15be988736e6f9cb5db088ea9017c Mon Sep 17 00:00:00 2001 From: mayeut Date: Mon, 14 Sep 2015 20:09:50 +0200 Subject: [PATCH 27/27] Travis-ci update Correct case in config Check DynamicAnalysis result --- .travis.yml | 4 ++-- tools/travis-ci/run.sh | 22 ++++++++++++++-------- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/.travis.yml b/.travis.yml index 81245f35f..e5872a31e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,7 +10,7 @@ env: - OPJ_CI_ARCH=x86_64 OPJ_CI_BUILD_CONFIGURATION=Release - OPJ_CI_ARCH=i386 OPJ_CI_BUILD_CONFIGURATION=Release - OPJ_CI_ARCH=x86_64 OPJ_CI_BUILD_CONFIGURATION=Debug OPJ_CI_ASAN=1 - - OPJ_CI_ARCH=x86_64 OPJ_CI_BUILD_CONFIGURATION=DEBUG + - OPJ_CI_ARCH=x86_64 OPJ_CI_BUILD_CONFIGURATION=Debug matrix: exclude: @@ -21,7 +21,7 @@ matrix: - compiler: clang env: OPJ_CI_ARCH=i386 OPJ_CI_BUILD_CONFIGURATION=Release - compiler: clang - env: OPJ_CI_ARCH=x86_64 OPJ_CI_BUILD_CONFIGURATION=DEBUG + env: OPJ_CI_ARCH=x86_64 OPJ_CI_BUILD_CONFIGURATION=Debug - os: linux compiler: clang env: OPJ_CI_ARCH=x86_64 OPJ_CI_BUILD_CONFIGURATION=Release diff --git a/tools/travis-ci/run.sh b/tools/travis-ci/run.sh index c7387ab2a..bec41d6d3 100755 --- a/tools/travis-ci/run.sh +++ b/tools/travis-ci/run.sh @@ -189,20 +189,26 @@ if [ "${OPJ_CI_SKIP_TESTS:-}" != "1" ]; then done < failures.txt fi fi - - # 4th memcheck step - OPJ_MEMCHECK_XML=$(find build -path 'build/Testing/*' -name 'DynamicAnalysis.xml') - if [ -f "${OPJ_MEMCHECK_XML}" ]; then - echo "TODO parse DynamicAnalysis.xml" - fi - + if [ ${OPJ_CI_RESULT} -eq 0 ]; then - echo "No new/unknown test failure found" + echo "No new/unknown test failure found + " else echo " New/unknown test failure found!!! " fi + + # 4th memcheck step + OPJ_MEMCHECK_XML=$(find build -path 'build/Testing/*' -name 'DynamicAnalysis.xml') + if [ -f "${OPJ_MEMCHECK_XML}" ]; then + if grep ' /dev/null; then + echo "Errors were found in dynamic analysis log" + OPJ_CI_RESULT=1 + fi + fi + + fi exit ${OPJ_CI_RESULT}