Commit 91ab657e authored by Clemens Hammacher's avatar Clemens Hammacher Committed by Commit Bot

Enable TurboAssembler tests on native android

We currently don't execute the tests on android, because the error
message is redirected to the android log. What we can still to though
is ensuring that the call aborts the process, but just ignore the error
message.

R=mstarzinger@chromium.org

Bug: chromium:863799
Change-Id: I54b503849358133ffe647be83eae7a964c2ac49e
Reviewed-on: https://chromium-review.googlesource.com/1148444
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: 's avatarMichael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#54839}
parent c90dd37e
......@@ -14,10 +14,14 @@ namespace internal {
#define __ tasm.
// Disable this test if we are running on android and the output is not
// redirected, i.e. ends up in the android log. The tests would fail because the
// expected output is not found in the error output.
#if !defined(ANDROID) || defined(V8_ANDROID_LOG_STDOUT)
// If we are running on android and the output is not redirected (i.e. ends up
// in the android log) then we cannot find the error message in the output. This
// macro just returns the empty string in that case.
#if defined(ANDROID) && !defined(V8_ANDROID_LOG_STDOUT)
#define ERROR_MESSAGE(msg) ""
#else
#define ERROR_MESSAGE(msg) msg
#endif
// Test the x64 assembler by compiling some simple functions into
// a buffer and executing them. These tests do not initialize the
......@@ -40,7 +44,7 @@ TEST_F(TurboAssemblerTest, TestHardAbort) {
// We need an isolate here to execute in the simulator.
auto f = GeneratedCode<void>::FromBuffer(isolate(), buffer);
ASSERT_DEATH_IF_SUPPORTED({ f.Call(); }, "abort: no reason");
ASSERT_DEATH_IF_SUPPORTED({ f.Call(); }, ERROR_MESSAGE("abort: no reason"));
}
TEST_F(TurboAssemblerTest, TestCheck) {
......@@ -64,12 +68,11 @@ TEST_F(TurboAssemblerTest, TestCheck) {
f.Call(0);
f.Call(18);
ASSERT_DEATH_IF_SUPPORTED({ f.Call(17); }, "abort: no reason");
ASSERT_DEATH_IF_SUPPORTED({ f.Call(17); }, ERROR_MESSAGE("abort: no reason"));
}
#endif // !defined(ANDROID) || defined(V8_ANDROID_LOG_STDOUT)
#undef __
#undef ERROR_MESSAGE
} // namespace internal
} // namespace v8
......@@ -14,10 +14,14 @@ namespace internal {
#define __ tasm.
// Disable this test if we are running on android and the output is not
// redirected, i.e. ends up in the android log. The tests would fail because the
// expected output is not found in the error output.
#if !defined(ANDROID) || defined(V8_ANDROID_LOG_STDOUT)
// If we are running on android and the output is not redirected (i.e. ends up
// in the android log) then we cannot find the error message in the output. This
// macro just returns the empty string in that case.
#if defined(ANDROID) && !defined(V8_ANDROID_LOG_STDOUT)
#define ERROR_MESSAGE(msg) ""
#else
#define ERROR_MESSAGE(msg) msg
#endif
// Test the x64 assembler by compiling some simple functions into
// a buffer and executing them. These tests do not initialize the
......@@ -40,7 +44,7 @@ TEST_F(TurboAssemblerTest, TestHardAbort) {
// We need an isolate here to execute in the simulator.
auto f = GeneratedCode<void>::FromBuffer(isolate(), buffer);
ASSERT_DEATH_IF_SUPPORTED({ f.Call(); }, "abort: no reason");
ASSERT_DEATH_IF_SUPPORTED({ f.Call(); }, ERROR_MESSAGE("abort: no reason"));
}
TEST_F(TurboAssemblerTest, TestCheck) {
......@@ -64,12 +68,11 @@ TEST_F(TurboAssemblerTest, TestCheck) {
f.Call(0);
f.Call(18);
ASSERT_DEATH_IF_SUPPORTED({ f.Call(17); }, "abort: no reason");
ASSERT_DEATH_IF_SUPPORTED({ f.Call(17); }, ERROR_MESSAGE("abort: no reason"));
}
#endif // !defined(ANDROID) || defined(V8_ANDROID_LOG_STDOUT)
#undef __
#undef ERROR_MESSAGE
} // namespace internal
} // namespace v8
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment