Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(111)

Unified Diff: sandbox/linux/tests/unit_tests.cc

Issue 1147463003: Linux sandbox: support build configuration without base test framework (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Nits. Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sandbox/linux/tests/main.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sandbox/linux/tests/unit_tests.cc
diff --git a/sandbox/linux/tests/unit_tests.cc b/sandbox/linux/tests/unit_tests.cc
index 5872e94030e143da76d49f3cd3035bf01d11cd2d..b4422062e96107288adb3e79fe2c653b2a014339 100644
--- a/sandbox/linux/tests/unit_tests.cc
+++ b/sandbox/linux/tests/unit_tests.cc
@@ -69,7 +69,7 @@ static const int kIgnoreThisTest = 43;
static const int kExitWithAssertionFailure = 1;
static const int kExitForTimeout = 2;
-#if !defined(OS_ANDROID)
+#if defined(SANDBOX_USES_BASE_TEST_SUITE)
// This is due to StackDumpSignalHandler() performing _exit(1).
// TODO(jln): get rid of the collision with kExitWithAssertionFailure.
const int kExitAfterSIGSEGV = 1;
@@ -282,10 +282,12 @@ void UnitTests::DeathSEGVMessage(int status,
std::string details(TestFailedMessage(msg));
const char* expected_msg = static_cast<const char*>(aux);
-#if defined(OS_ANDROID)
+#if !defined(SANDBOX_USES_BASE_TEST_SUITE)
const bool subprocess_got_sigsegv =
WIFSIGNALED(status) && (SIGSEGV == WTERMSIG(status));
#else
+ // This hack is required when a signal handler is installed
+ // for SEGV that will _exit(1).
const bool subprocess_got_sigsegv =
WIFEXITED(status) && (kExitAfterSIGSEGV == WEXITSTATUS(status));
#endif
« no previous file with comments | « sandbox/linux/tests/main.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698