[CMake] runtime error of ctest in windows VS2005

Xi LIANG liangxi1986317 at hotmail.com
Fri Jan 8 00:45:39 EST 2010


Dear Eric,
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.
Regards,

--------------------------------
Xi Liang

梁茜
--------------------------------




> Date: Wed, 6 Jan 2010 08:31:48 +0100
> Subject: Re: [CMake] runtime error of ctest in windows VS2005
> From: eric.noulard at gmail.com
> To: liangxi1986317 at hotmail.com
> CC: cmake at cmake.org; insight-users at itk.org
> 
> 2010/1/6 Xi LIANG <liangxi1986317 at hotmail.com>:
> > Dear all,
> > Im using Windows and the compiler is VS2005. I wrote a CMakeLists.txt file
> > to run a image registration program, which generates a executable named as
> > FFD_3D_mask.exe. This executable takes  some arguments as names of input and
> > output files. The CMake file is written as the following, and it runs
> > properly and the generated executable also works fine by inputing the
> > arguments manually in the command window.
> > -----------------
> > cmake_minimum_required(VERSION 2.8)
> >
> > PROJECT(FFD_3D_mask)
> > FIND_PACKAGE(ITK)
> > IF(ITK_FOUND)
> > INCLUDE(${ITK_USE_FILE})
> > ELSE(ITK_FOUND)
> > MESSAGE(FATAL_ERROR
> > "ITK not found. Please se t ITK_DIR.")
> > ENDIF(ITK_FOUND)
> > ADD_EXECUTABLE(FFD_3D_mask FFD_3D_mask.cxx )
> > TARGET_LINK_LIBRARIES(FFD_3D_mask ITKCommon ITKIO ITKNumerics ITKStatistics)
> > ------------
> > Then I tried to automatically run the executable, without having to type the
> > arguments manually everytime. Then I added the following lines. I build the
> > executable first, and then build the RUN_TEST. The test is failed, and the
> > error message is attached. I am not sure whether the code I wrote was wrong,
> > or didnt build the test properly?
> 
> First I would avoid calling your test "RUN_TEST" knowing that the
> CMake generated
> target is called "RUN_TESTS" this can lead to confusion at most.
> May be "GenMaskTest" or something more meaningfull would be good.
> 
> However this shouldn't be the problem root.
> 
> The default behavior of ctest is to check the returned value of the executable
> is your executable returning something different from 0 when it succeed?
> 
> You said the test is failing but from what you give us we can only tell that
> C Test believe the test is failing, however could you check whether if the test
> is producing the expected files?
> 
> Did you look at the failed log inside
> build\RUN_TESTS.dir\Debug\?
> 
> I don't know how to do it from within Visual Studio but if you open a
> command line prompt
> and change dir to you build dir:
> file://c:\MRI\ITK\test\Registrati on\Deformable\3D_mask\build
> 
> you may try to run ctest manually with verbose option:
> 
> ctest -VV
> 
> this should show you more details on the execution.
> 
> -- 
> Erk
> Membre de l'April - « promouvoir et défendre le logiciel libre » -
> http://www.april.org
 		 	   		  
_________________________________________________________________
Windows Live: Friends get your Flickr, Yelp, and Digg updates when they e-mail you.
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20100108/7ac13f96/attachment.htm>


More information about the CMake mailing list