This is an archive of the discontinued LLVM Phabricator instance.

Get test executables compiling on Windows.
ClosedPublic

Authored by zturner on Aug 6 2014, 2:52 PM.

Details

Summary

Many of the test executables use pthreads directly. This isn't portable on Windows, so this patch converts these test to use C++11 threads and mutexes. Since Windows' implementation of std::thread classes throw and catch from header files, this patch also disables exceptions when compiling with clang on Windows.

Diff Detail

Event Timeline

zturner updated this revision to Diff 12256.Aug 6 2014, 2:52 PM
zturner retitled this revision from to Get test executables compiling on Windows..
zturner updated this object.
zturner edited the test plan for this revision. (Show Details)
zturner added a reviewer: emaste.
zturner added a subscriber: Unknown Object (MLST).
zturner updated this revision to Diff 12283.Aug 7 2014, 10:16 AM

Fixed some more places where tests don't compile on Windows.

emaste edited edge metadata.Aug 12 2014, 6:54 AM

A few minor nits, overall LGTM and still passes on FreeBSD.

test/expression_command/timeout/wait-a-while.cpp
8

git complained about trailing whitespace here

test/functionalities/attach_resume/Makefile
4

Perhaps a $(LPTHREAD) make var that is set to -lpthread or empty by an included header?

test/lldbtest.py
557

(Perhaps in a separate commit,) we should refactor the skipIf* decorators the same way I did expectedFailure*

test/make/Makefile.rules
84

probably clearer to put this with the other 32-bit cases below

test/make/uncaught_exception.h
6

Add newline

tfiala added a subscriber: tfiala.Aug 12 2014, 7:49 AM

Hey Zach,

I agree with Ed's comments. If you want to do any minor fixup there, I'll give the final a run on Linux (unless you want to do that part yourself - either way is fine).

zturner updated this revision to Diff 12414.Aug 12 2014, 1:12 PM
zturner edited edge metadata.

Fix issues pointed out in review. Also removed all instances of Makefiles directly including -lpthread for the link arguments. Instead, libraries now set ENABLE_THREADS := YES in the Makefile, which translates to the correct thing in Makefile.rules

Cool I'll give this a run over here this afternoon.

Cool I'll give this a run over here this afternoon.

Okay, so "this afternoon" => next morning. Sorry - looking at this now.

tfiala accepted this revision.Aug 13 2014, 7:09 AM
tfiala added a reviewer: tfiala.

Hey Zachary,

LGTM.

Tested:
Ubuntu 14.04 x86_64 - clang-built lldb.
MacOSX 10.9.4 - Xcode 6 Beta 5-built lldb.

Test Failures:
Unrelated - seeing TestCallStopAndContinue.py fail on both Linux and MacOSX occasionally both without and with the patch. Should not block.

This revision is now accepted and ready to land.Aug 13 2014, 7:09 AM
zturner closed this revision.Aug 13 2014, 10:54 AM
zturner updated this revision to Diff 12461.

Closed by commit rL215562 (authored by @zturner).

test/functionalities/attach_resume/Makefile