[LLVMdev] 2.4 Pre-release (v1) Available for Testing

Keir Mierle 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
> is
> > very portable, more so than llvm; it even works on WinCE and blackberry.
> If
> > there are specific features needed by LLVM, depending on what it is I may
> be
> > 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
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20081012/02bef8d9/attachment.html>

More information about the llvm-dev mailing list