[cmake-developers] Tests directory layout (was: valgrind errors)

Rolf Eike Beer eike at sf-mail.de
Fri Jan 20 13:16:09 EST 2012


David Cole wrote:
> On Fri, Jan 20, 2012 at 7:51 AM, Rolf Eike Beer <eike at sf-mail.de> wrote:
> >> On Fri, Jan 20, 2012 at 2:07 AM, Rolf Eike Beer <eike at sf-mail.de> wrote:

>>>> This introduced a new directory Tests/Syntax and a first tests
>>>> there. It does
>>>> 
>>>>  if (NOT foo bar STREQUAL "foo bar")
>>>> 
>>>> and triggers this error, which now does not use an unitinialized 
>>>> variable anymore. Since it's a clear syntax error I set it to be a
>>>> FATAL_ERROR. I think we should put more such tests in there, would easily
>>>> allow us to increase coverage as e.g. in cmIfCommand many error branches
>>>> are currently not part of the coverage.
>>> 
>>> Instead of inventing an entirely new location for this one line
>>> case...... it should be added in "Tests/CMakeTests" -- there are a
>>> bunch of tests of syntax-related mistakes in there.
>>> 
>>> See, for example, the files FileTestScript.cmake and
>>> StringTestScript.cmake.
>>> 
>>> The macro execute_all_script_tests actually parses such scripts and
>>> uses the "# pass" / "# fail" comments to know whether a given
>>> if/elseif clause is expected to pass or fail.
>>> 
>>> The one thing it can't handle though, is mismatched if's, ...
>>> 
>>> However, regardless of whether you can blend in with an existing test
>>> or not, I think "Tests/CMakeTests" is the right location for further
>>> CMake syntax related tests.
>> 
>> I'll happily move this to any place where it fits.
>> 
>> Is there any documentation on how these testcases should be structured?
>> I currently only see a lot of tests, but nothing like a readme file telling
>> me things like "if your script does only a cmake configure run but
>> nothing more CMakeOnly is the place you look for".

> No documentation about tests. Discussion on this list is the closest
> proxy for such docs.

What I currently know is:

-if tests run in CMake script mode, they should go in CMakeTests
-if they need to run CMake in configure mode, but don't build anything, they 
should go in CMakeOnly
-if they test something from the Modules directory, but do not belong to one 
of the previous 2 cases, they should go in Modules

Correct? Anything else?

Where should such a list go? Tests/README? Wiki?

Eike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20120120/be8c1d36/attachment.sig>


More information about the cmake-developers mailing list