[Project-managers] turn off windows popups in failing unit tests

Ted Ralphs ted at lehigh.edu
Thu May 29 16:13:23 EDT 2008


Hi Stefan,

This is implemented for SYMPHONY in both trunk and stable. I have built 
it successfully under Msys with gcc 4.2. MinGW helpfully includes its 
own implementation of the windows.h header file, which was successfully 
found during configuration, and the unit test built properly, but a 
window still popped up when I induced a seg fault. I'm not sure if this 
is supposed to work with MinGW or only with Visual C++. I can't test 
with Visual C++, since I don't have the SDK installed. Let me know what 
you find.

Cheers,

Ted

Stefan Vigerske wrote:
> Hi,
> 
> from time to time, a unit tests are crashing. In Windows, this often 
> results in a popup window which the user is then expected to click away.
> This behaviour is especially annoying when one wants to run nightly 
> tests of COIN-OR projects, since these popups block the whole process of 
> fetching-building-testing projects.
> 
> Therefore, I would like to suggest to add some lines of code to the 
> beginning of each unit test program that turns off these popups.
> The necessary function call would be
>    SetErrorMode(SEM_FAILCRITICALERRORS | SEM_NOGPFAULTERRORBOX);
> for which windows.h need to be included.
> 
> However, since this presumes that windows.h is present on the system, 
> which is not the case for every windows system, a proper way should be 
> to check for windows.h in the configure script, i.e., one would add
> AC_CHECK_HEADERS([windows.h])
> to configure.ac (note that it is HEADERS, not HEADER), and
> 
> #ifdef HAVE_WINDOWS_H
> #include <windows.h>
> #endif
> 
> ...
> 
> int main(...) {
> #ifdef HAVE_WINDOWS_H
>    SetErrorMode(SEM_FAILCRITICALERRORS | SEM_NOGPFAULTERRORBOX);
> #endif
> }
> 
> 
> I would appreciate if some project managers could try these 
> modifications in the trunk versions of their projects. :-)
> The nightly build scripts are currently testing
> CoinUtils, Clp, Osi, DyLP, SYMPHONY, Vol, Cgl, Cbc, Smi, FlopC++, Ipopt, 
> Bonmin, OS, CppAD, CoinAll, LaGO, GAMSlinks.
> 
> Thank you,
> Stefan
> 


-- 
Dr. Ted Ralphs
Associate Professor
Industrial and Systems Engineering
Lehigh University
(610)758-4784
ted at lehigh dot edu
coral.ie.lehigh.edu/~ted


More information about the Project-managers mailing list