On Tue, Mar 08, 2016 at 14:36:38 -0700, Kael Dai wrote: > 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.
Right, PASS_REGULAR_EXPRESSION is being set to "value1" and then to "value2". You can use set_property(TEST test1 APPEND) to append "value2" to the existing property value (or use "value1;value2" to set it at once). > 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. If any one matches, the test is considered to have passed. Maybe you want "value1.*value2;value2.*value1"? --Ben -- 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
