Bug#1029628: pkgconf: add testsuite from old pkg-config

2023-04-14 Thread Gianfranco Costamagna

On Thu, 13 Apr 2023 13:13:10 +0200 Gianfranco Costamagna 
 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 - - - - - - - 
- - -
basicPASS
autopkgtest [19:51:04]:  summary
testsuitePASS
basicPASS


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

G.



Bug#1029628: pkgconf: add testsuite from old pkg-config

2023-04-13 Thread Gianfranco Costamagna

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



OpenPGP_signature
Description: OpenPGP digital signature


Bug#1029628: pkgconf: add testsuite from old pkg-config

2023-01-26 Thread Gianfranco Costamagna

Hello,

 > ...
 > +# This is an intentionally invalid architecture.
 > +dpkg --add-architecture x86
 > +apt-get install sash

This also won’t work anymore.



I tried on my machine, and the three tests were working, but I should have 
missed something.

autopkgtest [07:18:29]: test invalid-arch: ---]
autopkgtest [07:18:29]: test invalid-arch:  - - - - - - - - - - results - - - - 
- - - - - -
invalid-arch PASS
autopkgtest [07:18:29]:  summary
crosswrapper FAIL non-zero exit status 1
foreign-arch FAIL non-zero exit status 1
invalid-arch PASS


In autopkgtest clean environment invalid-arch still passes, even though it is 
probably catching dpkg regressions
not pkg-config ones.

Do you still think we can add some sort of autopkgtest to check for basic 
functioning system?

G.


OpenPGP_signature
Description: OpenPGP digital signature


Bug#1029628: pkgconf: add testsuite from old pkg-config

2023-01-25 Thread Andrej Shadura
On Wed, 25 Jan 2023 17:45:48 +0100 Gianfranco Costamagna 
 wrote:

Source: pkgconf
Version: 1.8.1-1
tags: patch

Hello, I copy-pasted the testsuite from old src:pkg-config, and it looks still 
useful to catch some regressions.
Would it be possible to include it to make the package safer w.r.t. regressions 
and better?

And also to make it migrate in 2 days instead of 5!


Thanks for the idea, but I’m afraid this patch won’t work as it is.


diff -Nru pkgconf-1.8.1/debian/tests/control pkgconf-1.8.1/debian/tests/control
--- pkgconf-1.8.1/debian/tests/control  1970-01-01 01:00:00.0 +0100
+++ pkgconf-1.8.1/debian/tests/control  2023-01-25 17:27:59.0 +0100
@@ -0,0 +1,2 @@
+Tests: crosswrapper foreign-arch invalid-arch
+Restrictions: needs-root, allow-stderr


The crosswrapper is no more, so this needs to be done slightly differently.


diff -Nru pkgconf-1.8.1/debian/tests/foreign-arch 
pkgconf-1.8.1/debian/tests/foreign-arch
--- pkgconf-1.8.1/debian/tests/foreign-arch 1970-01-01 01:00:00.0 
+0100
+++ pkgconf-1.8.1/debian/tests/foreign-arch 2023-01-25 17:27:59.0 
+0100
@@ -0,0 +1,12 @@
+#! /bin/sh
+
+set -e
+
+dpkg --add-architecture i386


There isn’t a dpkg hook anymore, multiarch is used instead. This test 
would have to somehow install the correct multiarch version of the 
symlink-containing package.



diff -Nru pkgconf-1.8.1/debian/tests/invalid-arch 
pkgconf-1.8.1/debian/tests/invalid-arch
--- pkgconf-1.8.1/debian/tests/invalid-arch 1970-01-01 01:00:00.0 
+0100
+++ pkgconf-1.8.1/debian/tests/invalid-arch 2023-01-25 17:27:59.0 
+0100
@@ -0,0 +1,12 @@

> ...
> +# This is an intentionally invalid architecture.
> +dpkg --add-architecture x86
> +apt-get install sash

This also won’t work anymore.

--
Cheers,
  Andrej



Bug#1029628: pkgconf: add testsuite from old pkg-config

2023-01-25 Thread Gianfranco Costamagna

Source: pkgconf
Version: 1.8.1-1
tags: patch

Hello, I copy-pasted the testsuite from old src:pkg-config, and it looks still 
useful to catch some regressions.
Would it be possible to include it to make the package safer w.r.t. regressions 
and better?

And also to make it migrate in 2 days instead of 5!


