MantisBT - CMake
View Issue Details
0013661CMakeCTestpublic2012-11-08 06:242016-06-10 14:31
Kay-Uwe (Kiwi) Lorenz 
Kitware Robot 
normalmajoralways
closedmoved 
x64WindowsServer 2003
CMake 2.8.8 
 
0013661: If CTest terminates via abort() , it displays a message box waiting for user input
We use ctest in a fully automated non-interactive environment.

We now experienced ctest aborting in an unusual way using the "abort()"
system call. This results in a message box waiting for the user
pressing "OK". This is not the expected behaviour of a non-interactive program.

Default behaviour on windows of "abort()" is to display a message box

   ---------------------------
   Microsoft Visual C++ Runtime Library
   ---------------------------
   Runtime Error!

   Program: C:\Workspace\MyApp\Release\MyApp.exe

   abnormal program termination

   ---------------------------
   OK
   ---------------------------

And additionally the program exits with status code 3.

I would expect ctest only to stop with status code 3 without displaying this
annoying msg-box.

See http://stackoverflow.com/questions/9718695/how-can-i-supress-all-error-dialogs-when-a-process-crashes-i-only-want-it-to-cr [^] and http://msdn.microsoft.com/en-us/library/e631wekh.aspx [^] for solution.
No tags attached.
Issue History
2012-11-08 06:24Kay-Uwe (Kiwi) LorenzNew Issue
2012-11-08 08:30Brad KingNote Added: 0031487
2012-11-09 05:10Kay-Uwe (Kiwi) LorenzNote Added: 0031507
2012-11-09 08:36Brad KingNote Added: 0031509
2016-06-10 14:28Kitware RobotNote Added: 0042144
2016-06-10 14:28Kitware RobotStatusnew => resolved
2016-06-10 14:28Kitware RobotResolutionopen => moved
2016-06-10 14:28Kitware RobotAssigned To => Kitware Robot
2016-06-10 14:31Kitware RobotStatusresolved => closed

Notes
(0031487)
Brad King   
2012-11-08 08:30   
We already do this in at least some cases. See the call to BlockTestErrorDiagnostics and the implementation of it:

 http://cmake.org/gitweb?p=cmake.git;a=blob;f=Source/cmCTest.cxx;hb=v2.8.10#l472 [^]
 http://cmake.org/gitweb?p=cmake.git;a=blob;f=Source/cmCTest.cxx;hb=v2.8.10#l823 [^]

Errors are blocked when using one of the non-interactive test modes, such as:

 ctest -M Experimental -T Test

Is it CTest itself that exits with abort() in your case, or one of the tests?
(0031507)
Kay-Uwe (Kiwi) Lorenz   
2012-11-09 05:10   
Hi Brad,

this happens when running ctest in script mode for a custom test with subprojects. It happens right after submission. If running ctest with debug output, the last printed message is:
C:/cygwin/home/dashboard/CMakeReleaseDirectory/release/Source/CTest/cmCTestSubmitHandler.cxx:529 CURL output: [<cdash version="2.0.2">
  <status>OK</status>
  <message></message>
  <md5>8a005fb34d374e6d2630584dd48773f4</md5>
</cdash>
]

Then the this message box appears. It looks like this happens while closing curl connection.

Regards, Kiwi
(0031509)
Brad King   
2012-11-09 08:35   
The ctest_start command implementation calls cmCTest::SetTestModel here:

 http://cmake.org/gitweb?p=cmake.git;a=blob;f=Source/CTest/cmCTestStartCommand.cxx;hb=v2.8.10.1#l141 [^]

which should then disable interactive debug mode:

 http://cmake.org/gitweb?p=cmake.git;a=blob;f=Source/cmCTest.cxx;hb=v2.8.10.1#l835 [^]

Returning to the ctest_start implementation linked above it then calls cmCTest::InitializeFromCommand which then calls cmCTest::Initialize which then invokes the behavior linked in 0013661:0031487.

In other words, after ctest_start the diagnostics should be non-interactive.

You can also try using this option explicitly:

 ctest --interactive-debug-mode OFF ...
(0042144)
Kitware Robot   
2016-06-10 14:28   
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.