diff options
| author | David Kalnischkies <david@kalnischkies.de> | 2022-04-20 18:42:12 +0200 |
|---|---|---|
| committer | David Kalnischkies <david@kalnischkies.de> | 2022-05-07 10:45:44 +0200 |
| commit | a48a432223e9feb3e70b6d7dee09d035f594eeed (patch) | |
| tree | 288d396d34d91fc2498e1f459390769b78fb738c /debian/tests/pkg-config-test | |
| parent | 065c17440bd030341d7729c626dc732eff48ff7e (diff) | |
Mark pkg-config-test autopkgtest as superficial
Reorganising the control file allows this simple test to run first and
be marked as superficial which makes no practical difference, but is
more correct.
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' |
