summaryrefslogtreecommitdiffstats
path: root/debian/tests/pkg-config-test
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 09:00:48 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 09:00:48 +0000
commit3d8888c70266f612d1f427a112cc1e2155c19584 (patch)
tree3f799cdc23480c7afe9c5ff6632b545da1f17dec /debian/tests/pkg-config-test
parentAdding upstream version 2.6.1. (diff)
downloadapt-3d8888c70266f612d1f427a112cc1e2155c19584.tar.xz
apt-3d8888c70266f612d1f427a112cc1e2155c19584.zip
Adding debian version 2.6.1.debian/2.6.1debian
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'debian/tests/pkg-config-test')
-rw-r--r--debian/tests/pkg-config-test32
1 files changed, 32 insertions, 0 deletions
diff --git a/debian/tests/pkg-config-test b/debian/tests/pkg-config-test
new file mode 100644
index 0000000..e074b16
--- /dev/null
+++ b/debian/tests/pkg-config-test
@@ -0,0 +1,32 @@
+#!/bin/sh
+set -e
+
+if [ -z "$AUTOPKGTEST_TMP" ]; then
+ WORKDIR=''
+ cleanup() {
+ if [ -n "$WORKDIR" ]; then cd /; rm -rf -- "$WORKDIR"; fi
+ WORKDIR=''
+ }
+ trap 'cleanup' 0 HUP INT QUIT ILL ABRT FPE SEGV PIPE TERM
+ WORKDIR="$(mktemp -d)"
+ cd "$WORKDIR"
+else
+ cd "$AUTOPKGTEST_TMP"
+fi
+
+cat >pkgconfigtest.cc <<EOF
+#include <apt-pkg/init.h>
+#include <cstdio>
+
+int main()
+{
+ printf("APT Version: %s\n", pkgVersion);
+ return 0;
+}
+EOF
+
+g++ -Wall -Wextra -o pkgconfigtest pkgconfigtest.cc `pkg-config --cflags --libs apt-pkg`
+echo 'build: OK'
+test -x pkgconfigtest
+./pkgconfigtest
+echo 'run: OK'