<div dir="ltr">On Sun, Oct 12, 2008 at 12:14 PM, OvermindDL1 <span dir="ltr"><<a href="mailto:overminddl1@gmail.com">overminddl1@gmail.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="Ih2E3d">On Sun, Oct 12, 2008 at 11:13 AM, Keir Mierle <<a href="mailto:mierle@gmail.com">mierle@gmail.com</a>> wrote:<br>
> Justs to chime in: I'm one of the gtest devs. I'd like to add that gtest is<br>
> very portable, more so than llvm; it even works on WinCE and blackberry. If<br>
> there are specific features needed by LLVM, depending on what it is I may be<br>
> able to get it into gtest.<br>
<br>
</div>I noticed that gtest uses fork to test some code points (which is very<br>
useful in systems that abort() like llvm does), but fork() does not<br>
work in VC/win32/etc..., so how does it do it there, just relaunch a<br>
separate process and run just that test, but this time while running<br>
it and bailing out after that run is complete to let the main app know<br>
whether or not it succeeded?</blockquote><div><br>Forking is used for death tests, that show that a particular piece of code exits. For example,<br><br>ASSERT_DEATH(RunMyFunctionThatShouldDie(), "ASSERT FAILED: xxx");<br>
<br>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).<br>
 <br>Keir<br><br> <br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
<div><div></div><div class="Wj3C7c">_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
</div></div></blockquote></div><br></div>