MantisBT - CMake
View Issue Details
0005785CMakeCMakepublic2007-09-26 12:502008-05-01 10:22
ufnoise 
Brad King 
normalminoralways
closedfixed 
 
 
0005785: cmake fails to run tests if the file "test" exists.
A proper gnu makefile would mark the test target as phony. Looking at
the gnu makefile generated by one of my cmake projects, test is not marked as
phony. If a file named test exists, then the tests will no longer run. Example below.

Please mark test, install, and any other dummy target as PHONY in the generated Makefile.


If I "touch test", the test no longer runs. If I add
the PHONY target to the Makefile. The tests still run.

 ~/bar> make test

Running tests...
Start processing tests
Test project /home/juans/bar
  1/ 1 Testing foo Passed

100% tests passed, 0 tests failed out of 1
 ~/bar> make test
Running tests...
Start processing tests
Test project /home/juans/bar
  1/ 1 Testing foo Passed

100% tests passed, 0 tests failed out of 1
 ~/bar> touch test
 ~/bar> make test
 ~/bar>

 ~/bar> echo ".PHONY: test" >> Makefile

 ~/bar> make test
Running tests...
Start processing tests
Test project /home/juans/bar
  1/ 1 Testing foo Passed



No tags attached.
Issue History
2007-09-26 12:50ufnoiseNew Issue
2007-09-26 13:47JustinNote Added: 0009301
2007-10-12 09:48Bill HoffmanStatusnew => assigned
2007-10-12 09:48Bill HoffmanAssigned To => Brad King
2008-05-01 10:22Brad KingStatusassigned => closed
2008-05-01 10:22Brad KingNote Added: 0011644
2008-05-01 10:22Brad KingResolutionopen => fixed

Notes
(0009301)
Justin   
2007-09-26 13:47   
This is also a problem if a directory named "test" exists.
(0011644)
Brad King   
2008-05-01 10:22   
The "test" target is properly marked as PHONY by the upcoming CMake 2.6.0 release.