[cmake-developers] set_test_properties ignoring multiple properties

Nils Gladitz nilsgladitz at gmail.com
Tue Mar 8 17:31:58 EST 2016


On 08.03.2016 22:36, Kael Dai wrote:
> Hi,
>
> I have a test that outputs multiple lines and want to use 
> set_tests_properties with the PASS_REGULAR_EXPRESSION property to 
> check different lines in the output. I've tried doing
>
> set_tests_properties(test1 PROPERTIES PASS_REGULAR_EXPRESSION "value1" 
> PASS_REGULAR_EXPRESSION "value2")
>
> I've also tried to split up the properties
>
> set_tests_properties(test1 PROPERTIES PASS_REGULAR_EXPRESSION "value1")
> set_tests_properties(test1 PROPERTIES PASS_REGULAR_EXPRESSION "value2")
>
> In both cases, ctest is ignoring the test of "value1" and only 
> checking if "value2" passes or not.
>
> Is there any way to check multiple regular expression on the same test 
> and check them all? The documentation for 3.1 seems to suggest you 
> can, but it isn't working when building the tests.

The current documentation has an example on how to set the property with 
multiple values:
https://cmake.org/cmake/help/v3.5/prop_test/PASS_REGULAR_EXPRESSION.html

set_tests_properties() does not append to existing properties; it 
replaces them.
If you do want to append you can use set_property() with the APPEND 
keyword instead.

Nils
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20160308/492d1b56/attachment.html>


More information about the cmake-developers mailing list