Strengthen pkg-test

* Define POINTERHOLDER_TRANSITION
* Make sure we are getting the intended version of qpdf
This commit is contained in:
Jay Berkenbilt 2022-09-10 09:24:12 -04:00
parent 93f176a2a0
commit 38cd94bec8
5 changed files with 32 additions and 8 deletions

View File

@ -382,11 +382,16 @@ pytest -n auto
* Run package tests:
cmake -S . -B build.tmp -DCMAKE_BUILD_TYPE=RelWithDebInfo
(Note: can't use DESTDIR because pkg-config won't know about it.)
\rm -rf /tmp/inst build.tmp
cmake -S . -B build.tmp \
-DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=/tmp/inst
cmake --build build.tmp -j$(nproc)
DESTDIR=/tmp/inst cmake --install build.tmp
env PKG_CONFIG_PATH=/tmp/inst/usr/local/lib/pkgconfig \
CMAKE_PREFIX_PATH=/tmp/inst/usr/local \
cmake --install build.tmp
env PKG_CONFIG_PATH=/tmp/inst/lib/pkgconfig \
LD_LIBRARY_PATH=/tmp/inst/lib \
CMAKE_PREFIX_PATH=/tmp/inst \
./pkg-test/run-all

View File

@ -1,3 +1,7 @@
#ifndef POINTERHOLDER_TRANSITION
# define POINTERHOLDER_TRANSITION 4
#endif
#include <qpdf/QPDF.hh>
#include <iostream>

View File

@ -11,7 +11,9 @@ if [ ! -d "$TMP" ]; then
exit 2
fi
qpdf --version
WANTED_VERSION=$(awk -F'"' '/#define QPDF_VERSION / {print $2}' include/qpdf/DLL.h)
qpdf --version | grep -F $WANTED_VERSION
qpdf --help
qpdf --check qpdf/qtest/qpdf/minimal.pdf
qpdf qpdf/qtest/qpdf/minimal.pdf --encrypt u o 256 -- $TMP/out.pdf

View File

@ -11,8 +11,14 @@ if [ ! -d "$TMP" ]; then
echo 1>&2 "Usage: $0 tmp-dir"
exit 2
fi
WANTED_VERSION=$(awk -F'"' '/#define QPDF_VERSION / {print $2}' include/qpdf/DLL.h)
cp pkg-test/qpdf-version.cc pkg-test/CMakeLists.txt $TMP
cd $TMP
cmake -S . -B build
cmake --build build
./build/qpdf-version
if [ "$(./build/qpdf-version)" != "$WANTED_VERSION" ]; then
echo 1>&2 "Failed to get correct qpdf version from cmake test"
exit 2
fi

View File

@ -13,11 +13,18 @@ if [ ! -d "$TMP" ]; then
exit 2
fi
WANTED_VERSION=$(awk -F'"' '/#define QPDF_VERSION / {print $2}' include/qpdf/DLL.h)
cp pkg-test/qpdf-version.cc $TMP
cd $TMP
pkg-config libqpdf --modversion
if [ "$(pkg-config libqpdf --modversion)" != "$WANTED_VERSION" ]; then
echo 1>&2 "Failed to get correct qpdf version from pkg-config --modversion"
fi
pkg-config libqpdf --libs --static
g++ qpdf-version.cc -o qpdf-version \
$(pkg-config libqpdf --cflags) \
$(pkg-config libqpdf --libs)
./qpdf-version
if [ "$(./qpdf-version)" != "$WANTED_VERSION" ]; then
echo 1>&2 "Failed to get correct qpdf version from pkg-config test"
exit 2
fi