aboutsummaryrefslogtreecommitdiffstats
path: root/pkg-test
diff options
context:
space:
mode:
Diffstat (limited to 'pkg-test')
-rw-r--r--pkg-test/README.md13
-rwxr-xr-xpkg-test/test-cli2
-rwxr-xr-xpkg-test/test-cmake2
-rwxr-xr-xpkg-test/test-pkg-config2
4 files changed, 11 insertions, 8 deletions
diff --git a/pkg-test/README.md b/pkg-test/README.md
index 95f7ecb8..6426388a 100644
--- a/pkg-test/README.md
+++ b/pkg-test/README.md
@@ -2,13 +2,16 @@
The files in this directory are called by autopkgtest in the debian package but can be used by any packager to verify installed packages. Each test-* script should be run from the top of the source tree and takes an empty directory as its single argument. The test passes if the script exits with a zero exit status. Note that these tests write to stderr because they use set -x in the shell.
-On a GNU/Linux system, you can run `./pkg-test/run-all` from the top-level directory to run all the tests. For example:
+On a GNU/Linux system, you can run `./pkg-test/run-all` from the top-level directory to run all the tests. Note that you have to specify an altrenative install prefix rather than using DESTDIR since, otherwise, pkg-config won't find the packages. For example:
```
-cmake -S . -B build
+cmake -S . -B build \
+ -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=/tmp/inst
cmake --build build -j$(nproc)
-DESTDIR=/tmp/inst cmake --install build
-env PKG_CONFIG_PATH=/tmp/inst/usr/local/lib/pkgconfig \
- CMAKE_PREFIX_PATH=/tmp/inst/usr/local \
+cmake --install build
+env PKG_CONFIG_PATH=/tmp/inst/lib/pkgconfig \
+ LD_LIBRARY_PATH=/tmp/inst/lib \
+ CMAKE_PREFIX_PATH=/tmp/inst \
+ PATH=/tmp/inst/bin:$PATH \
./pkg-test/run-all
```
diff --git a/pkg-test/test-cli b/pkg-test/test-cli
index f69e546a..a88f8fb3 100755
--- a/pkg-test/test-cli
+++ b/pkg-test/test-cli
@@ -11,7 +11,7 @@ if [ ! -d "$TMP" ]; then
exit 2
fi
-WANTED_VERSION=$(awk -F'"' '/#define QPDF_VERSION / {print $2}' include/qpdf/DLL.h)
+WANTED_VERSION=$(awk -F'"' '/# *define QPDF_VERSION / {print $2}' include/qpdf/DLL.h | tail -n 1)
qpdf --version | grep -F $WANTED_VERSION
qpdf --help
diff --git a/pkg-test/test-cmake b/pkg-test/test-cmake
index 868ce363..580da370 100755
--- a/pkg-test/test-cmake
+++ b/pkg-test/test-cmake
@@ -13,7 +13,7 @@ if [ ! -d "$TMP" ]; then
exit 2
fi
-WANTED_VERSION=$(awk -F'"' '/#define QPDF_VERSION / {print $2}' include/qpdf/DLL.h)
+WANTED_VERSION=$(awk -F'"' '/# *define QPDF_VERSION / {print $2}' include/qpdf/DLL.h | tail -n 1)
cp pkg-test/qpdf-version.cc pkg-test/CMakeLists.txt $TMP
cd $TMP
diff --git a/pkg-test/test-pkg-config b/pkg-test/test-pkg-config
index 4c46a59c..cbc0d133 100755
--- a/pkg-test/test-pkg-config
+++ b/pkg-test/test-pkg-config
@@ -12,7 +12,7 @@ if [ ! -d "$TMP" ]; then
exit 2
fi
-WANTED_VERSION=$(awk -F'"' '/#define QPDF_VERSION / {print $2}' include/qpdf/DLL.h)
+WANTED_VERSION=$(awk -F'"' '/# *define QPDF_VERSION / {print $2}' include/qpdf/DLL.h | tail -n 1)
cp pkg-test/qpdf-version.cc $TMP
cd $TMP