<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
--></style>
</head>
<body class='hmmessage'>
Dear Eric,<div><br></div><div>Thank you for your explanation. I think the mistake I made was that ctest is used to compare the generated result with the expect result, such that the return value 1 means that the program runs fine. However, what I was trying to do is just to automatically run the executable with parameters. From what you said, I guess I cannot use ctest to do this, and instead I need to write script to do so.</div><div><br></div><div>Regards,<br><br>--------------------------------<br>Xi Liang<br><br>梁茜<br>--------------------------------<br><br><br><br><br>> Date: Wed, 6 Jan 2010 08:31:48 +0100<br>> Subject: Re: [CMake] runtime error of ctest in windows VS2005<br>> From: eric.noulard@gmail.com<br>> To: liangxi1986317@hotmail.com<br>> CC: cmake@cmake.org; insight-users@itk.org<br>> <br>> 2010/1/6 Xi LIANG <liangxi1986317@hotmail.com>:<br>> > Dear all,<br>> > Im using Windows and the compiler is VS2005. I wrote a CMakeLists.txt file<br>> > to run a image registration program, which generates a executable named as<br>> > FFD_3D_mask.exe. This executable takes some arguments as names of input and<br>> > output files. The CMake file is written as the following, and it runs<br>> > properly and the generated executable also works fine by inputing the<br>> > arguments manually in the command window.<br>> > -----------------<br>> > cmake_minimum_required(VERSION 2.8)<br>> ><br>> > PROJECT(FFD_3D_mask)<br>> > FIND_PACKAGE(ITK)<br>> > IF(ITK_FOUND)<br>> > INCLUDE(${ITK_USE_FILE})<br>> > ELSE(ITK_FOUND)<br>> > MESSAGE(FATAL_ERROR<br>> > "ITK not found. Please se t ITK_DIR.")<br>> > ENDIF(ITK_FOUND)<br>> > ADD_EXECUTABLE(FFD_3D_mask FFD_3D_mask.cxx )<br>> > TARGET_LINK_LIBRARIES(FFD_3D_mask ITKCommon ITKIO ITKNumerics ITKStatistics)<br>> > ------------<br>> > Then I tried to automatically run the executable, without having to type the<br>> > arguments manually everytime. Then I added the following lines. I build the<br>> > executable first, and then build the RUN_TEST. The test is failed, and the<br>> > error message is attached. I am not sure whether the code I wrote was wrong,<br>> > or didnt build the test properly?<br>> <br>> First I would avoid calling your test "RUN_TEST" knowing that the<br>> CMake generated<br>> target is called "RUN_TESTS" this can lead to confusion at most.<br>> May be "GenMaskTest" or something more meaningfull would be good.<br>> <br>> However this shouldn't be the problem root.<br>> <br>> The default behavior of ctest is to check the returned value of the executable<br>> is your executable returning something different from 0 when it succeed?<br>> <br>> You said the test is failing but from what you give us we can only tell that<br>> C Test believe the test is failing, however could you check whether if the test<br>> is producing the expected files?<br>> <br>> Did you look at the failed log inside<br>> build\RUN_TESTS.dir\Debug\?<br>> <br>> I don't know how to do it from within Visual Studio but if you open a<br>> command line prompt<br>> and change dir to you build dir:<br>> file://c:\MRI\ITK\test\Registrati on\Deformable\3D_mask\build<br>> <br>> you may try to run ctest manually with verbose option:<br>> <br>> ctest -VV<br>> <br>> this should show you more details on the execution.<br>> <br>> -- <br>> Erk<br>> Membre de l'April - « promouvoir et défendre le logiciel libre » -<br>> http://www.april.org<br></div>                                            <br /><hr />Windows Live: <a href='http://www.microsoft.com/middleeast/windows/windowslive/see-it-in-action/social-network-basics.aspx?ocid=PID23461::T:WLMTAGL:ON:WL:en-xm:SI_SB_3:092010' target='_new'>Friends get your Flickr, Yelp, and Digg updates when they e-mail you.</a></body>
</html>