exit 0
fi
+if [ "${OPJ_CI_CC:-}" != "" ]; then
+ export CC=${OPJ_CI_CC}
+ echo "Using ${CC}"
+fi
+
+if [ "${OPJ_CI_CXX:-}" != "" ]; then
+ export CXX=${OPJ_CI_CXX}
+ echo "Using ${CXX}"
+fi
+
# Set-up some variables
if [ "${OPJ_CI_BUILD_CONFIGURATION:-}" == "" ]; then
export OPJ_CI_BUILD_CONFIGURATION=Release #default
else
echo "Compiler not supported: ${CC}"; exit 1
fi
+ if [ "${OPJ_CI_INSTRUCTION_SETS-:}" == "-mavx2" ]; then
+ AVX2_AVAIL=1
+ cat /proc/cpuinfo | grep avx2 >/dev/null || AVX2_AVAIL=0
+ if [[ "${AVX2_AVAIL}" == "1" ]]; then
+ echo "AVX2 available on CPU"
+ else
+ echo "AVX2 not available on CPU. Disabling tests"
+ cat /proc/cpuinfo | grep flags | head -n 1
+ export OPJ_CI_SKIP_TESTS=1
+ fi
+ fi
elif [ "${TRAVIS_OS_NAME}" == "windows" ]; then
OPJ_OS_NAME=windows
if which cl > /dev/null; then
OPJ_CC_VERSION=vs????
fi
fi
+ if [ "${OPJ_CI_INSTRUCTION_SETS-:}" == "/arch:AVX2" ]; then
+ cl $PWD/tools/travis-ci/detect-avx2.c
+ if ./detect-avx2.exe; then
+ echo "AVX2 available on CPU"
+ else
+ echo "AVX2 not available on CPU. Disabling tests"
+ export OPJ_CI_SKIP_TESTS=1
+ fi
+ fi
else
echo "OS not supported: ${TRAVIS_OS_NAME}"; exit 1
fi
# ignore ctest exit code & parse this ourselves
set +x
+
+
+if [ "${OPJ_CI_CHECK_STYLE:-}" == "1" ]; then
+ export OPJSTYLE=${PWD}/scripts/opjstyle
+ export PATH=${HOME}/.local/bin:${PATH}
+ scripts/verify-indentation.sh
+fi
+
+
# Deployment if needed
#---------------------
if [ "${TRAVIS_TAG:-}" != "" ]; then
fi
fi
+if [ "${OPJ_CI_BUILD_FUZZERS:-}" == "1" ]; then
+ cd tests/fuzzers
+ make
+ cd ../..
+fi
+
if [ "${OPJ_CI_PERF_TESTS:-}" == "1" ]; then
cd tests/performance
echo "Running performance tests on current version (dry-run)"
cd ../..
fi
+if [ "${OPJ_CI_PROFILE:-}" == "1" ]; then
+ rm -rf build_gprof
+ mkdir build_gprof
+ cd build_gprof
+ # We need static linking for gprof
+ cmake "-DCMAKE_C_FLAGS=-pg -O3" -DCMAKE_EXE_LINKER_FLAGS=-pg -DCMAKE_SHARED_LINKER_FLAGS=-pg -DBUILD_SHARED_LIBS=OFF ..
+ make -j3
+ cd ..
+ build_gprof/bin/opj_decompress -i data/input/nonregression/kodak_2layers_lrcp.j2c -o out.tif > /dev/null
+ echo "Most CPU consuming functions:"
+ gprof build_gprof/bin/opj_decompress gmon.out | head || true
+
+ rm -f massif.out.*
+ valgrind --tool=massif build/bin/opj_decompress -i data/input/nonregression/kodak_2layers_lrcp.j2c -o out.tif >/dev/null 2>/dev/null
+ echo ""
+ echo "Memory consumption profile:"
+ python tests/profiling/filter_massif_output.py massif.out.*
+fi
+
exit ${OPJ_CI_RESULT}