On Thu, 13 Apr 2023 13:13:10 +0200 Gianfranco Costamagna 
<locutusofb...@debian.org> wrote:
Hello,

What about starting with a really simple and easy basic testsuite?
(we can also maybe require build to make sure a other packages are not 
regressing the build testsuite!)

Tests: basic
Depends: libsdl2-dev, @builddeps@
Restrictions: build-needed


cat debian/tests/basic
#!/bin/sh

set -eux

if [ -n "${DEB_HOST_GNU_TYPE:-}" ]; then
     CROSS_COMPILE="$DEB_HOST_GNU_TYPE-"
else
     CROSS_COMPILE=
fi

"${CROSS_COMPILE}pkg-config" --cflags --libs sdl2


Hello Andrej!

This is what I came up.
Basically I tweak upstream testsuite to run against installed package, what do 
you think?

$ cat debian/tests/control
Tests: testsuite
Depends: kyua, pkg-config, pkgconf-bin, @builddeps@

Tests: basic
Depends: libsdl2-dev

$ cat debian/tests/basic
#!/bin/sh

set -eu

if [ -n "${DEB_HOST_GNU_TYPE:-}" ]; then
    CROSS_COMPILE="$DEB_HOST_GNU_TYPE-"
else
    CROSS_COMPILE=
fi

"${CROSS_COMPILE}pkg-config" --cflags --libs sdl2

$ cat debian/tests/testsuite
#!/bin/sh

cp * $AUTOPKGTEST_TMP -R
cd $AUTOPKGTEST_TMP

DEB_HOST_GNU_TYPE=$(dpkg-architecture -qDEB_HOST_GNU_TYPE)

autoreconf -fi 2> /dev/null
./configure 2> /dev/null

pcpath=$(cat /usr/share/pkgconfig/personality.d/$DEB_HOST_GNU_TYPE.personality |grep 
DefaultSearchPaths |cut -f 2 -d " ")
sed s#pcpath=.*#pcpath="$pcpath"#g -i tests/test_env.sh

rm -rf pkgconf pkg-config
cp /usr/bin/pkgconf .
cp /usr/bin/pkg-config .

kyua --config=none test --kyuafile=Kyuafile --build-root=.



This is the autopkgtest result

autopkgtest [19:51:01]: test basic: [-----------------------
-I/usr/include/SDL2 -D_REENTRANT -lSDL2
autopkgtest [19:51:02]: test basic: -----------------------]
autopkgtest [19:51:03]: test basic:  - - - - - - - - - - results - - - - - - - 
- - -
basic                PASS
autopkgtest [19:51:04]: @@@@@@@@@@@@@@@@@@@@ summary
testsuite            PASS
basic                PASS


Please let me know if we can upload!
I think this makes the package really stronger for us.

G.

Reply via email to