Use bionic gtest main for android.bionic cts test.

Bug: 17589740
Change-Id: I14b4821f47cd1db69b067e3c1e8ecc1c0d25541b
diff --git a/tests/tests/bionic/Android.mk b/tests/tests/bionic/Android.mk
index 44e59e7..f441d7a 100644
--- a/tests/tests/bionic/Android.mk
+++ b/tests/tests/bionic/Android.mk
@@ -18,12 +18,12 @@
 
 LOCAL_WHOLE_STATIC_LIBRARIES += \
     libBionicTests \
+    libBionicCtsGtestMain \
 
 LOCAL_STATIC_LIBRARIES += \
     libtinyxml2 \
     liblog \
     libgtest \
-    libgtest_main \
 
 LOCAL_CTS_TEST_PACKAGE := android.bionic
 include $(BUILD_CTS_EXECUTABLE)
@@ -39,15 +39,12 @@
 LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)
 LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64
 
-# A main without the extra output from the gtest main.
-LOCAL_SRC_FILES := \
-    main.cpp \
-
 LOCAL_LDLIBS += \
     -lrt -ldl -lutil \
 
 LOCAL_WHOLE_STATIC_LIBRARIES += \
     libBionicTests \
+    libBionicCtsGtestMain \
 
 LOCAL_CXX_STL := libc++
 
diff --git a/tests/tests/bionic/main.cpp b/tests/tests/bionic/main.cpp
deleted file mode 100644
index b661af4..0000000
--- a/tests/tests/bionic/main.cpp
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <gtest/gtest.h>
-
-int main(int argc, char **argv) {
-  // Do not use gtest_main to avoid the Running main() ... output.
-  testing::InitGoogleTest(&argc, argv);
-
-  return RUN_ALL_TESTS();
-}