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

Stefan Vigerske stefan at math.hu-berlin.de
Wed May 28 04:40:10 EDT 2008


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

-- 
Stefan Vigerske
Humboldt University Berlin, Numerical Mathematics
http://www.math.hu-berlin.de/~stefan


More information about the Project-managers mailing list