freaking1 / crashpad

Automatically exported from code.google.com/p/crashpad
0 stars 0 forks source link

Make all tests use MultiprocessExec (fork+exec) rather than Multiprocess (just fork) #7

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Most tests are currently based on Multiprocess which only forks. This isn't 
available on Windows, so we need some mechanism that'll work with CreateProcess.

The majority of tests are actually MachMultiprocess which is another subclass 
of Multiprocess (but not MultiprocessExec).

Some discussion here: 
https://groups.google.com/a/chromium.org/d/msg/crashpad-dev/dzi1zfnDmac/6vT7FAbw
hWcJ

So, we need to add some way to get main() of the test binary back to the 
child's entry point after the child process is spawned.

Original issue reported on code.google.com by scottmg@chromium.org on 8 Jan 2015 at 9:49

GoogleCodeExporter commented 9 years ago

Original comment by scottmg@chromium.org on 8 Jan 2015 at 10:21

GoogleCodeExporter commented 9 years ago
MachMultiprocess::MultiprocessChild needs a bit of reorganization to switch to 
Exec, the parent creates a service name that'll have to make it through to the 
child when not simply forkd.

Original comment by scottmg@chromium.org on 8 Jan 2015 at 10:35

GoogleCodeExporter commented 9 years ago
The thread Scott linked to captures all of the details, but in my mind, the 
salient point that relates to this bug was this:

> My current thinking is that each test executable (like client_test) that needs
> it could pick something out of its argv that told it to run the child side of
> a test. The various different child sides would be registered with static
> initializers similar to how the gtest TEST() macro works.

Original comment by mark@chromium.org on 8 Jan 2015 at 10:39

GoogleCodeExporter commented 9 years ago
(I made a first pass at that here https://codereview.chromium.org/844713002 in 
util/test/test_entry_point.h, but I'm still trying to work out how to 
restructure the users of it.)

Original comment by scottmg@chromium.org on 8 Jan 2015 at 10:42

GoogleCodeExporter commented 9 years ago
Somewhere between WontFix and Fixed.

I don't love the current Windows multiprocess test code, but we can at least 
run all the tests we need to run.

Original comment by scottmg@chromium.org on 3 Sep 2015 at 9:46