summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Willemsen <dwillemsen@google.com>2016-12-06 02:28:34 +0000
committerandroid-build-merger <android-build-merger@google.com>2016-12-06 02:28:34 +0000
commit16040df35b24d07662275c78c85f6cab902d2e8a (patch)
treecbcbbb300b6eda22ec84723b20f1c3ba70dae6d2
parenta696c8d9d8d03c12733f2b3af35529143924e0f9 (diff)
parent1a90639de2ce33d514d1e8720eeaefbc67ca373a (diff)
downloadandroid_system_tools_aidl-16040df35b24d07662275c78c85f6cab902d2e8a.tar.gz
android_system_tools_aidl-16040df35b24d07662275c78c85f6cab902d2e8a.tar.bz2
android_system_tools_aidl-16040df35b24d07662275c78c85f6cab902d2e8a.zip
Convert aidl cpp tests to Soong am: 8f8836167e
am: 1a90639de2 Change-Id: I50483cbb0dbd47ff048d7a9c8456107499bf6022
-rw-r--r--Android.bp53
-rw-r--r--Android.mk49
2 files changed, 53 insertions, 49 deletions
diff --git a/Android.bp b/Android.bp
index fcb2851..50fce3c 100644
--- a/Android.bp
+++ b/Android.bp
@@ -154,3 +154,56 @@ cc_binary {
"-Wunused-parameter",
],
}
+
+cc_defaults {
+ name: "aidl_test_defaults",
+ cflags: [
+ "-Wall",
+ "-Wextra",
+ "-Werror",
+ "-Wunused-parameter",
+ ],
+ shared_libs: [
+ "libbase",
+ "libbinder",
+ "liblog",
+ "libutils",
+ ],
+}
+
+cc_library_shared {
+ name: "libaidl-integration-test",
+ defaults: ["aidl_test_defaults"],
+ aidl: {
+ export_aidl_headers: true,
+ local_include_dirs: ["tests"],
+ include_dirs: ["frameworks/native/aidl/binder"],
+ },
+ srcs: [
+ "tests/android/aidl/tests/ITestService.aidl",
+ "tests/android/aidl/tests/INamedCallback.aidl",
+ "tests/simple_parcelable.cpp",
+ ],
+}
+
+cc_binary {
+ name: "aidl_test_service",
+ defaults: ["aidl_test_defaults"],
+ shared_libs: ["libaidl-integration-test"],
+ srcs: ["tests/aidl_test_service.cpp"],
+}
+
+cc_binary {
+ name: "aidl_test_client",
+ defaults: ["aidl_test_defaults"],
+ shared_libs: ["libaidl-integration-test"],
+ srcs: [
+ "tests/aidl_test_client.cpp",
+ "tests/aidl_test_client_file_descriptors.cpp",
+ "tests/aidl_test_client_parcelables.cpp",
+ "tests/aidl_test_client_nullables.cpp",
+ "tests/aidl_test_client_primitives.cpp",
+ "tests/aidl_test_client_utf8_strings.cpp",
+ "tests/aidl_test_client_service_exceptions.cpp",
+ ],
+}
diff --git a/Android.mk b/Android.mk
index a44dc0b..5653044 100644
--- a/Android.mk
+++ b/Android.mk
@@ -16,58 +16,9 @@
LOCAL_PATH := $(call my-dir)
-aidl_cflags := -Wall -Wextra -Werror
-
#
# Everything below here is used for integration testing of generated AIDL code.
#
-aidl_integration_test_cflags := $(aidl_cflags) -Wunused-parameter
-aidl_integration_test_shared_libs := \
- libbase \
- libbinder \
- liblog \
- libutils
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := libaidl-integration-test
-LOCAL_MODULE_CLASS := SHARED_LIBRARIES
-LOCAL_CFLAGS := $(aidl_integration_test_cflags)
-LOCAL_SHARED_LIBRARIES := $(aidl_integration_test_shared_libs)
-LOCAL_AIDL_INCLUDES := \
- system/tools/aidl/tests/ \
- frameworks/native/aidl/binder
-LOCAL_SRC_FILES := \
- tests/android/aidl/tests/ITestService.aidl \
- tests/android/aidl/tests/INamedCallback.aidl \
- tests/simple_parcelable.cpp
-include $(BUILD_SHARED_LIBRARY)
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := aidl_test_service
-LOCAL_CFLAGS := $(aidl_integration_test_cflags)
-LOCAL_SHARED_LIBRARIES := \
- libaidl-integration-test \
- $(aidl_integration_test_shared_libs)
-LOCAL_SRC_FILES := \
- tests/aidl_test_service.cpp
-include $(BUILD_EXECUTABLE)
-
-include $(CLEAR_VARS)
-LOCAL_MODULE := aidl_test_client
-LOCAL_CFLAGS := $(aidl_integration_test_cflags)
-LOCAL_SHARED_LIBRARIES := \
- libaidl-integration-test \
- $(aidl_integration_test_shared_libs)
-LOCAL_SRC_FILES := \
- tests/aidl_test_client.cpp \
- tests/aidl_test_client_file_descriptors.cpp \
- tests/aidl_test_client_parcelables.cpp \
- tests/aidl_test_client_nullables.cpp \
- tests/aidl_test_client_primitives.cpp \
- tests/aidl_test_client_utf8_strings.cpp \
- tests/aidl_test_client_service_exceptions.cpp
-include $(BUILD_EXECUTABLE)
-
# aidl on its own doesn't need the framework, but testing native/java
# compatibility introduces java dependencies.