Mark Mentovai
22350bd676
In tests, use ASSERT_NO_FATAL_FAILURE() instead of checking
...
testing::Test::HasFatalFailure() after calling functions that could fail
fatally.
Inspired by
https://codereview.chromium.org/637503006/diff/20001/minidump/minidump_thread_writer_test.cc#newcode437
TEST=client_test, minidump_test, util_test
R=rsesek@chromium.org
Review URL: https://codereview.chromium.org/640383002
2014-10-09 15:08:54 -04:00
Mark Mentovai
6d1af6922f
Don’t use using directives (“using namespace”) in tests.
...
The contents of tests are moved into the namespace
crashpad::test::(anonymous namespace).
https://google-styleguide.googlecode.com/svn/trunk/cppguide.html#Namespaces
R=rsesek@chromium.org
Review URL: https://codereview.chromium.org/635883002
2014-10-07 17:28:50 -04:00
Scott Graham
d198c50abe
Convert COMPILE_ASSERT to static_assert
...
(Perhaps I should have just left it in mini_chromium, but anyway.)
R=mark@chromium.org
BUG=crashpad:1
Review URL: https://codereview.chromium.org/615923004
2014-10-01 12:29:01 -07:00
Mark Mentovai
7b85d6d372
Multiprocess: wrap waitpid() in HANDLE_EINTR().
...
TEST=util_test Multiprocess.Multiprocess
R=rsesek@chromium.org
Review URL: https://codereview.chromium.org/592633002
2014-09-22 13:17:17 -04:00
Mark Mentovai
c93fcf8278
In MachMultiprocess-based tests, the child must wait for the parent to
...
finish.
It was possible for the child process to exit before the parent had a
chance to complete the pid_for_task() portion of its verification.
TEST=util_test
R=rsesek@chromium.org
Review URL: https://codereview.chromium.org/586053002
2014-09-22 13:06:12 -04:00
Mark Mentovai
eeaf460f82
Add and use CheckedReadFD(), CheckedWriteFD(), and CheckedReadFDAtEOF().
...
TEST=util_test
R=rsesek@chromium.org
Review URL: https://codereview.chromium.org/577333002
2014-09-18 15:03:49 -04:00
Mark Mentovai
4d35ffa80e
Use more-specific typedefs for send rights to task, thread, and
...
exception handler ports.
task_t, thread_t, and exception_handler_t are typedefs for mach_port_t.
They are more descriptive than mach_port_t, and are already in use in
exc_server_variants.
TEST=util_test
R=rsesek@chromium.org
Review URL: https://codereview.chromium.org/577293002
2014-09-18 13:53:43 -04:00
Mark Mentovai
850ec0657d
Drop 10.5 support.
...
TEST=util_test
R=rsesek@chromium.org
Review URL: https://codereview.chromium.org/575823002
2014-09-16 11:55:55 -04:00
Mark Mentovai
ab4978b51e
10.6 SDK compatibility.
...
TEST=util_test MachOImageReader.* (and all others with a 10.6 SDK build)
R=rsesek@chromium.org
Review URL: https://codereview.chromium.org/561933004
2014-09-12 12:13:27 -04:00
Mark Mentovai
177f5dcddc
Add exc_server_variants including UniversalMachExcServer and its test.
...
TEST=util_test ExcServerVariants.*
R=rsesek@chromium.org
Review URL: https://codereview.chromium.org/545053003
2014-09-10 17:29:07 -04:00
Mark Mentovai
7fdc7f277e
Add Multiprocess::SetExpectedChildTermination().
...
An expectation of the child’s termination reason can now be specified.
It is now possible to test with children that do not exit cleanly, if
they are not expected to exit cleanly.
TEST=util_test Multiprocess.*
R=rsesek@chromium.org
Review URL: https://codereview.chromium.org/553153002
2014-09-09 17:04:47 -04:00
Mark Mentovai
35865a00d5
Fix problems discovered with gcc 4.9.1.
...
BUG=
R=rsesek@chromium.org
Review URL: https://codereview.chromium.org/538233002
2014-09-05 12:39:09 -04:00
Mark Mentovai
4f74716f6d
Add MachOImageReader and its test, which also tests
...
MachOImageSegmentReader.
TEST=util_test MachOImageReader.*
R=rsesek@chromium.org
Review URL: https://codereview.chromium.org/535343004
2014-09-04 11:45:40 -04:00
Mark Mentovai
52064fdd1b
Add the MultiprocessExec test and its test.
...
TEST=util_test MultiprocessExec.*
R=rsesek@chromium.org
Review URL: https://codereview.chromium.org/531203002
2014-09-03 18:24:29 -04:00
Mark Mentovai
d492df404c
Add CloseMultipleNowOrOnExec().
...
R=rsesek@chromium.org
Review URL: https://codereview.chromium.org/534703003
2014-09-02 16:21:46 -04:00
Mark Mentovai
ff26ea6db9
Refactor MachMultiprocess into a Multiprocess base class without any
...
knowledge of Mach. MachMultiprocess builds on this new base class.
TEST=util_test MachMultiprocess.*:Multiprocess.*
R=rsesek@chromium.org
Review URL: https://codereview.chromium.org/506143002
2014-08-26 17:10:19 -04:00
Mark Mentovai
4004e77ee9
Improvements for MachMultiprocess.
...
This adds a pipe going in the other direction (parent to child).
Initially, I didn’t think this was necessary, but it turned out to be
needed for ProcessReader. Having the child wait on a pipe read is the
easiest way to keep it alive until the parent is done with it.
This also tests MachMultiprocess::ChildPID() in
mach_multiprocess_test.cc.
Both of these fell out of https://codereview.chromium.org/491963002/ .
TEST=util_test MachMultiprocess.MachMultiprocess
R=rsesek@chromium.org
Review URL: https://codereview.chromium.org/491363002
2014-08-22 14:00:10 -04:00
Mark Mentovai
bbe4d85935
Add MachMultiprocess and its test.
...
TEST=util_test MachMultiprocess.MachMultiprocess
R=rsesek@chromium.org
Review URL: https://codereview.chromium.org/482483002
2014-08-20 13:58:42 -04:00
Mark Mentovai
9f6d86742d
Add TaskMemory, which can read another Mach task’s memory, and its test.
...
This also adds MachErrorMessage(), a test-only function that’s a
dependency of TaskMemory’s test, and related test-only error message
functions.
TEST=util_test TaskMemory.*
R=rsesek@chromium.org
Review URL: https://codereview.chromium.org/438993002
2014-08-03 18:48:40 -04:00