[CMake] make test

Alan W. Irwin irwin at beluga.phys.uvic.ca
Fri Mar 14 16:04:51 EDT 2008


On 2008-03-13 21:18-0400 David Cole wrote:

> For it to work, there has to be an "ENABLE_TESTING()" in the top level
> CMakeLists.txt file. And at least one ADD_TEST somewhere in the tree...
> "make test" should be equivalent to running "ctest" in the top level binary
> directory. (Or any sub-directory for that matter.)

Your reply and Rodolfo's subsequent success story inspired me to try and
find out why "make test" has always given zero results for PLplot while
ctest works fine.

It turns out there is some sort of clash between "make test" and our
subdirectory name called test. If I temporarily change our test subdirectory
name to something different, "make test" works for PLplot for the first
time.

We have been using the test subdirectory name for years so my preference is
not to change it, and I expect that is also a common subdirectory name for
other projects.  Is there some way CMake can be changed so there is no such
clash with such an obvious project subdirectory name?  I suspect that CMake
has simply forgotten to make the generated Makefile "test" target PHONY
(which gets rid of name clashes between Makefile targets and files).

Another concern with the current "make test" is it does not depend on the
default "all" target.  That is a bad oversight IMO, since the current
situation is you will be running out-of-date tests after some code fixup
unless you remember to run "make" before "make test".

Alan
__________________________
Alan W. Irwin

Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).

Programming affiliations with the FreeEOS equation-of-state implementation
for stellar interiors (freeeos.sf.net); PLplot scientific plotting software
package (plplot.org); the libLASi project (unifont.org/lasi); the Loads of
Linux Links project (loll.sf.net); and the Linux Brochure Project
(lbproject.sf.net).
__________________________

Linux-powered Science
__________________________


More information about the CMake mailing list