[CMake] Batch Files in CTest (instead executables)

Michael Wild themiwi at gmail.com
Wed Mar 31 09:16:57 EDT 2010


Why on earth is it so bad to have a trailing line with "--- YAY TEST PASSED ---" (or something like this) in the output of ctest -V?

On 31. Mar, 2010, at 15:04 , David Graf wrote:

> Hello
> 
> But this is also not a solution for me. Our testdriver prints some debugging information that can be seen if ctest is executed with the -V option. Therefore, it is impossible to echo SUCCESS or FAILED.
> 
> David
> 
> On Mar 31, 2010, at 1:23 PM, Michael Wild wrote:
> 
>> 
>> On 31. Mar, 2010, at 11:47 , David Graf wrote:
>> 
>>> Hello Michael
>>> 
>>>> Instead of checking the exit status, you could have CTest check the output for success or failure. Have a look at SET_TESTS_PROPERTIES.
>>> 
>>> Unfortunately, that doesn't work in our case. We are running a testdriver for the result checking. There reason is: Our tests produce xml and XML cannot be compared like a string. It must be translated into canonical form before it can be compared. We wrote this part in C++. Therefore, we cannot do the comparison in CMake.
>>> 
>>> David
>> 
>> What I meant is this to output a string from your batch script:
>> 
>> SETLOCAL
>> SET PATH=...;%PATH%
>> execute_something.exe
>> IF %ERRORLEVEL% neq 0 ( 
>> ECHO "FAILED"
>> ) ELSE (
>> ECHO "SUCCESS"
>> )
>> ENDLOCAL
>> 
>> 
>> Michael
> 



More information about the CMake mailing list