From 585be5a82e3d0d2b6756018c7d53f18f90228488 Mon Sep 17 00:00:00 2001 From: Jay Berkenbilt Date: Sat, 12 Mar 2022 07:59:12 -0500 Subject: Convert test-sanitizers to use cmake --- build-scripts/test-sanitizers | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) (limited to 'build-scripts') diff --git a/build-scripts/test-sanitizers b/build-scripts/test-sanitizers index 38170575..c3c314f9 100755 --- a/build-scripts/test-sanitizers +++ b/build-scripts/test-sanitizers @@ -2,16 +2,21 @@ set -e sudo apt-get update sudo apt-get -y install \ - autoconf build-essential zlib1g-dev libjpeg-dev libgnutls28-dev libssl-dev -./configure \ - CFLAGS="-fsanitize=address -fsanitize=undefined -g" \ - CXXFLAGS="-fsanitize=address -fsanitize=undefined -g" \ - LDFLAGS="-fsanitize=address -fsanitize=undefined" \ - CC=clang CXX="clang++ --std=c++14" \ - --enable-crypto-native --enable-crypto-openssl --enable-crypto-gnutls \ - --enable-werror --disable-shared --enable-show-failed-test-output -make -j$(nproc) -k -for i in $(./qpdf/build/qpdf --show-crypto); do - echo "*** Running tests with crypto provider $i" - env QPDF_CRYPTO_PROVIDER=$i make -k check + build-essential cmake \ + zlib1g-dev libjpeg-dev libgnutls28-dev libssl-dev +env CFLAGS="-fsanitize=address -fsanitize=undefined" \ + CXXFLAGS="-fsanitize=address -fsanitize=undefined" \ + LDFLAGS="-fsanitize=address -fsanitize=undefined" \ + CC=clang CXX=clang++ \ + cmake -S . -B build \ + -DCI_MODE=1 -DBUILD_SHARED_LIBS=0 -DCMAKE_BUILD_TYPE=Debug \ + -DREQUIRE_CRYPTO_OPENSSL=1 -DREQUIRE_CRYPTO_GNUTLS=1 +cmake --build build -j$(nproc) -- -k +cd build +# libtests automatically runs with all crypto providers. +ctest --verbose +# Run just qpdf tests with remaining crypto providers. +for i in $(./qpdf/qpdf --show-crypto | tail -n +2); do + echo "*** Running qpdf tests with crypto provider $i" + env QPDF_CRYPTO_PROVIDER=$i ctest --verbose -R '^qpdf$' done -- cgit v1.2.3-54-g00ecf