[patch] cmake add_test

Alexander Neundorf neundorf at kde.org
Tue Sep 2 20:57:59 UTC 2008


On Friday 29 August 2008, Manuel Breugelmans wrote:
> On Thursday 28 August 2008 23:34:08 you wrote:
> > Currently some add_test do not get communicated correctly by the CMake
> > buildmanager. CMakeProjectVisitor overwrites target types if the
> > 'add_test' is in front the 'add_executable' for a test target. Attached a
> > patch that exposes the problem and fixes it.
> >
> > OK to commit this, Aliex/Matt?
>
> Right, totally forget the above, the problem is much worse. KDevelop's
> handling of 'add_test' linked to TestTargetItem is based on the assumption
> that there is always an actual CMake target (in the form of add_executable)
> around. This assumption is wrong :( I fear it is broken by design atm.
>
> According to the CMake manual `add_test(foo foo.exe -bla -blah)' just says:
> look, foo.exe is a test executable, please execute it with said flags.
> foo.exe needn't be built by the project at all. Indeed I suppose it's not
> uncommon to have test scripts.

I can confirm your interpretation is correct.
Without checking the ctest sources to make sure I remember correctly, but it 
should be roughly correct: ctest looks for foo.exe in some common locations 
in the build tree and if not found there also in the system wide locations.

Alex




More information about the KDevelop-devel mailing list