[LLVMdev] 2.4 Pre-release (v1) Available for Testing
mierle at gmail.com
Sun Oct 12 14:24:15 PDT 2008
On Sun, Oct 12, 2008 at 12:14 PM, OvermindDL1 <overminddl1 at gmail.com> wrote:
> On Sun, Oct 12, 2008 at 11:13 AM, Keir Mierle <mierle at gmail.com> wrote:
> > Justs to chime in: I'm one of the gtest devs. I'd like to add that gtest
> > very portable, more so than llvm; it even works on WinCE and blackberry.
> > there are specific features needed by LLVM, depending on what it is I may
> > able to get it into gtest.
> I noticed that gtest uses fork to test some code points (which is very
> useful in systems that abort() like llvm does), but fork() does not
> work in VC/win32/etc..., so how does it do it there, just relaunch a
> separate process and run just that test, but this time while running
> it and bailing out after that run is complete to let the main app know
> whether or not it succeeded?
Forking is used for death tests, that show that a particular piece of code
exits. For example,
ASSERT_DEATH(RunMyFunctionThatShouldDie(), "ASSERT FAILED: xxx");
This causes gtest to fork and run with special flags that runs only the
death test, then the resulting stdout is searched for the regex specified as
the 2nd argument. fork() is only used for death tests. I rarely use death
tests, though they are useful in some contexts. I believe it is possible to
add support for death tests on windows, but it is nontrivial (by using
CreateProcess and friends).
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the llvm-dev