#924052 debhelper: dh_auto_test should prefer 'make check' over 'make test'

#924052#5
Date:
2019-03-08 21:34:44 UTC
From:
To:
Dear Maintainer,

If a package is built using make, dh_auto_test should prefer to run
'make check' (which is the GNU standard [1]) rather than 'make test'.

This is doubly true for packages that use automake [2], but I think it
would make sense for all packages using makefiles.

The reason I see for preferring 'make check' is that it's common to
have a test program named 'test.c', 'test.sh', etc., and thus 'make
test' is an instruction to compile the test program rather than to run
it.  I suspect that this (combined with the fact that old versions of
make didn't support the notion of phony targets) is the reason for
GNU's choice of 'make check'.

That is to say, I suspect 'check' was chosen deliberately because it
was (and is) a less common term, and thus less ambiguous.

Note, I'm not proposing that dh_auto_test should ignore the 'test'
target; rather, in cases where *both* 'test' and 'check' are defined
(possibly by implicit rules), 'check' is the one that should be used
by default.

A third possibility would be to run 'make test check', on the
assumption that it's unlikely to be harmful to run both targets.
('make test check' would be better than 'make test && make check',
since the makefile might define the two as aliases of each other.)

There is of course no way to have a single rule that works for every
package.  However, my suspicion is:

- Packages for which 'make check' runs the test suite, and 'make test'
  incidentally does something different, are more common than packages
  for which 'make test' runs the test suite, and 'make check'
  incidentally does something different.

- The least surprising behavior would be to follow the behavior of
  automake and the GNU standards.

The second point is a matter of opinion, but the first is in principle
a testable hypothesis...


[1] GNU Coding Standards: Standard Targets for Users
https://www.gnu.org/prep/standards/html_node/Standard-Targets.html

[2] Automake manual: Support for test suites
https://www.gnu.org/software/automake/manual/html_node/Tests.html

#924052#10
Date:
2023-03-28 12:39:32 UTC
From:
To:
Dear Maintainer,

I second the request by Benjamin.

According to the interesting discussion on a very near subject for igraph [1],
VSCode and cmake appear to attribute a different purpose to the target `test`.

For packaging igraph I set a workaround in the `d/rules`.
However, I guess that the `test` and `check` targets must be considered to have
different purposes according to some current standards.
That is, they are not interchangeable.

hth,
Jerome

[1] https://github.com/igraph/igraph/issues/2290