From a48a432223e9feb3e70b6d7dee09d035f594eeed Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Wed, 20 Apr 2022 18:42:12 +0200 Subject: 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. --- debian/tests/pkg-config-test | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) (limited to 'debian/tests/pkg-config-test') 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 < 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 < -#include +#include 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' -- cgit v1.2.3-70-g09d2