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

Unified Diff: testing/android/native_test_launcher.cc

Issue 10579040: APK-based unittests (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Comments Created 8 years, 6 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: testing/android/native_test_launcher.cc
diff --git a/testing/android/native_test_launcher.cc b/testing/android/native_test_launcher.cc
index dad604b6e58ad0ad97fdaca5dc35008fac6bfc3e..1293c01ef4ca96e878e51b7c88b6399967c109a1 100644
--- a/testing/android/native_test_launcher.cc
+++ b/testing/android/native_test_launcher.cc
@@ -41,6 +41,10 @@ extern int main(int argc, char** argv);
namespace {
+void log_write(int level, const char* msg) {
+ __android_log_write(level, "chromium", msg);
+}
+
// The list of signals which are considered to be crashes.
const int kExceptionSignals[] = {
SIGSEGV, SIGABRT, SIGFPE, SIGILL, SIGBUS, -1
@@ -52,7 +56,7 @@ struct sigaction g_old_sa[NSIG];
void SignalHandler(int sig, siginfo_t *info, void *reserved)
{
// Output the crash marker.
- __android_log_write(ANDROID_LOG_ERROR, "chromium", "[ CRASHED ]");
+ log_write(ANDROID_LOG_ERROR, "[ CRASHED ]");
g_old_sa[sig].sa_sigaction(sig, info, reserved);
}
@@ -131,13 +135,13 @@ void AndroidLogPrinter::OnTestProgramStart(
const ::testing::UnitTest& unit_test) {
std::string msg = StringPrintf("[ START ] %d",
unit_test.test_to_run_count());
- LOG(ERROR) << msg;
+ log_write(ANDROID_LOG_VERBOSE, msg.c_str());
}
void AndroidLogPrinter::OnTestStart(const ::testing::TestInfo& test_info) {
std::string msg = StringPrintf("[ RUN ] %s.%s",
test_info.test_case_name(), test_info.name());
- LOG(ERROR) << msg;
+ log_write(ANDROID_LOG_VERBOSE, msg.c_str());
}
void AndroidLogPrinter::OnTestPartResult(
@@ -148,21 +152,21 @@ void AndroidLogPrinter::OnTestPartResult(
test_part_result.file_name(),
test_part_result.line_number(),
test_part_result.summary());
- LOG(ERROR) << msg;
+ log_write(ANDROID_LOG_VERBOSE, msg.c_str());
}
void AndroidLogPrinter::OnTestEnd(const ::testing::TestInfo& test_info) {
std::string msg = StringPrintf("%s %s.%s",
test_info.result()->Failed() ? "[ FAILED ]" : "[ OK ]",
test_info.test_case_name(), test_info.name());
- LOG(ERROR) << msg;
+ log_write(ANDROID_LOG_VERBOSE, msg.c_str());
}
void AndroidLogPrinter::OnTestProgramEnd(
const ::testing::UnitTest& unit_test) {
std::string msg = StringPrintf("[ END ] %d",
unit_test.successful_test_count());
- LOG(ERROR) << msg;
+ log_write(ANDROID_LOG_VERBOSE, msg.c_str());
}
} // namespace
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698