Issue 126787 - fix unit tests on windows
Summary: fix unit tests on windows
Status: CLOSED FIXED
Alias: None
Product: Build Tools
Classification: Code
Component: code (show other issues)
Version: 4.2.0-dev
Hardware: All Windows, all
: P5 (lowest) Normal (vote)
Target Milestone: 4.2.0
Assignee: AOO issues mailing list
QA Contact:
URL:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2016-01-12 20:44 UTC by j.nitschke
Modified: 2016-10-23 13:19 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: 4.2.0-dev
Developer Difficulty: ---


Attachments
remove prewin.h and postwin.h in sal unittests (7.13 KB, patch)
2016-01-12 20:44 UTC, j.nitschke
j.nitschke: review?
Details | Diff

Note You need to log in before you can comment on or make changes to this issue.
Description j.nitschke 2016-01-12 20:44:35 UTC
Created attachment 85248 [details]
remove prewin.h and postwin.h in sal unittests

build process on windows is currently broken[1]
some unit tests in sal includes headers from tools which depends on sal (circular dependencies)[2]
said headers are prewin.h and postwin.h which frame windows.h includes

I got no win build environment, but looking at the files I don't think they are needed for the basic functionality sal (system abstraction layer) provides
would be happy to know if someone knows more about prewin and postwin

here a patch which removes the includes
if someone with a win build environment could test it or if no time let our buildbot do the work. would be great

[1] https://ci.apache.org/builders/aoo-win7/builds/139
[2] https://mail-archives.apache.org/mod_mbox/openoffice-dev/201512.mbox/%3C56804CDE.2020201%40ok.de%3E

note: all this is related to the work in Issue 125003 - Integrate GoogleTest unit test framework for general usage in the build environment
Comment 1 damjan 2016-01-28 00:48:01 UTC
I probably added the patch that causes this problem in commit 1710853 with this message:

Fix some main/sal unit tests on Windows, remove unneeded OOO_SUBSEQUENT_TESTS,
and run all that pass during the build.

In order words, this patch was what fixed building unit tests in Windows; I am not sure why it is breaking for you. I'll do an "svn update" and rebuild from scratch, then report back with the details of my build environment.
Comment 2 damjan 2016-01-28 18:07:58 UTC
I can reproduce the problem on Windows, and your patch fixes it. I didn't catch it before because I didn't do an incompatible rebuild so the previously built tools was being used.

Patch committed in revision 1727413. Thank you very much for your contribution!

#i126787# fix unit tests on Windows

Fix a regression caused by r1710853 and which always existed in some files,
where <prewin.h> and <postwin.h> were being included before and after
<windows.h>, yet unavailable as the tools module isn't built (and can't be)
before sal.

Patch by: j.nitschke at ok.de
Review by: me