cygport test has zero exit status on failures

Jason Pyeron jpyeron@pdinc.us
Mon May 17 22:29:34 GMT 2021


> -----Original Message-----
> From: ASSI
> Sent: Monday, May 10, 2021 1:06 AM
> 
> Jason Pyeron writes:
> > Cygport test is not returning a non zero exit status on failure! Is
> > this expected?
> 
> Yes, it is using 'make -k' under the hood.  Again, if you need to do
> something else than what the standard invocation provides, you would
> generally write your own src_test() function.

$ cat -n /usr/share/cygport/lib/src_test.cygpart
<snip/>
    33  cygtest() {
    34          if [ -e Makefile -o -e GNUmakefile -o -e makefile ]
    35          then
    36                  if make -n check &> /dev/null
    37                  then
    38                          make -k check || true
    39                  elif make -n test &> /dev/null
    40                  then
    41                          make -k test || true
    42                  else
    43                          inform "No testsuite detected.";
    44                  fi
    45          else
    46                  inform "No testsuite detected.";
    47          fi
    48  }
<snip/>

What is the historic rationale behind the "OR true" after the make check?

It seems silly to have to redefine src_test() as {
        cd ${B}
        make check
}, just to have a failure exit code if the test fail. It seems to have come in at https://github.com/cygwin/cygport/commit/ef93794f35de38b28f473b8f14c4a9e5a4a4a5a6 and never changed since. The commit does not indicate why the exit status is suppressed.

-Jason



More information about the Cygwin-apps mailing list