On 05 Jun 2020 19:02, Petter Reinholdtsen wrote:
> 
> I discovered what the problem is.  The test [ $res ] do not work the way
> you want it to.  It need to compare with 0, like this:

Which is kind of strange, and makes autopkgtest very hard to use since
this works fine when run locally like so:

        # cd <package-root-dir>
        # autopkgtest -- null

Everything passes when run this way.  Easy fix now that you've pointed
it out, but passing strange.

> diff --git a/debian/tests/test01 b/debian/tests/test01
> index 1c0d63f..73e1fac 100755
> --- a/debian/tests/test01
> +++ b/debian/tests/test01
> @@ -1,4 +1,5 @@
>  #!/bin/sh
> +
>  cd debian/tests
>  
>  echo "info: compiling"
> @@ -7,7 +8,7 @@ echo "info: compiling"
>  echo "info: running"
>  cmp -s test01.exp $AUTOPKGTEST_TMP/test01.act
>  res=$?
> -if [ $res ] ; then
> +if [ 0 = $res ] ; then
>      echo "success: test01 produced proper results"
>  else
>      echo "error: test01 did not produce proper results"
> diff --git a/debian/tests/test02 b/debian/tests/test02
> index fb85d2e..cb4359d 100755
> --- a/debian/tests/test02
> +++ b/debian/tests/test02
> @@ -7,7 +7,7 @@ echo "info: compiling"
>  echo "info: running"
>  cmp -s test02.exp $AUTOPKGTEST_TMP/test02.act
>  res=$?
> -if [ $res ] ; then
> +if [ 0 == $res ] ; then
>      echo "success: test02 produced proper results"
>  else
>      echo "error: test02 did not produce proper results"
> diff --git a/debian/tests/test03 b/debian/tests/test03
> index c028d8b..07d679c 100755
> --- a/debian/tests/test03
> +++ b/debian/tests/test03
> @@ -7,7 +7,7 @@ echo "info: compiling"
>  echo "info: running"
>  cmp -s test03.exp $AUTOPKGTEST_TMP/test03.act
>  res=$?
> -if [ $res ] ; then
> +if [ 0 == $res ] ; then
>      echo "success: test03 produced proper results"
>  else
>      echo "error: test03 did not produce proper results"
> diff --git a/debian/tests/test04 b/debian/tests/test04
> index fd2a6ad..ee31d4a 100755
> --- a/debian/tests/test04
> +++ b/debian/tests/test04
> @@ -7,7 +7,7 @@ echo "info: compiling"
>  echo "info: running"
>  cmp -s test04.exp t$AUTOPKGTEST_TMP/est04.act
>  res=$?
> -if [ $res ] ; then
> +if [ 0 == $res ] ; then
>      echo "success: test04 produced proper results"
>  else
>      echo "error: test04 did not produce proper results"
> 
> -- 
> Happy hacking
> Petter Reinholdtsen
> 

-- 
Ciao,
al
----------------------------------------------------------------------
Al Stone                                         Debian Developer
E-mail: a...@ahs3.net                            http://www.debian.org
                                                 a...@debian.org
----------------------------------------------------------------------

Reply via email to