Remove ANDROID_LOG_TAGS=*:e filter in gtests.
It is problematic since it's not very visible so time is wasted looking
for logs that don't appear. Another problem is that it's hard to plumb
through `ART_GTEST_OVERRIDE_LOG_TAGS` in e.g. atest runs.
Also fix a test that relied on that filter setting.
Test: atest art_standalone_compiler_tests
and check for D messages in the logcat.
Test: m test-art-host-gtest-art_oatdump_tests
Change-Id: Ief9846f80dfa64208f99e75cdb3b3ed349a5b182
diff --git a/oatdump/oatdump_test.h b/oatdump/oatdump_test.h
index 3ec5b94..708befe 100644
--- a/oatdump/oatdump_test.h
+++ b/oatdump/oatdump_test.h
@@ -328,7 +328,9 @@
auto post_fork_fn = []() {
setpgid(0, 0); // Change process groups, so we don't get reaped by ProcessManager.
- return true; // Ignore setpgid failures.
+ // Ignore setpgid failures.
+ return setenv("ANDROID_LOG_TAGS", "*:e", 1) == 0; // We're only interested in errors and
+ // fatal logs.
};
ForkAndExecResult res = ForkAndExec(exec_argv, post_fork_fn, line_buf_fn);
diff --git a/test/common/gtest_main.cc b/test/common/gtest_main.cc
index 95dadcf..e491ffc 100644
--- a/test/common/gtest_main.cc
+++ b/test/common/gtest_main.cc
@@ -38,12 +38,6 @@
extern "C" __attribute__((visibility("default"))) __attribute__((weak)) void ArtTestGlobalInit();
int main(int argc, char** argv, char** envp) {
- // Gtests can be very noisy. For example, an executable with multiple tests will trigger native
- // bridge warnings. The following line reduces the minimum log severity to ERROR and suppresses
- // everything else. In case you want to see all messages, comment out the line.
- const char* log_tag_override = getenv("ART_GTEST_OVERRIDE_LOG_TAGS");
- setenv("ANDROID_LOG_TAGS", log_tag_override == nullptr ? "*:e" : log_tag_override, 1);
-
art::Locks::Init();
art::InitLogging(argv, art::Runtime::Abort);
art::MemMap::Init();