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/control | 13 +++++++------ debian/tests/pkg-config-test | 31 ++++++++++++++++++++----------- 2 files changed, 27 insertions(+), 17 deletions(-) diff --git a/debian/tests/control b/debian/tests/control index 446f0afcc..e273b737f 100644 --- a/debian/tests/control +++ b/debian/tests/control @@ -1,10 +1,11 @@ -Tests: run-tests, pkg-config-test +Tests: pkg-config-test +Restrictions: superficial +Depends: libapt-pkg-dev, pkg-config + +Tests: run-tests Restrictions: allow-stderr Depends: @, @builddeps@, dpkg (>= 1.20.8), fakeroot, wget, stunnel4, lsof, db-util, - gnupg (>= 2) | gnupg2, - gnupg1 | gnupg (<< 2), - gpgv (>= 2) | gpgv2, - gpgv1 | gpgv (<< 2), + gnupg (>= 2) | gnupg2, gnupg1 | gnupg (<< 2), + gpgv (>= 2) | gpgv2, gpgv1 | gpgv (<< 2), libfile-fcntllock-perl, python3-apt, aptitude, - pkg-config, valgrind, gdb-minimal | gdb 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