[Project-managers] turn off windows popups in failing unit tests
Laszlo Ladanyi
ladanyi at us.ibm.com
Sun Jun 1 09:35:45 EDT 2008
Done. I hope this fixes JP's problem as well.
Seems that there are very valid technical reason to avoid the PSDK...
especially including windows.h...
Cheers,
--Laci
On Sun, 1 Jun 2008, Stefan Vigerske wrote:
> Hi,
>
> with the updated CoinUtils trunk I got problems building Couenne and DyLP (as
> part of Osi) with Visual Studio 2003.
> There seem to be more defines coming in by windows.h that conflict with
> enum's in COIN codes.
> Is it possible to move the include of windows.h from CoinError.hpp into a
> source file, like CoinError.cpp?
>
> The problem I got are
> c:\cygwin\home\svigerske\BuildDir-cl\Bonmin\trunk\Couenne\src\expression\CouenneTypes.hpp(14)
> : error C2144: syntax error : 'const int' should be preceded by '}'
> c:\cygwin\home\svigerske\BuildDir-cl\Bonmin\trunk\Couenne\src\expression\CouenneTypes.hpp(14)
> : error C2143: syntax error : missing ';' before '}'
> c:\cygwin\home\svigerske\BuildDir-cl\Bonmin\trunk\Couenne\src\expression\CouenneTypes.hpp(14)
> : error C2059: syntax error : '}'
> where line 14 of CouenneTypes.hpp is
> enum nodeType {CONST=0, VAR, UNARY, N_ARY, COPY, AUX, EMPTY};
> I think CONST could be defined somewhere in a header included by windows.h
>
> And with DyLP I get a conflict about LCID:
> C:\cygwin\home\svigerske\BuildDir-cl\OS\trunk\DyLP\src\DylpStdLib\dylib_io.h(67)
> : error C2365: 'LCID' : redefinition; previous definition was a 'typedef'
> C:\Program Files\Microsoft Visual Studio .NET
> 2003\Vc7\PlatformSDK\Include\WinNT.h(404) : see declaration of 'LCID'
>
>
> Thanks,
> Stefan
>
> Laszlo Ladanyi schrieb:
>> 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