diff options
Diffstat (limited to 'debian/tests/pkg-config-test')
| -rw-r--r-- | debian/tests/pkg-config-test | 31 |
1 files changed, 20 insertions, 11 deletions
diff --git a/debian/tests/pkg-config-test b/debian/tests/pkg-config-test index 1e4ec141e..e074b1603 100644 --- a/debian/tests/pkg-config-test +++ b/debian/tests/pkg-config-test @@ -1,23 +1,32 @@ #!/bin/sh - set -e -WORKDIR=$(mktemp -d) -trap "rm -rf $WORKDIR" 0 INT QUIT ABRT PIPE TERM -cd $WORKDIR -cat <<EOF > pkgconfigtest.c +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 <stdio.h> +#include <cstdio> int main() { - printf("Apt Version: %s \n", pkgVersion); + printf("APT Version: %s\n", pkgVersion); return 0; } EOF -g++ -o pkgconfigtest pkgconfigtest.c `pkg-config --cflags --libs apt-pkg` -echo "build: OK" -[ -x pkgconfigtest ] +g++ -Wall -Wextra -o pkgconfigtest pkgconfigtest.cc `pkg-config --cflags --libs apt-pkg` +echo 'build: OK' +test -x pkgconfigtest ./pkgconfigtest -echo "run: OK" +echo 'run: OK' |