diff -Nru pkgconf-1.8.1/debian/changelog pkgconf-1.8.1/debian/changelog
--- pkgconf-1.8.1/debian/changelog  2023-01-22 12:06:42.0 +0100
+++ pkgconf-1.8.1/debian/changelog  2023-01-25 17:28:03.0 +0100
@@ -1,3 +1,9 @@
+pkgconf (1.8.1-1.1) unstable; urgency=medium
+
+  * Add testsuite from pkg-config (See LP: #1998095, Closes: #-1)
+
+ -- Gianfranco Costamagna   Wed, 25 Jan 2023 
17:28:03 +0100
+
 pkgconf (1.8.1-1) unstable; urgency=high
 
   * New upstream release.

diff -Nru pkgconf-1.8.1/debian/tests/control pkgconf-1.8.1/debian/tests/control
--- pkgconf-1.8.1/debian/tests/control  1970-01-01 01:00:00.0 +0100
+++ pkgconf-1.8.1/debian/tests/control  2023-01-25 17:27:59.0 +0100
@@ -0,0 +1,2 @@
+Tests: crosswrapper foreign-arch invalid-arch
+Restrictions: needs-root, allow-stderr
diff -Nru pkgconf-1.8.1/debian/tests/crosswrapper 
pkgconf-1.8.1/debian/tests/crosswrapper
--- pkgconf-1.8.1/debian/tests/crosswrapper 1970-01-01 01:00:00.0 
+0100
+++ pkgconf-1.8.1/debian/tests/crosswrapper 2023-01-25 17:27:59.0 
+0100
@@ -0,0 +1,7 @@
+#! /bin/sh
+
+set -e
+
+ln -s /usr/share/pkg-config-crosswrapper 
$AUTOPKGTEST_TMP/i686-linux-gnu-pkg-config
+[ "$($AUTOPKGTEST_TMP/i686-linux-gnu-pkg-config --modversion pkg-config)" = 
"$(pkg-config --modversion pkg-config)" ]
+exit $?
diff -Nru pkgconf-1.8.1/debian/tests/foreign-arch 
pkgconf-1.8.1/debian/tests/foreign-arch
--- pkgconf-1.8.1/debian/tests/foreign-arch 1970-01-01 01:00:00.0 
+0100
+++ pkgconf-1.8.1/debian/tests/foreign-arch 2023-01-25 17:27:59.0 
+0100
@@ -0,0 +1,12 @@
+#! /bin/sh
+
+set -e
+
+dpkg --add-architecture i386
+
+if [ ! -x /usr/bin/i686-linux-gnu-pkg-config ]; then
+echo "cross symlink missing"
+echo "pkg-config symlinks found: $(find /usr/bin/ -name \*pkg-config)"
+exit 1
+fi
+exit 0
diff -Nru pkgconf-1.8.1/debian/tests/invalid-arch 
pkgconf-1.8.1/debian/tests/invalid-arch
--- pkgconf-1.8.1/debian/tests/invalid-arch 1970-01-01 01:00:00.0 
+0100
+++ pkgconf-1.8.1/debian/tests/invalid-arch 2023-01-25 17:27:59.0 
+0100
@@ -0,0 +1,12 @@
+#! /bin/sh
+
+# Test that the dpkg hook does not error for invalid dpkg archictures.
+# Regression test for 920553.
+
+set -e
+
+# This is an intentionally invalid architecture.
+dpkg --add-architecture x86
+apt-get install sash
+
+exit 0

G.
diff -Nru pkgconf-1.8.1/debian/changelog pkgconf-1.8.1/debian/changelog
--- pkgconf-1.8.1/debian/changelog	2023-01-22 12:06:42.0 +0100
+++ pkgconf-1.8.1/debian/changelog	2023-01-25 17:28:03.0 +0100
@@ -1,3 +1,9 @@
+pkgconf (1.8.1-1.1) unstable; urgency=medium
+
+  * Add testsuite from pkg-config (See LP: #1998095, Closes: #-1)
+
+ -- Gianfranco Costamagna   Wed, 25 Jan 2023 17:28:03 +0100
+
 pkgconf (1.8.1-1) unstable; urgency=high
 
   * New upstream release.
diff -Nru pkgconf-1.8.1/debian/tests/control pkgconf-1.8.1/debian/tests/control
--- pkgconf-1.8.1/debian/tests/control	1970-01-01 01:00:00.0 +0100
+++ pkgconf-1.8.1/debian/tests/control	2023-01-25 17:27:59.0 +0100
@@ -0,0 +1,2 @@
+Tests: crosswrapper foreign-arch invalid-arch
+Restrictions: needs-root, allow-stderr
diff -Nru pkgconf-1.8.1/debian/tests/crosswrapper pkgconf-1.8.1/debian/tests/crosswrapper
--- pkgconf-1.8.1/debian/tests/crosswrapper	1970-01-01 01:00:00.0 +0100
+++ pkgconf-1.8.1/debian/tests/crosswrapper	2023-01-25 17:27:59.0 +0100
@@ -0,0 +1,7 @@
+#! /bin/sh
+
+set -e
+
+ln -s /usr/share/pkg-config-crosswrapper $AUTOPKGTEST_TMP/i686-linux-gnu-pkg-config
+[ "$($AUTOPKGTEST_TMP/i686-linux-gnu-pkg-config --modversion pkg-config)" = "$(pkg-config --modversion pkg-config)" ]
+exit $?
diff -Nru pkgconf-1.8.1/debian/tests/foreign-arch pkgconf-1.8.1/debian/tests/foreign-arch
--- pkgconf-1.8.1/debian/tests/foreign-arch	1970-01-01 01:00:00.0 +0100
+++ pkgconf-1.8.1/debian/tests/foreign-arch	2023-01-25 17:27:59.0 +0100
@@ -0,0 +1,12 @@
+#! /bin/sh
+
+set -e
+
+dpkg --add-architecture i386
+
+if [ ! -x /usr/bin/i686-linux-gnu-pkg-config ]; then
+echo "cross symlink missing"
+echo "pkg-config symlinks found: $(find /usr/bin/ -name \*pkg-config)"
+exit 1
+fi
+exit 0
diff -Nru pkgconf-1.8.1/debian/tests/invalid-arch pkgconf-1.8.1/debian/tests/invalid-arch
--- pkgconf-1.8.1/debian/tests/invalid-arch	1970-01-01 01:00:00.0 +0100
+++ pkgconf-1.8.1/debian/tests/invalid-arch	2023-01-25 17:27:59.0 +0100
@@ -0,0 +1,12 @@
+#! /bin/sh
+
+# Test that the dpkg hook does not error for invalid dpkg archictures.
+# Regression test for 920553.
+
+set -e
+
+# This is an intentionally invalid architecture.
+dpkg --add-architecture