Travis ASan build
This commit is contained in:
parent
4f157f3cf0
commit
fc131a1339
|
@ -40,6 +40,13 @@ if (NOT "$ENV{OPJ_CI_ARCH}" STREQUAL "")
|
||||||
endif()
|
endif()
|
||||||
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")
|
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
|
# 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
|
# 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}")
|
ctest_build(BUILD "${CTEST_BINARY_DIRECTORY}")
|
||||||
if(NOT "$ENV{OPJ_CI_SKIP_TESTS}" STREQUAL "1")
|
if(NOT "$ENV{OPJ_CI_SKIP_TESTS}" STREQUAL "1")
|
||||||
ctest_test(BUILD "${CTEST_BINARY_DIRECTORY}" PARALLEL_LEVEL 2)
|
ctest_test(BUILD "${CTEST_BINARY_DIRECTORY}" PARALLEL_LEVEL 2)
|
||||||
|
if(OPJ_HAS_MEMCHECK)
|
||||||
|
ctest_memcheck(BUILD "${CTEST_BINARY_DIRECTORY}" PARALLEL_LEVEL 2)
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
if ("$ENV{OPJ_DO_SUBMIT}" STREQUAL "1")
|
if ("$ENV{OPJ_DO_SUBMIT}" STREQUAL "1")
|
||||||
ctest_submit()
|
ctest_submit()
|
||||||
|
|
|
@ -21,56 +21,65 @@ trap exit ERR
|
||||||
|
|
||||||
# We don't need anything for coverity scan builds
|
# 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)
|
if [ "${OPJ_CI_ASAN:-}" == "1" ]; then
|
||||||
|
# We need a new version of cmake than travis-ci provides
|
||||||
# We need test data
|
wget -qO - http://www.cmake.org/files/v3.3/cmake-3.3.1-Linux-x86_64.tar.gz | tar -xz
|
||||||
if [ "${TRAVIS_BRANCH:-}" == "" ]; then
|
# copy to a directory that will not changed every version
|
||||||
TRAVIS_BRANCH=$(git -C ${OPJ_SOURCE_DIR} branch | grep '*' | tr -d '*[[:blank:]]') #default to same branch as we're setting up
|
mv cmake-3.3.1-Linux-x86_64 cmake-install
|
||||||
fi
|
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
|
if [ "${OPJ_CI_SKIP_TESTS:-}" != "1" ]; then
|
||||||
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:
|
OPJ_SOURCE_DIR=$(cd $(dirname $0)/../.. && pwd)
|
||||||
# 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,
|
# We need test data
|
||||||
# so long as such use or re-distribution is accompanied with this copyright notice and is not for commercial gain.
|
if [ "${TRAVIS_BRANCH:-}" == "" ]; then
|
||||||
# Note: Binaries can only be used for non-commercial purposes.
|
TRAVIS_BRANCH=$(git -C ${OPJ_SOURCE_DIR} branch | grep '*' | tr -d '*[[:blank:]]') #default to same branch as we're setting up
|
||||||
if [ "${OPJ_NONCOMMERCIAL:-}" == "1" ]; then
|
fi
|
||||||
if [ "${TRAVIS_OS_NAME:-}" == "linux" ] || uname -s | grep -i Linux &> /dev/null; then
|
OPJ_DATA_HAS_BRANCH=$(git ls-remote --heads git://github.com/uclouvain/openjpeg-data.git ${TRAVIS_BRANCH} | wc -l)
|
||||||
echo "Retrieving Kakadu"
|
if [ ${OPJ_DATA_HAS_BRANCH} -ne 0 ]; then
|
||||||
wget -q http://kakadusoftware.com/wp-content/uploads/2014/06/KDU77_Demo_Apps_for_Linux-x86-64_150710.zip
|
OPJ_DATA_BRANCH=${TRAVIS_BRANCH}
|
||||||
cmake -E tar -xf KDU77_Demo_Apps_for_Linux-x86-64_150710.zip
|
else
|
||||||
mv KDU77_Demo_Apps_for_Linux-x86-64_150710 kdu
|
OPJ_DATA_BRANCH=master #default to master
|
||||||
elif [ "${TRAVIS_OS_NAME:-}" == "osx" ] || uname -s | grep -i Darwin &> /dev/null; then
|
fi
|
||||||
echo "Retrieving Kakadu"
|
echo "Cloning openjpeg-data from ${OPJ_DATA_BRANCH} branch"
|
||||||
wget -q http://kakadusoftware.com/wp-content/uploads/2014/06/KDU77_Demo_Apps_for_OSX109_150710.dmg_.zip
|
git clone --depth=1 --branch=${OPJ_DATA_BRANCH} git://github.com/uclouvain/openjpeg-data.git data
|
||||||
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
|
# We need jpylyzer for the test suite
|
||||||
mkdir hfsexplorer && cmake -E chdir hfsexplorer tar -xf ../hfsexplorer-0.23-bin.zip
|
echo "Retrieving jpylyzer"
|
||||||
./hfsexplorer/bin/unhfs.sh -o ./ -fsroot Kakadu-demo-apps.pkg KDU77_Demo_Apps_for_OSX109_150710.dmg
|
wget -qO - https://github.com/openpreserve/jpylyzer/archive/1.14.2.tar.gz | tar -xz
|
||||||
pkgutil --expand Kakadu-demo-apps.pkg ./kdu
|
mv jpylyzer-1.14.2 jpylyzer
|
||||||
cd kdu
|
chmod +x jpylyzer/jpylyzer/jpylyzer.py
|
||||||
cat libkduv77r.pkg/Payload | gzip -d | cpio -id
|
|
||||||
cat kduexpand.pkg/Payload | gzip -d | cpio -id
|
# When OPJ_NONCOMMERCIAL=1, kakadu trial binaries are used for testing. Here's the copyright notice from kakadu:
|
||||||
cat kducompress.pkg/Payload | gzip -d | cpio -id
|
# Copyright is owned by NewSouth Innovations Pty Limited, commercial arm of the UNSW Australia in Sydney.
|
||||||
install_name_tool -id ${PWD}/libkdu_v77R.dylib libkdu_v77R.dylib
|
# You are free to trial these executables and even to re-distribute them,
|
||||||
install_name_tool -change /usr/local/lib/libkdu_v77R.dylib ${PWD}/libkdu_v77R.dylib kdu_compress
|
# so long as such use or re-distribution is accompanied with this copyright notice and is not for commercial gain.
|
||||||
install_name_tool -change /usr/local/lib/libkdu_v77R.dylib ${PWD}/libkdu_v77R.dylib kdu_expand
|
# 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
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
|
@ -82,6 +82,9 @@ if [ "${TRAVIS_PULL_REQUEST:-}" != "false" ] && [ "${TRAVIS_PULL_REQUEST:-}" !=
|
||||||
OPJ_BUILDNAME=${OPJ_BUILDNAME}-pr${TRAVIS_PULL_REQUEST}
|
OPJ_BUILDNAME=${OPJ_BUILDNAME}-pr${TRAVIS_PULL_REQUEST}
|
||||||
fi
|
fi
|
||||||
OPJ_BUILDNAME=${OPJ_BUILDNAME}-${OPJ_CI_BUILD_CONFIGURATION}-3rdP
|
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
|
if [ "${OPJ_NONCOMMERCIAL:-}" == "1" ] && [ "${OPJ_CI_SKIP_TESTS:-}" != "1" ] && [ -d kdu ]; then
|
||||||
echo "
|
echo "
|
||||||
|
@ -93,6 +96,10 @@ Note: Binaries can only be used for non-commercial purposes.
|
||||||
"
|
"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ -d cmake-install ]; then
|
||||||
|
export PATH=${PWD}/cmake-install/bin:${PATH}
|
||||||
|
fi
|
||||||
|
|
||||||
set -x
|
set -x
|
||||||
# This will print configuration
|
# This will print configuration
|
||||||
# travis-ci doesn't dump cmake version in system info, let's print it
|
# travis-ci doesn't dump cmake version in system info, let's print it
|
||||||
|
|
Loading…
Reference in New Issue