2
1
mirror of https://github.com/qpdf/qpdf.git synced 2024-12-23 03:18:59 +00:00
qpdf/build-scripts/test-sanitizers
Jay Berkenbilt cef6425bca Disable QTC inside the library by default (fixes #714)
This results in measurable performance improvements to packaged binary
libqpdf distributions. QTC remains available for library users and is
still selectively enabled in CI.
2022-08-07 16:20:49 -04:00

24 lines
861 B
Bash
Executable File

#!/bin/bash
set -e
sudo apt-get update
sudo apt-get -y install \
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 \
-DENABLE_QTC=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