summaryrefslogtreecommitdiffstats
path: root/debian/tests/pkg-config-test
diff options
context:
space:
mode:
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'