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
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers

Reply via email to