<div class="gmail_quote">On Fri, Aug 28, 2009 at 3:11 PM, Alex H <span dir="ltr"><<a href="mailto:aditya15417@hotmail.com">aditya15417@hotmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div>
Hello,<div><br></div><div>So where do we specify/put in the CMakeLists.txt where test1 is expected to fail or pass? <br>How does CTest knows this...</div></div></blockquote><div><br></div><div>If your program returns a 0, it passes. If it does not, it fails.</div>
<div><br></div><div>If you want to invert this logic, set the test property "WILL_FAIL".</div><div>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.</div>
<div><br></div><div>i.e.:</div><div>set_property(TEST test1 PROPERTY WILL_FAIL TRUE)</div><div>would invert the pass/fail logic</div><div><br></div><div>see also:</div><div><div>$ cmake --help-property WILL_FAIL</div><div>
$ cmake --help-property PASS_REGULAR_EXPRESSION<br></div><div>$ cmake --help-property FAIL_REGULAR_EXPRESSION<br></div><div>$ cmake --help-command set_property<br></div><div><br></div></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div><div>Just to clarify the add_test command should be put inside a CMakeLists.txt?</div></div></blockquote><div><br></div><div>Yes, that's correct.</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div><div>What if I want to invoke</div><div>ctest using the following command:</div><div><br></div><div>ctest -R testpage</div><div><br></div><div>What should testpage have inside of it?</div></div></blockquote><div><br>
</div><div>testpage should be the name of a test added using add_test. It can have *anything you want to test* inside of it....</div><div><br></div><div>ctest -R testpage will execute the test as specified in the add_test command.</div>
<div><br></div><div><br></div><div>HTH,</div><div>David</div><div><br></div></div>