MantisBT - CMake
View Issue Details
0015619CMakeCTestpublic2015-06-16 18:412016-06-10 14:31
Clinton Stimpson 
Kitware Robot 
normalminoralways
closedmoved 
 
 
0015619: ctest stderr vs stdout
I have a ctest script which basically has:
ctest_start()
...
ctest_build()
ctest_test()

I invoke that script with
ctest -V -S my.ctest 1>mytest.stdout 2>mytest.stderr

And I'm hoping that mytest.stderr will contain only errors in my script, not build or test errors from within ctest_build() and ctest_test().

However, errors like
Unable to find executable: /path/to/executable
from ctest_test() can leak into the mytest.stderr if there are build errors.

I don't think that is expected behavior.
All in the same directory:

=== CMakeLists.txt ===
include (CTest)
add_test(NAME MyTest COMMAND nonexist_executable)

=== my.ctest ===
set(CTEST_SOURCE_DIRECTORY ${CMAKE_CURRENT_LIST_DIR})
set(CTEST_BINARY_DIRECTORY ${CMAKE_CURRENT_LIST_DIR})

ctest_start(Experimental)
ctest_test()

=== CTestConfig.cmake ===
<empty>


Then run
cmake .
ctest -V -S my.ctest 1> mytest.stdout 2> mytest.stderr

Look at the output of mytest.stdout and mytest.stderr

Also, mytest.stderr contains:
Error in read script: /home/cjstimp/cubit/cdash/test-ctest/my.ctest
However, the script itself did run successfully.
No tags attached.
Issue History
2015-06-16 18:41Clinton StimpsonNew Issue
2015-06-18 09:08Brad KingNote Added: 0038944
2016-06-10 14:29Kitware RobotNote Added: 0042798
2016-06-10 14:29Kitware RobotStatusnew => resolved
2016-06-10 14:29Kitware RobotResolutionopen => moved
2016-06-10 14:29Kitware RobotAssigned To => Kitware Robot
2016-06-10 14:31Kitware RobotStatusresolved => closed

Notes
(0038944)
Brad King   
2015-06-18 09:08   
> hoping that mytest.stderr will contain only errors in my script, not build or test errors

That makes sense. It would require a fairly tedious audit of the CTest source to address this though.
(0042798)
Kitware Robot   
2016-06-10 14:29   
Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.