> This breaks the build for me since I build the source package on bookworm > (via gbp). I might hold off on this one until dh-builtusing is backported.
Passing -nc to dpkg-buildpackage may fix this, see https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1054125 Else, there is no problem with postponing the change. Dh-builtusing is convenient but not necessary. > > Subject: [PATCH 12/14] Various minor improvements in the test driver > > test $1 = 2 > This is kind of obscure, think of the (lack of an) error message. If we > skip this we'll get an "undefined $2" error due to set -u, which I find is > more helpful than a quiet exit rv>0. Please use the attached commit instead.
>From 610cb15f44cf9c9d1f582a816f1deefe63ac26a1 Mon Sep 17 00:00:00 2001 From: Nicolas Boulenguez <nico...@debian.org> Date: Thu, 5 Oct 2023 14:39:35 +0200 Subject: [PATCH 1/3] Various minor improvements in the test driver Enable more alerts by the shell. Check the argument count. Replace test cascades with 'case' constructs. There is no need to create RUNDIR because the script is called after a 'make install'. There is no need to check that the RUNDIR variable is not empty, it is set in all branches of the previous construct. --- debian/tests/ghdl-tests | 48 ++++++++++++++++++++--------------------- 1 file changed, 23 insertions(+), 25 deletions(-) diff --git a/debian/tests/ghdl-tests b/debian/tests/ghdl-tests index 5868e16c..9ef0a66d 100755 --- a/debian/tests/ghdl-tests +++ b/debian/tests/ghdl-tests @@ -1,39 +1,38 @@ #!/bin/sh -set -e +set -C -e -f -u # The pyunit tests are not run here. These parts are not activated in # Debian yet. TESTS="sanity gna vests synth vpi vhpi" +error() { + echo >&2 "$0: $1" + exit 1 +} -if [ "$2" = mcode ]; then - BACKEND=mcode -elif [ "$2" = llvm ]; then - BACKEND=llvm -elif [ "$2" = gcc ]; then - BACKEND=gcc -else - echo >&2 "Invalid backend specification" - exit 1 -fi +test $# = 2 || error "bad argument count: $#" -if [ "$1" = buildtest ]; then +case "$2" in + gcc|llvm|mcode) + BACKEND=$2 + ;; + *) + error "invalid backend specification: $2" +esac + +case "$1" in + buildtest) RUNDIR=testrundir/$BACKEND - mkdir -p "$RUNDIR" GHDL="$PWD/$RUNDIR/usr/bin/ghdl-$BACKEND" -elif [ "$1" = autopkgtest ]; then + ;; + autopkgtest) RUNDIR="$AUTOPKGTEST_TMP" GHDL=/usr/bin/ghdl-$BACKEND -else - echo >&2 "Invalid test environment specification" - exit 1 -fi - -if [ -z "$RUNDIR" ]; then - echo >&2 "RUNDIR is empty string" - exit 1 -fi + ;; + *) + error "invalid test environment specification: $1" +esac # Copy testsuite into $RUNDIR to execute there, so that no cleanup is necessary # (entire $RUNDIR will be deleted later). Also copy src/grt as at least one test @@ -54,6 +53,5 @@ if ./testsuite.sh $TESTS -- --keep-going; then elif test $BACKEND = llvm; then echo "Tests for backend llvm failed (but ignored for now)." else - echo >&2 "Tests for backend $BACKEND failed." - exit 1 + error "tests for backend $BACKEND failed." fi -- 2.39.2