<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? <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 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>> Date: Fri, 28 Aug 2009 14:14:21 -0400<br>> Subject: Re: [CMake] Fwd: generating CTest tests<br>> From: drescherjm@gmail.com<br>> To: aditya15417@hotmail.com; cmake@cmake.org<br>> <br>> On Fri, Aug 28, 2009 at 2:07 PM, Alex H<aditya15417@hotmail.com> wrote:<br>> > Hello,<br>> > My problem is actually really simple I have a .cpp file and the program just<br>> > basically take an int as an argument, if the argument is from certain<br>> > numbers it returns a 1 otherwise 0.<br>> > Now I need to create a unit test that would allow me to do this... how can I<br>> > check the return value of the program? The add_test command just adds the<br>> > test to be performed using a<br>> > specific argument but it never tests the output...<br>> <br>> CMake automatically does this for you when you build the RUN_TESTS<br>> target on Visual Studio or do a make test on other systems<br>> <br>> Here is an example of the output of RUN_TESTS under visual studio 2005<br>> for the project I posted the CMakeLists.txt<br>> <br>> <br>> 1>Performing Post-Build Event...<br>> 1>Start processing tests<br>> 1>Test project X:/32Bit/VC.80/Qt/QtBasicUtils<br>> 1> 1/ 48 Testing FileCMD0 ..................... Passed 0.55 sec<br>> 1> 2/ 48 Testing FileCMD1 ..................... Passed 1.58 sec<br>> 1> 3/ 48 Testing Test0 ........................ Passed 0.17 sec<br>> 1> 4/ 48 Testing Test1 ........................ Passed 0.16 sec<br>> 1> 5/ 48 Testing StringListArg0 ............... Passed 0.06 sec<br>> 1> 6/ 48 Testing StringListArg1 ............... Passed 0.06 sec<br>> 1> 7/ 48 Testing StringListOpt0 ............... Passed 0.16 sec<br>> 1> 8/ 48 Testing StringListOpt1 ............... Passed 0.06 sec<br>> 1> 9/ 48 Testing BoolOpt1 ..................... Passed 0.16 sec<br>> 1> 10/ 48 Testing BoolOpt2 ..................... Passed 0.14 sec<br>> 1> 11/ 48 Testing ExtBoolOpt1 .................. Passed 0.25 sec<br>> 1> 12/ 48 Testing ExtBoolOpt2 .................. Passed 0.16 sec<br>> 1> 13/ 48 Testing ExtBoolOpt3 .................. Passed 0.06 sec<br>> 1> 14/ 48 Testing ExtBoolOpt4 .................. Passed 0.16 sec<br>> 1> 15/ 48 Testing ExtBoolOpt5 .................. Passed 0.17 sec<br>> 1> 16/ 48 Testing FloatArgs0 ................... Passed 0.19 sec<br>> 1> 17/ 48 Testing FloatArgs1 ................... Passed 0.06 sec<br>> 1> 18/ 48 Testing FloatArgs2 ................... Passed 0.16 sec<br>> 1> 19/ 48 Testing FloatArgs3 ................... Passed 0.16 sec<br>> 1> 20/ 48 Testing FloatArgs4 ................... Passed 0.16 sec<br>> 1> 21/ 48 Testing FloatArgs5 ................... Passed 0.16 sec<br>> 1> 22/ 48 Testing FloatArgs6 ................... Passed 0.14 sec<br>> 1> 23/ 48 Testing FloatArgs7 ................... Passed 0.16 sec<br>> 1> 24/ 48 Testing FloatArgs8 ................... Passed 1.30 sec<br>> 1> 25/ 48 Testing DoubleArgs0 .................. Passed 0.16 sec<br>> 1> 26/ 48 Testing DoubleArgs1 .................. Passed 0.16 sec<br>> 1> 27/ 48 Testing DoubleArgs2 .................. Passed 0.14 sec<br>> 1> 28/ 48 Testing DoubleArgs3 .................. Passed 0.19 sec<br>> 1> 29/ 48 Testing DoubleArgs4 .................. Passed 0.16 sec<br>> 1> 30/ 48 Testing DoubleArgs5 .................. Passed 0.06 sec<br>> 1> 31/ 48 Testing DoubleArgs6 .................. Passed 0.14 sec<br>> 1> 32/ 48 Testing DoubleArgs7 .................. Passed 0.16 sec<br>> 1> 33/ 48 Testing DoubleArgs8 .................. Passed 2.03 sec<br>> 1> 34/ 48 Testing XMLExport0 ................... Passed 0.17 sec<br>> 1> 35/ 48 Testing XMLExport1 ................... Passed 0.17 sec<br>> 1> 36/ 48 Testing XMLExport2 ................... Passed 0.14 sec<br>> 1> 37/ 48 Testing XMLExport3 ................... Passed 0.14 sec<br>> 1> 38/ 48 Testing XMLExport4 ................... Passed 0.14 sec<br>> 1> 39/ 48 Testing XMLExport5 ................... Passed 0.17 sec<br>> 1> 40/ 48 Testing XMLExport6 ................... Passed 0.14 sec<br>> 1> 41/ 48 Testing UserProp0 .................... Passed 0.14 sec<br>> 1> 42/ 48 Testing UserProp1 .................... Passed 0.16 sec<br>> 1> 43/ 48 Testing UserProp2 .................... Passed 0.06 sec<br>> 1> 44/ 48 Testing UserProp3 .................... Passed 0.14 sec<br>> 1> 45/ 48 Testing UserProp4 .................... Passed 0.16 sec<br>> 1> 46/ 48 Testing UserProp5 .................... Passed 0.14 sec<br>> 1> 47/ 48 Testing UserProp6 .................... Passed 0.22 sec<br>> 1> 48/ 48 Testing UserProp7 .................... Passed 0.14 sec<br>> 1>100% tests passed, 0 tests failed out of 48<br>> 1>Total CPU time = 11.78 sec<br>> 1>Build log was saved at<br>> "file://x:\32Bit\VC.80\Qt\QtBasicUtils\RUN_TESTS.dir\RelWithDebInfo\BuildLog.htm"<br>> 1>RUN_TESTS - 0 error(s), 0 warning(s)<br>> ========== 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>