summaryrefslogtreecommitdiffstats
path: root/libmetricslogger
diff options
context:
space:
mode:
authorJames Hawkins <jhawkins@google.com>2017-02-13 13:41:44 -0800
committerJames Hawkins <jhawkins@google.com>2017-02-13 13:41:44 -0800
commit7607adfd5362ac51f057136c8e1d66b5ecc86631 (patch)
treee558259b4e6b9709582a0b22799b490b77c6e15a /libmetricslogger
parenta3e4977325763b4a6fd290ee01b9ce133df8ab93 (diff)
downloadcore-7607adfd5362ac51f057136c8e1d66b5ecc86631.tar.gz
core-7607adfd5362ac51f057136c8e1d66b5ecc86631.tar.bz2
core-7607adfd5362ac51f057136c8e1d66b5ecc86631.zip
libmetricslogger: Use libBionicGtestMain instead of a custom test runner.
Also remove commented out code I accidentally left in. Bug: 34456830 Test: libmetricslogger_test Change-Id: If76d3013ec7eaa71cef67c6db04d810745e3833e
Diffstat (limited to 'libmetricslogger')
-rw-r--r--libmetricslogger/Android.bp2
-rw-r--r--libmetricslogger/metrics_logger_test.cpp9
-rw-r--r--libmetricslogger/testrunner.cpp24
3 files changed, 2 insertions, 33 deletions
diff --git a/libmetricslogger/Android.bp b/libmetricslogger/Android.bp
index ca8af574a..75eab6603 100644
--- a/libmetricslogger/Android.bp
+++ b/libmetricslogger/Android.bp
@@ -57,8 +57,8 @@ cc_test {
"libbase",
"libmetricslogger_debug",
],
+ static_libs: ["libBionicGtestMain"],
srcs: [
"metrics_logger_test.cpp",
- "testrunner.cpp",
],
}
diff --git a/libmetricslogger/metrics_logger_test.cpp b/libmetricslogger/metrics_logger_test.cpp
index d77199c35..5a30ad702 100644
--- a/libmetricslogger/metrics_logger_test.cpp
+++ b/libmetricslogger/metrics_logger_test.cpp
@@ -20,12 +20,5 @@
TEST(MetricsLoggerTest, AddSingleBootEvent) {
android::metricslogger::LogHistogram("test_event", 42);
- /*pid_t pid = getpid();
- struct logger_list *logger_list = android_logger_list_open(
- LOG_ID_EVENTS, ANDROID_LOG_RDONLY | ANDROID_LOG_NONBLOCK, 0, pid);
-
- logger_list = NULL;
- log_msg log_msg;
- android_logger_list_read(logger_list, &log_msg);
- std::cout << log_msg.len() << std::endl;*/
+ // TODO(jhawkins): Verify the EventLog is updated.
}
diff --git a/libmetricslogger/testrunner.cpp b/libmetricslogger/testrunner.cpp
deleted file mode 100644
index edbf4d503..000000000
--- a/libmetricslogger/testrunner.cpp
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Copyright (C) 2017 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 <android-base/logging.h>
-#include <gtest/gtest.h>
-
-int main(int argc, char** argv) {
- ::testing::InitGoogleTest(&argc, argv);
- android::base::InitLogging(argv, android::base::StderrLogger);
- return RUN_ALL_TESTS();
-}