On Fri, Aug 28, 2009 at 3:11 PM, Alex H <[email protected]> wrote:
> Hello, > So where do we specify/put in the CMakeLists.txt where test1 is expected to > fail or pass? > How does CTest knows this... > If your program returns a 0, it passes. If it does not, it fails. If you want to invert this logic, set the test property "WILL_FAIL". If you want to base the pass/fail value on test output, set the test property "PASS_REGULAR_EXPRESSION" or "FAIL_REGULAR_EXPRESSION" : if the output matches the regex, it passes or fails accordingly. i.e.: set_property(TEST test1 PROPERTY WILL_FAIL TRUE) would invert the pass/fail logic see also: $ cmake --help-property WILL_FAIL $ cmake --help-property PASS_REGULAR_EXPRESSION $ cmake --help-property FAIL_REGULAR_EXPRESSION $ cmake --help-command set_property > Just to clarify the add_test command should be put inside a CMakeLists.txt? > Yes, that's correct. > What if I want to invoke > ctest using the following command: > > ctest -R testpage > > What should testpage have inside of it? > testpage should be the name of a test added using add_test. It can have *anything you want to test* inside of it.... ctest -R testpage will execute the test as specified in the add_test command. HTH, David
_______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake
