From 971b79519a49640f60d6d0f4f26ca06b4dcd6320 Mon Sep 17 00:00:00 2001 From: Luke Huang Date: Wed, 24 Apr 2019 21:27:40 -0700 Subject: [PATCH] Convert Android.mk to Android.bp for net cts Bug: 130623306 Test: Run the tests below on Crosshatch, Sailfish, Bonito atest CtsNativeNetTestCases CtsNativeNetDnsTestCases atest CtsNetTestCases Merged-In: I5bb6de7a07494bd13d069212223691968d4f080e (cherry picked from commit db29b055d92c2dd7aef25ee12ad6af9a6bc8558c) Change-Id: I0f1f70794c0ce303158f1aea54f0801379498071 --- tests/cts/net/Android.bp | 64 +++++++++++++++++++++++++ tests/cts/net/Android.mk | 62 ------------------------ tests/cts/net/appForApi23/Android.bp | 33 +++++++++++++ tests/cts/net/appForApi23/Android.mk | 38 --------------- tests/cts/net/jni/Android.bp | 49 +++++++++++++++++++ tests/cts/net/jni/Android.mk | 44 ----------------- tests/cts/net/native/Android.mk | 15 ------ tests/cts/net/native/qtaguid/Android.bp | 53 ++++++++++++++++++++ tests/cts/net/native/qtaguid/Android.mk | 43 ----------------- 9 files changed, 199 insertions(+), 202 deletions(-) create mode 100644 tests/cts/net/Android.bp delete mode 100644 tests/cts/net/Android.mk create mode 100644 tests/cts/net/appForApi23/Android.bp delete mode 100644 tests/cts/net/appForApi23/Android.mk create mode 100644 tests/cts/net/jni/Android.bp delete mode 100644 tests/cts/net/jni/Android.mk delete mode 100644 tests/cts/net/native/Android.mk create mode 100644 tests/cts/net/native/qtaguid/Android.bp delete mode 100644 tests/cts/net/native/qtaguid/Android.mk diff --git a/tests/cts/net/Android.bp b/tests/cts/net/Android.bp new file mode 100644 index 0000000000..779d5c4be2 --- /dev/null +++ b/tests/cts/net/Android.bp @@ -0,0 +1,64 @@ +// Copyright (C) 2008 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. + +android_test { + name: "CtsNetTestCases", + defaults: ["cts_defaults"], + + // Include both the 32 and 64 bit versions + compile_multilib: "both", + + libs: [ + "voip-common", + "org.apache.http.legacy", + "android.test.base.stubs", + ], + + jni_libs: [ + "libcts_jni", + "libnativedns_jni", + "libnativemultinetwork_jni", + "libnativehelper_compat_libc++", + ], + + // include CtsTestServer as a temporary hack to free net.cts from cts.stub. + srcs: [ + "src/**/*.java", + "src/**/*.kt", + ], + + static_libs: [ + "FrameworksNetCommonTests", + "core-tests-support", + "compatibility-device-util-axt", + "ctstestrunner-axt", + "ctstestserver", + "mockwebserver", + "junit", + "junit-params", + "truth-prebuilt", + ], + + // uncomment when b/13249961 is fixed + // sdk_version: "current", + platform_apis: true, + + // Tag this module as a cts test artifact + test_suites: [ + "cts", + "vts", + "general-tests", + ], + +} diff --git a/tests/cts/net/Android.mk b/tests/cts/net/Android.mk deleted file mode 100644 index 04974702a6..0000000000 --- a/tests/cts/net/Android.mk +++ /dev/null @@ -1,62 +0,0 @@ -# Copyright (C) 2008 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. - -LOCAL_PATH:= $(call my-dir) - -include $(CLEAR_VARS) - -# don't include this package in any target -LOCAL_MODULE_TAGS := optional -# and when built explicitly put it in the data partition -LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS) - -# Include both the 32 and 64 bit versions -LOCAL_MULTILIB := both - -LOCAL_JAVA_LIBRARIES := \ - voip-common \ - org.apache.http.legacy \ - android.test.base.stubs \ - - -LOCAL_JNI_SHARED_LIBRARIES := libcts_jni libnativedns_jni \ - libnativemultinetwork_jni libnativehelper_compat_libc++ - -# include CtsTestServer as a temporary hack to free net.cts from cts.stub. -LOCAL_SRC_FILES := $(call all-java-files-under, src) - -LOCAL_PACKAGE_NAME := CtsNetTestCases - -LOCAL_STATIC_JAVA_LIBRARIES := \ - FrameworksNetCommonTests \ - core-tests-support \ - compatibility-device-util-axt \ - ctstestrunner-axt \ - ctstestserver \ - mockwebserver \ - junit \ - junit-params \ - truth-prebuilt \ - - -# uncomment when b/13249961 is fixed -#LOCAL_SDK_VERSION := current -LOCAL_PRIVATE_PLATFORM_APIS := true - -# Tag this module as a cts test artifact -LOCAL_COMPATIBILITY_SUITE := cts vts general-tests - -include $(BUILD_CTS_PACKAGE) - -include $(call all-makefiles-under,$(LOCAL_PATH)) diff --git a/tests/cts/net/appForApi23/Android.bp b/tests/cts/net/appForApi23/Android.bp new file mode 100644 index 0000000000..82e2a08c10 --- /dev/null +++ b/tests/cts/net/appForApi23/Android.bp @@ -0,0 +1,33 @@ +// Copyright (C) 2016 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. + +android_test { + name: "CtsNetTestAppForApi23", + defaults: ["cts_defaults"], + + // Include both the 32 and 64 bit versions + compile_multilib: "both", + + srcs: ["src/**/*.java"], + + sdk_version: "23", + + // Tag this module as a cts test artifact + test_suites: [ + "cts", + "vts", + "general-tests", + ], + +} diff --git a/tests/cts/net/appForApi23/Android.mk b/tests/cts/net/appForApi23/Android.mk deleted file mode 100644 index 54b60a0219..0000000000 --- a/tests/cts/net/appForApi23/Android.mk +++ /dev/null @@ -1,38 +0,0 @@ -# Copyright (C) 2016 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. - -LOCAL_PATH:= $(call my-dir) - -include $(CLEAR_VARS) - -# don't include this package in any target -LOCAL_MODULE_TAGS := optional -# and when built explicitly put it in the data partition -LOCAL_MODULE_PATH := $(TARGET_OUT_DATA_APPS) - -# Include both the 32 and 64 bit versions -LOCAL_MULTILIB := both - -LOCAL_SRC_FILES := $(call all-java-files-under, src) - -LOCAL_PACKAGE_NAME := CtsNetTestAppForApi23 - -LOCAL_SDK_VERSION := 23 - -# Tag this module as a cts test artifact -LOCAL_COMPATIBILITY_SUITE := cts vts general-tests - -include $(BUILD_CTS_PACKAGE) - -include $(call all-makefiles-under,$(LOCAL_PATH)) diff --git a/tests/cts/net/jni/Android.bp b/tests/cts/net/jni/Android.bp new file mode 100644 index 0000000000..baed48dfae --- /dev/null +++ b/tests/cts/net/jni/Android.bp @@ -0,0 +1,49 @@ +// Copyright (C) 2013 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. + +cc_library_shared { + name: "libnativedns_jni", + + srcs: ["NativeDnsJni.c"], + + shared_libs: [ + "libnativehelper_compat_libc++", + "liblog", + ], + stl: "libc++_static", + + cflags: [ + "-Wall", + "-Werror", + "-Wno-unused-parameter", + ], + +} + +cc_library_shared { + name: "libnativemultinetwork_jni", + + srcs: ["NativeMultinetworkJni.cpp"], + cflags: [ + "-Wall", + "-Werror", + "-Wno-format", + ], + shared_libs: [ + "libandroid", + "libnativehelper_compat_libc++", + "liblog", + ], + stl: "libc++_static", +} diff --git a/tests/cts/net/jni/Android.mk b/tests/cts/net/jni/Android.mk deleted file mode 100644 index ccb1278f94..0000000000 --- a/tests/cts/net/jni/Android.mk +++ /dev/null @@ -1,44 +0,0 @@ -# Copyright (C) 2013 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. - -LOCAL_PATH:= $(call my-dir) - -include $(CLEAR_VARS) - -LOCAL_MODULE := libnativedns_jni - -# Don't include this package in any configuration by default. -LOCAL_MODULE_TAGS := optional - -LOCAL_SRC_FILES := NativeDnsJni.c - -LOCAL_C_INCLUDES := $(JNI_H_INCLUDE) - -LOCAL_SHARED_LIBRARIES := libnativehelper_compat_libc++ liblog -LOCAL_CXX_STL := libc++_static - -LOCAL_CFLAGS := -Wall -Werror -Wno-unused-parameter - -include $(BUILD_SHARED_LIBRARY) - -include $(CLEAR_VARS) -LOCAL_MODULE := libnativemultinetwork_jni -# Don't include this package in any configuration by default. -LOCAL_MODULE_TAGS := optional -LOCAL_SRC_FILES := NativeMultinetworkJni.cpp -LOCAL_CFLAGS := -Wall -Werror -Wno-format -LOCAL_C_INCLUDES := $(JNI_H_INCLUDE) -LOCAL_SHARED_LIBRARIES := libandroid libnativehelper_compat_libc++ liblog -LOCAL_CXX_STL := libc++_static -include $(BUILD_SHARED_LIBRARY) diff --git a/tests/cts/net/native/Android.mk b/tests/cts/net/native/Android.mk deleted file mode 100644 index b798d87878..0000000000 --- a/tests/cts/net/native/Android.mk +++ /dev/null @@ -1,15 +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 $(call all-subdir-makefiles) diff --git a/tests/cts/net/native/qtaguid/Android.bp b/tests/cts/net/native/qtaguid/Android.bp new file mode 100644 index 0000000000..c0f0613040 --- /dev/null +++ b/tests/cts/net/native/qtaguid/Android.bp @@ -0,0 +1,53 @@ +// 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. + +// Build the unit tests. + +cc_test { + name: "CtsNativeNetTestCases", + + compile_multilib: "both", + multilib: { + lib32: { + suffix: "32", + }, + lib64: { + suffix: "64", + }, + }, + + srcs: ["src/NativeQtaguidTest.cpp"], + + shared_libs: [ + "libutils", + "liblog", + ], + + static_libs: [ + "libgtest", + "libqtaguid", + ], + + // Tag this module as a cts test artifact + test_suites: [ + "cts", + "vts", + ], + + cflags: [ + "-Werror", + "-Wall", + ], + +} diff --git a/tests/cts/net/native/qtaguid/Android.mk b/tests/cts/net/native/qtaguid/Android.mk deleted file mode 100644 index bf89e5f015..0000000000 --- a/tests/cts/net/native/qtaguid/Android.mk +++ /dev/null @@ -1,43 +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. - -# Build the unit tests. - -LOCAL_PATH:= $(call my-dir) - -include $(CLEAR_VARS) -LOCAL_MODULE := CtsNativeNetTestCases -LOCAL_MODULE_PATH := $(TARGET_OUT_DATA)/nativetest -LOCAL_MULTILIB := both -LOCAL_MODULE_STEM_32 := $(LOCAL_MODULE)32 -LOCAL_MODULE_STEM_64 := $(LOCAL_MODULE)64 - -LOCAL_SRC_FILES := \ - src/NativeQtaguidTest.cpp - -LOCAL_SHARED_LIBRARIES := \ - libutils \ - liblog \ - -LOCAL_STATIC_LIBRARIES := \ - libgtest \ - libqtaguid \ - -LOCAL_CTS_TEST_PACKAGE := android.net.native -# Tag this module as a cts test artifact -LOCAL_COMPATIBILITY_SUITE := cts vts - -LOCAL_CFLAGS := -Werror -Wall - -include $(BUILD_CTS_EXECUTABLE)