[CMake] Fwd: generating CTest tests
Alex H
aditya15417 at hotmail.com
Fri Aug 28 18:58:15 EDT 2009
I am going to take an example from your a snippet test in your previous example:
ADD_TEST(XMLExport0 ${EXECUTABLE_OUTPUT_PATH}/BasicTest +XMLEXP 0)
ADD_TEST(XMLExport1 ${EXECUTABLE_OUTPUT_PATH}/BasicTest +XMLEXP 1)
ADD_TEST(XMLExport2 ${EXECUTABLE_OUTPUT_PATH}/BasicTest +XMLEXP 2)
ADD_TEST(XMLExport3 ${EXECUTABLE_OUTPUT_PATH}/BasicTest +XMLEXP 3)
ADD_TEST(XMLExport4 ${EXECUTABLE_OUTPUT_PATH}/BasicTest +XMLEXP 4)
ADD_TEST(XMLExport5 ${EXECUTABLE_OUTPUT_PATH}/BasicTest +XMLEXP 5)
ADD_TEST(XMLExport6 ${EXECUTABLE_OUTPUT_PATH}/BasicTest +XMLEXP 6)if this is put inside the CMakeLists.txt then if I want to run it as ctest -R testpagethen inside testing I should have an implementation of the test XMLExport0..up to XMLExport6??What language should testpage be written in? I guess that's the question.. I am confused what to put inside testpage, an example would help.
Date: Fri, 28 Aug 2009 15:27:43 -0400
Subject: Re: [CMake] Fwd: generating CTest tests
From: david.cole at kitware.com
To: aditya15417 at hotmail.com
CC: cmake at cmake.org
On Fri, Aug 28, 2009 at 3:11 PM, Alex H <aditya15417 at hotmail.com> 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 invokectest 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
_________________________________________________________________
Share your memories online with anyone you want.
http://www.microsoft.com/indonesia/windows/windowslive/products/photos-share.aspx?tab=1
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20090828/31d8c28e/attachment.htm>
More information about the CMake
mailing list