<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
</style>
</head>
<body class='hmmessage'>
Hello,<div><br></div><div>So where do we specify/put in the CMakeLists.txt where test1 is expected to fail or pass?&nbsp;<br>How does CTest knows this...</div><div><br></div><div>Just to clarify the add_test command should be put inside a CMakeLists.txt? What if I want to invoke</div><div>ctest using the following &nbsp;command:</div><div><br></div><div>ctest -R testpage</div><div><br></div><div>What should testpage have inside of it?</div><div><br></div><div>Alex H.<br><div></div><br><br>&gt; Date: Fri, 28 Aug 2009 14:14:21 -0400<br>&gt; Subject: Re: [CMake] Fwd: generating CTest tests<br>&gt; From: drescherjm@gmail.com<br>&gt; To: aditya15417@hotmail.com; cmake@cmake.org<br>&gt; <br>&gt; On Fri, Aug 28, 2009 at 2:07 PM, Alex H&lt;aditya15417@hotmail.com&gt; wrote:<br>&gt; &gt; Hello,<br>&gt; &gt; My problem is actually really simple I have a .cpp file and the program just<br>&gt; &gt; basically take an int as an argument, if the argument is from certain<br>&gt; &gt; numbers it returns a 1 otherwise 0.<br>&gt; &gt; Now I need to create a unit test that would allow me to do this... how can I<br>&gt; &gt; check the return value of the program? The add_test command just adds the<br>&gt; &gt; test to be performed using a<br>&gt; &gt; specific argument but it never tests the output...<br>&gt; <br>&gt; CMake automatically does this for you when you build the RUN_TESTS<br>&gt; target on Visual Studio or do a make test on other systems<br>&gt; <br>&gt; Here is an example of the output of RUN_TESTS under visual studio 2005<br>&gt; for the project I posted the CMakeLists.txt<br>&gt; <br>&gt; <br>&gt; 1&gt;Performing Post-Build Event...<br>&gt; 1&gt;Start processing tests<br>&gt; 1&gt;Test project X:/32Bit/VC.80/Qt/QtBasicUtils<br>&gt; 1&gt;  1/ 48 Testing FileCMD0 .....................   Passed    0.55 sec<br>&gt; 1&gt;  2/ 48 Testing FileCMD1 .....................   Passed    1.58 sec<br>&gt; 1&gt;  3/ 48 Testing Test0 ........................   Passed    0.17 sec<br>&gt; 1&gt;  4/ 48 Testing Test1 ........................   Passed    0.16 sec<br>&gt; 1&gt;  5/ 48 Testing StringListArg0 ...............   Passed    0.06 sec<br>&gt; 1&gt;  6/ 48 Testing StringListArg1 ...............   Passed    0.06 sec<br>&gt; 1&gt;  7/ 48 Testing StringListOpt0 ...............   Passed    0.16 sec<br>&gt; 1&gt;  8/ 48 Testing StringListOpt1 ...............   Passed    0.06 sec<br>&gt; 1&gt;  9/ 48 Testing BoolOpt1 .....................   Passed    0.16 sec<br>&gt; 1&gt; 10/ 48 Testing BoolOpt2 .....................   Passed    0.14 sec<br>&gt; 1&gt; 11/ 48 Testing ExtBoolOpt1 ..................   Passed    0.25 sec<br>&gt; 1&gt; 12/ 48 Testing ExtBoolOpt2 ..................   Passed    0.16 sec<br>&gt; 1&gt; 13/ 48 Testing ExtBoolOpt3 ..................   Passed    0.06 sec<br>&gt; 1&gt; 14/ 48 Testing ExtBoolOpt4 ..................   Passed    0.16 sec<br>&gt; 1&gt; 15/ 48 Testing ExtBoolOpt5 ..................   Passed    0.17 sec<br>&gt; 1&gt; 16/ 48 Testing FloatArgs0 ...................   Passed    0.19 sec<br>&gt; 1&gt; 17/ 48 Testing FloatArgs1 ...................   Passed    0.06 sec<br>&gt; 1&gt; 18/ 48 Testing FloatArgs2 ...................   Passed    0.16 sec<br>&gt; 1&gt; 19/ 48 Testing FloatArgs3 ...................   Passed    0.16 sec<br>&gt; 1&gt; 20/ 48 Testing FloatArgs4 ...................   Passed    0.16 sec<br>&gt; 1&gt; 21/ 48 Testing FloatArgs5 ...................   Passed    0.16 sec<br>&gt; 1&gt; 22/ 48 Testing FloatArgs6 ...................   Passed    0.14 sec<br>&gt; 1&gt; 23/ 48 Testing FloatArgs7 ...................   Passed    0.16 sec<br>&gt; 1&gt; 24/ 48 Testing FloatArgs8 ...................   Passed    1.30 sec<br>&gt; 1&gt; 25/ 48 Testing DoubleArgs0 ..................   Passed    0.16 sec<br>&gt; 1&gt; 26/ 48 Testing DoubleArgs1 ..................   Passed    0.16 sec<br>&gt; 1&gt; 27/ 48 Testing DoubleArgs2 ..................   Passed    0.14 sec<br>&gt; 1&gt; 28/ 48 Testing DoubleArgs3 ..................   Passed    0.19 sec<br>&gt; 1&gt; 29/ 48 Testing DoubleArgs4 ..................   Passed    0.16 sec<br>&gt; 1&gt; 30/ 48 Testing DoubleArgs5 ..................   Passed    0.06 sec<br>&gt; 1&gt; 31/ 48 Testing DoubleArgs6 ..................   Passed    0.14 sec<br>&gt; 1&gt; 32/ 48 Testing DoubleArgs7 ..................   Passed    0.16 sec<br>&gt; 1&gt; 33/ 48 Testing DoubleArgs8 ..................   Passed    2.03 sec<br>&gt; 1&gt; 34/ 48 Testing XMLExport0 ...................   Passed    0.17 sec<br>&gt; 1&gt; 35/ 48 Testing XMLExport1 ...................   Passed    0.17 sec<br>&gt; 1&gt; 36/ 48 Testing XMLExport2 ...................   Passed    0.14 sec<br>&gt; 1&gt; 37/ 48 Testing XMLExport3 ...................   Passed    0.14 sec<br>&gt; 1&gt; 38/ 48 Testing XMLExport4 ...................   Passed    0.14 sec<br>&gt; 1&gt; 39/ 48 Testing XMLExport5 ...................   Passed    0.17 sec<br>&gt; 1&gt; 40/ 48 Testing XMLExport6 ...................   Passed    0.14 sec<br>&gt; 1&gt; 41/ 48 Testing UserProp0 ....................   Passed    0.14 sec<br>&gt; 1&gt; 42/ 48 Testing UserProp1 ....................   Passed    0.16 sec<br>&gt; 1&gt; 43/ 48 Testing UserProp2 ....................   Passed    0.06 sec<br>&gt; 1&gt; 44/ 48 Testing UserProp3 ....................   Passed    0.14 sec<br>&gt; 1&gt; 45/ 48 Testing UserProp4 ....................   Passed    0.16 sec<br>&gt; 1&gt; 46/ 48 Testing UserProp5 ....................   Passed    0.14 sec<br>&gt; 1&gt; 47/ 48 Testing UserProp6 ....................   Passed    0.22 sec<br>&gt; 1&gt; 48/ 48 Testing UserProp7 ....................   Passed    0.14 sec<br>&gt; 1&gt;100% tests passed, 0 tests failed out of 48<br>&gt; 1&gt;Total CPU time =  11.78 sec<br>&gt; 1&gt;Build log was saved at<br>&gt; "file://x:\32Bit\VC.80\Qt\QtBasicUtils\RUN_TESTS.dir\RelWithDebInfo\BuildLog.htm"<br>&gt; 1&gt;RUN_TESTS - 0 error(s), 0 warning(s)<br>&gt; ========== Build: 1 succeeded, 0 failed, 1 up-to-date, 0 skipped ==========<br></div><br /><hr />Share your memories online with anyone you want <a href='http://www.microsoft.com/indonesia/windows/windowslive/products/photos-share.aspx?tab=1' target='_new'>anyone you want.</a></body>
</html>