Loading Android.bp +7 −19 Original line number Diff line number Diff line Loading @@ -678,35 +678,23 @@ cc_library { "-Werror", "-Wno-unused-parameter", ], target: { host: { proto: { type: "full", }, srcs: [ "core/proto/**/*.proto", "libs/incident/**/*.proto", "tools/streaming_proto/stream.proto", ], target: { host: { proto: { type: "full", }, }, android: { proto: { type: "lite", }, // We only build the protos that are optimized for the lite // runtime, as well as the only protos that are actually // needed by the device. srcs: [ "core/proto/android/os/cpufreq.proto", "core/proto/android/os/cpuinfo.proto", "core/proto/android/os/kernelwake.proto", "core/proto/android/os/pagetypeinfo.proto", "core/proto/android/os/procrank.proto", "core/proto/android/os/system_properties.proto", "core/proto/android/service/graphicsstats.proto", "libs/incident/proto/android/privacy.proto", "tools/streaming_proto/stream.proto", ], shared: { enabled: false, }, Loading Android.mk +12 −1 Original line number Diff line number Diff line Loading @@ -1009,7 +1009,7 @@ include $(BUILD_HOST_JAVA_LIBRARY) # ==== java proto device library (for test only) ============================== include $(CLEAR_VARS) LOCAL_MODULE := platformprotosnano LOCAL_MODULE_TAGS := tests optional LOCAL_MODULE_TAGS := tests LOCAL_PROTOC_OPTIMIZE_TYPE := nano LOCAL_PROTOC_FLAGS := \ -Iexternal/protobuf/src Loading @@ -1021,6 +1021,17 @@ LOCAL_SRC_FILES := \ include $(BUILD_STATIC_JAVA_LIBRARY) # ==== java proto device library (for test only) ============================== include $(CLEAR_VARS) LOCAL_MODULE := platformprotoslite LOCAL_MODULE_TAGS := tests LOCAL_PROTOC_OPTIMIZE_TYPE := lite LOCAL_PROTOC_FLAGS := \ -Iexternal/protobuf/src LOCAL_SRC_FILES := \ $(call all-proto-files-under, core/proto) include $(BUILD_STATIC_JAVA_LIBRARY) # Include subdirectory makefiles # ============================================================ Loading cmds/incident_helper/Android.bp +7 −4 Original line number Diff line number Diff line Loading @@ -50,12 +50,15 @@ cc_test { "testdata/*", ], shared_libs: [ "libprotobuf-cpp-full", ], static_libs: [ "libgmock", "libplatformprotos" ], shared_libs: [ "libprotobuf-cpp-full" ], proto: { type: "full", }, } cmds/incident_helper/tests/CpuFreqParser_test.cpp +2 −9 Original line number Diff line number Diff line Loading @@ -21,7 +21,7 @@ #include <android-base/file.h> #include <android-base/test_utils.h> #include <gmock/gmock.h> #include <google/protobuf/message.h> #include <google/protobuf/message_lite.h> #include <gtest/gtest.h> #include <string.h> #include <fcntl.h> Loading @@ -42,13 +42,6 @@ public: ASSERT_TRUE(tf.fd != -1); } string getSerializedString(::google::protobuf::Message& message) { string expectedStr; message.SerializeToFileDescriptor(tf.fd); ReadFileToString(tf.path, &expectedStr); return expectedStr; } protected: TemporaryFile tf; Loading Loading @@ -125,6 +118,6 @@ TEST_F(CpuFreqParserTest, Success) { CaptureStdout(); ASSERT_EQ(NO_ERROR, parser.Parse(fd, STDOUT_FILENO)); EXPECT_EQ(GetCapturedStdout(), getSerializedString(expected)); EXPECT_EQ(GetCapturedStdout(), expected.SerializeAsString()); close(fd); } cmds/incident_helper/tests/CpuInfoParser_test.cpp +2 −9 Original line number Diff line number Diff line Loading @@ -21,7 +21,7 @@ #include <android-base/file.h> #include <android-base/test_utils.h> #include <gmock/gmock.h> #include <google/protobuf/message.h> #include <google/protobuf/message_lite.h> #include <gtest/gtest.h> #include <string.h> #include <fcntl.h> Loading @@ -42,13 +42,6 @@ public: ASSERT_TRUE(tf.fd != -1); } string getSerializedString(::google::protobuf::Message& message) { string expectedStr; message.SerializeToFileDescriptor(tf.fd); ReadFileToString(tf.path, &expectedStr); return expectedStr; } protected: TemporaryFile tf; Loading Loading @@ -153,6 +146,6 @@ TEST_F(CpuInfoParserTest, Success) { CaptureStdout(); ASSERT_EQ(NO_ERROR, parser.Parse(fd, STDOUT_FILENO)); EXPECT_EQ(GetCapturedStdout(), getSerializedString(expected)); EXPECT_EQ(GetCapturedStdout(), expected.SerializeAsString()); close(fd); } Loading
Android.bp +7 −19 Original line number Diff line number Diff line Loading @@ -678,35 +678,23 @@ cc_library { "-Werror", "-Wno-unused-parameter", ], target: { host: { proto: { type: "full", }, srcs: [ "core/proto/**/*.proto", "libs/incident/**/*.proto", "tools/streaming_proto/stream.proto", ], target: { host: { proto: { type: "full", }, }, android: { proto: { type: "lite", }, // We only build the protos that are optimized for the lite // runtime, as well as the only protos that are actually // needed by the device. srcs: [ "core/proto/android/os/cpufreq.proto", "core/proto/android/os/cpuinfo.proto", "core/proto/android/os/kernelwake.proto", "core/proto/android/os/pagetypeinfo.proto", "core/proto/android/os/procrank.proto", "core/proto/android/os/system_properties.proto", "core/proto/android/service/graphicsstats.proto", "libs/incident/proto/android/privacy.proto", "tools/streaming_proto/stream.proto", ], shared: { enabled: false, }, Loading
Android.mk +12 −1 Original line number Diff line number Diff line Loading @@ -1009,7 +1009,7 @@ include $(BUILD_HOST_JAVA_LIBRARY) # ==== java proto device library (for test only) ============================== include $(CLEAR_VARS) LOCAL_MODULE := platformprotosnano LOCAL_MODULE_TAGS := tests optional LOCAL_MODULE_TAGS := tests LOCAL_PROTOC_OPTIMIZE_TYPE := nano LOCAL_PROTOC_FLAGS := \ -Iexternal/protobuf/src Loading @@ -1021,6 +1021,17 @@ LOCAL_SRC_FILES := \ include $(BUILD_STATIC_JAVA_LIBRARY) # ==== java proto device library (for test only) ============================== include $(CLEAR_VARS) LOCAL_MODULE := platformprotoslite LOCAL_MODULE_TAGS := tests LOCAL_PROTOC_OPTIMIZE_TYPE := lite LOCAL_PROTOC_FLAGS := \ -Iexternal/protobuf/src LOCAL_SRC_FILES := \ $(call all-proto-files-under, core/proto) include $(BUILD_STATIC_JAVA_LIBRARY) # Include subdirectory makefiles # ============================================================ Loading
cmds/incident_helper/Android.bp +7 −4 Original line number Diff line number Diff line Loading @@ -50,12 +50,15 @@ cc_test { "testdata/*", ], shared_libs: [ "libprotobuf-cpp-full", ], static_libs: [ "libgmock", "libplatformprotos" ], shared_libs: [ "libprotobuf-cpp-full" ], proto: { type: "full", }, }
cmds/incident_helper/tests/CpuFreqParser_test.cpp +2 −9 Original line number Diff line number Diff line Loading @@ -21,7 +21,7 @@ #include <android-base/file.h> #include <android-base/test_utils.h> #include <gmock/gmock.h> #include <google/protobuf/message.h> #include <google/protobuf/message_lite.h> #include <gtest/gtest.h> #include <string.h> #include <fcntl.h> Loading @@ -42,13 +42,6 @@ public: ASSERT_TRUE(tf.fd != -1); } string getSerializedString(::google::protobuf::Message& message) { string expectedStr; message.SerializeToFileDescriptor(tf.fd); ReadFileToString(tf.path, &expectedStr); return expectedStr; } protected: TemporaryFile tf; Loading Loading @@ -125,6 +118,6 @@ TEST_F(CpuFreqParserTest, Success) { CaptureStdout(); ASSERT_EQ(NO_ERROR, parser.Parse(fd, STDOUT_FILENO)); EXPECT_EQ(GetCapturedStdout(), getSerializedString(expected)); EXPECT_EQ(GetCapturedStdout(), expected.SerializeAsString()); close(fd); }
cmds/incident_helper/tests/CpuInfoParser_test.cpp +2 −9 Original line number Diff line number Diff line Loading @@ -21,7 +21,7 @@ #include <android-base/file.h> #include <android-base/test_utils.h> #include <gmock/gmock.h> #include <google/protobuf/message.h> #include <google/protobuf/message_lite.h> #include <gtest/gtest.h> #include <string.h> #include <fcntl.h> Loading @@ -42,13 +42,6 @@ public: ASSERT_TRUE(tf.fd != -1); } string getSerializedString(::google::protobuf::Message& message) { string expectedStr; message.SerializeToFileDescriptor(tf.fd); ReadFileToString(tf.path, &expectedStr); return expectedStr; } protected: TemporaryFile tf; Loading Loading @@ -153,6 +146,6 @@ TEST_F(CpuInfoParserTest, Success) { CaptureStdout(); ASSERT_EQ(NO_ERROR, parser.Parse(fd, STDOUT_FILENO)); EXPECT_EQ(GetCapturedStdout(), getSerializedString(expected)); EXPECT_EQ(GetCapturedStdout(), expected.SerializeAsString()); close(fd); }