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

Laszlo Ladanyi ladanyi at us.ibm.com
Fri May 30 09:51:56 EDT 2008


If you use CoinUtils the there is no need now to change your configure.ac.

I put what Stefan has suggested into CoinUtils (trunk only). Just include 
CoinError.hpp in your source file containing main() and on the top of main() 
invoke the WindowsErrorPopupBlocker(); function.

On non-windows environment it works fine :-). Could someone test it on windows 
with and without the SDK?

Thanks,
--Laci

On Thu, 29 May 2008, Ted Ralphs wrote:

> 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
> _______________________________________________
> Project-managers mailing list
> Project-managers at list.coin-or.org
> http://list.coin-or.org/mailman/listinfo/project-managers
>


More information about the Project-managers mailing list