Re-init Locks and MemMap for each gtest
CommonRuntimeTest gtests will clear the MemMap statics when it deletes
the runtime. This can cause other tests to fail if you run the gtests
with the `--no_isolate` flag. By reinitializing these systems in
CommonArtTestImpl::Setup in addition to the original call in
gtest_main.cc this issue is avoided.
Test: $ANDROID_HOST_OUT/nativetest64/art_compiler_tests/art_compiler_tests --no_isolate
Change-Id: Ifb258e3ca6bf63ca0f821ed598143b3cc41d3e8b
diff --git a/libartbase/base/common_art_test.cc b/libartbase/base/common_art_test.cc
index 4e0dd84..042ce55 100644
--- a/libartbase/base/common_art_test.cc
+++ b/libartbase/base/common_art_test.cc
@@ -295,6 +295,10 @@
}
void CommonArtTestImpl::SetUp() {
+ // Some tests clear these and when running with --no_isolate this can cause
+ // later tests to fail
+ Locks::Init();
+ MemMap::Init();
SetUpAndroidRootEnvVars();
SetUpAndroidDataDir(android_data_);