Convert frameworks/base/services/tests to Android.bp

See build/soong/README.md for more information.

Bug: 119809391
Test: atest FrameworksServicesTests FrameworksMockingServicesTests FrameworksUiServicesTests (mostly passes, those that don't aren't run in APCT)
Change-Id: Id28d25cc36df47e2f533ae878fb0d2745164fbfb
This commit is contained in:
Colin Cross
2018-11-20 09:46:47 -08:00
parent 657c8ff19a
commit 35be4249e2
19 changed files with 408 additions and 392 deletions

View File

@@ -0,0 +1,46 @@
// Copyright (C) 2018 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: "FrameworksMockingServicesTests",
srcs: ["src/**/*.java"],
static_libs: [
"services.core",
"services.net",
"androidx.test.runner",
"mockito-target-extended-minus-junit4",
"platform-test-annotations",
],
libs: [
"android.test.mock",
"android.test.base",
"android.test.runner",
],
jni_libs: [
"libdexmakerjvmtiagent",
"libstaticjvmtiagent",
],
certificate: "platform",
platform_apis: true,
test_suites: ["device-tests"],
optimize: {
enabled: false,
},
}

View File

@@ -1,42 +0,0 @@
# Copyright (C) 2018 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_TAGS := tests
LOCAL_SRC_FILES := $(call all-java-files-under, src)
LOCAL_STATIC_JAVA_LIBRARIES := \
services.core \
services.net \
androidx.test.runner \
mockito-target-extended-minus-junit4 \
platform-test-annotations \
LOCAL_JAVA_LIBRARIES := android.test.mock android.test.base android.test.runner
LOCAL_JNI_SHARED_LIBRARIES := \
libdexmakerjvmtiagent \
libstaticjvmtiagent \
LOCAL_CERTIFICATE := platform
LOCAL_PACKAGE_NAME := FrameworksMockingServicesTests
LOCAL_PRIVATE_PLATFORM_APIS := true
LOCAL_COMPATIBILITY_SUITE := device-tests
LOCAL_PROGUARD_ENABLED := disabled
include $(BUILD_PACKAGE)

View File

@@ -0,0 +1,104 @@
//########################################################################
// Build FrameworksServicesTests package
//########################################################################
android_test {
name: "FrameworksServicesTests",
// Include all test java files.
srcs: [
"src/**/*.java",
"aidl/com/android/servicestests/aidl/INetworkStateObserver.aidl",
"aidl/com/android/servicestests/aidl/ICmdReceiverService.aidl",
"test-apps/JobTestApp/src/**/*.java",
"test-apps/SuspendTestApp/src/**/*.java",
],
static_libs: [
"frameworks-base-testutils",
"services.accessibility",
"services.appwidget",
"services.autofill",
"services.backup",
"services.core",
"services.devicepolicy",
"services.net",
"services.usage",
"guava",
"androidx.test.runner",
"androidx.test.rules",
"mockito-target-minus-junit4",
"platform-test-annotations",
"ShortcutManagerTestUtils",
"truth-prebuilt",
"testables",
"testng",
"ub-uiautomator",
"platformprotosnano",
"hamcrest-library",
"servicestests-utils",
],
aidl: {
local_include_dirs: ["aidl"],
},
libs: [
"android.hidl.manager-V1.0-java",
"android.hardware.tv.cec-V1.0-java",
"android.test.mock",
"android.test.base",
"android.test.runner",
],
platform_apis: true,
test_suites: ["device-tests"],
certificate: "platform",
// These are not normally accessible from apps so they must be explicitly included.
jni_libs: [
"libbacktrace",
"libbase",
"libbinder",
"libbinderthreadstate",
"libc++",
"libcutils",
"liblog",
"liblzma",
"libnativehelper",
"libnetdaidl",
"libui",
"libunwind",
"libutils",
],
dxflags: ["--multi-dex"],
optimize: {
enabled: false,
},
}
java_library {
name: "servicestests-utils",
srcs: [
"utils/**/*.java",
],
static_libs: [
"android-support-test",
"mockito-target-minus-junit4",
],
libs: [
"android.test.runner",
],
}
filegroup {
name: "servicestests-SuspendTestApp-files",
srcs: [
"src/com/android/server/pm/SuspendPackagesTest.java",
],
}

View File

@@ -1,83 +0,0 @@
#########################################################################
# Build FrameworksServicesTests package
#########################################################################
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
# We only want this apk build for tests.
LOCAL_MODULE_TAGS := tests
# Include all test java files.
LOCAL_SRC_FILES := \
$(call all-java-files-under, src) \
$(call all-java-files-under, utils) \
LOCAL_STATIC_JAVA_LIBRARIES := \
frameworks-base-testutils \
services.accessibility \
services.appwidget \
services.autofill \
services.backup \
services.core \
services.devicepolicy \
services.net \
services.usage \
guava \
androidx.test.runner \
androidx.test.rules \
mockito-target-minus-junit4 \
platform-test-annotations \
ShortcutManagerTestUtils \
truth-prebuilt \
testables \
testng \
ub-uiautomator\
platformprotosnano \
hamcrest-library
LOCAL_AIDL_INCLUDES := $(LOCAL_PATH)/aidl
LOCAL_SRC_FILES += aidl/com/android/servicestests/aidl/INetworkStateObserver.aidl \
aidl/com/android/servicestests/aidl/ICmdReceiverService.aidl
LOCAL_SRC_FILES += $(call all-java-files-under, test-apps/JobTestApp/src)
LOCAL_SRC_FILES += $(call all-java-files-under, test-apps/SuspendTestApp/src)
LOCAL_JAVA_LIBRARIES := \
android.hidl.manager-V1.0-java \
android.hardware.tv.cec-V1.0-java \
android.test.mock \
android.test.base android.test.runner \
LOCAL_PACKAGE_NAME := FrameworksServicesTests
LOCAL_PRIVATE_PLATFORM_APIS := true
LOCAL_COMPATIBILITY_SUITE := device-tests
LOCAL_CERTIFICATE := platform
# These are not normally accessible from apps so they must be explicitly included.
LOCAL_JNI_SHARED_LIBRARIES := \
libbacktrace \
libbase \
libbinder \
libbinderthreadstate \
libc++ \
libcutils \
liblog \
liblzma \
libnativehelper \
libnetdaidl \
libui \
libunwind \
libutils
LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
LOCAL_JACK_FLAGS := --multi-dex native
LOCAL_DX_FLAGS := --multi-dex
LOCAL_PROGUARD_ENABLED := disabled
include $(BUILD_PACKAGE)
include $(call all-makefiles-under, $(LOCAL_PATH))

View File

@@ -0,0 +1,22 @@
// 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.
java_library {
name: "servicestests-aidl",
sdk_version: "current",
srcs: [
"com/android/servicestests/aidl/INetworkStateObserver.aidl",
"com/android/servicestests/aidl/ICmdReceiverService.aidl",
],
}

View File

@@ -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.
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE_TAGS := tests
LOCAL_SDK_VERSION := current
LOCAL_SRC_FILES := \
com/android/servicestests/aidl/INetworkStateObserver.aidl \
com/android/servicestests/aidl/ICmdReceiverService.aidl
LOCAL_MODULE := servicestests-aidl
include $(BUILD_STATIC_JAVA_LIBRARY)

View File

@@ -1 +0,0 @@
include $(call all-subdir-makefiles)

View File

@@ -0,0 +1,31 @@
// 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.
android_test_helper_app {
name: "ConnTestApp",
test_suites: ["device-tests"],
static_libs: ["servicestests-aidl"],
srcs: ["**/*.java"],
platform_apis: true,
certificate: "platform",
dex_preopt: {
enabled: false,
},
optimize: {
enabled: false,
},
}

View File

@@ -1,32 +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.
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE_TAGS := tests
LOCAL_COMPATIBILITY_SUITE := device-tests
LOCAL_STATIC_JAVA_LIBRARIES := servicestests-aidl
LOCAL_SRC_FILES := $(call all-subdir-java-files)
LOCAL_PACKAGE_NAME := ConnTestApp
LOCAL_PRIVATE_PLATFORM_APIS := true
LOCAL_CERTIFICATE := platform
LOCAL_DEX_PREOPT := false
LOCAL_PROGUARD_ENABLED := disabled
include $(BUILD_PACKAGE)

View File

@@ -0,0 +1,30 @@
// 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.
android_test_helper_app {
name: "JobTestApp",
sdk_version: "current",
test_suites: ["device-tests"],
srcs: ["**/*.java"],
dex_preopt: {
enabled: false,
},
optimize: {
enabled: false,
},
}

View File

@@ -1,30 +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.
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE_TAGS := tests
LOCAL_SDK_VERSION := current
LOCAL_COMPATIBILITY_SUITE := device-tests
LOCAL_SRC_FILES := $(call all-subdir-java-files)
LOCAL_PACKAGE_NAME := JobTestApp
LOCAL_DEX_PREOPT := false
LOCAL_PROGUARD_ENABLED := disabled
include $(BUILD_PACKAGE)

View File

@@ -0,0 +1,39 @@
// Copyright (C) 2018 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_helper_app {
name: "SuspendTestApp",
test_suites: ["device-tests"],
static_libs: [
"androidx.test.runner",
"ub-uiautomator",
],
srcs: [
"**/*.java",
":servicestests-SuspendTestApp-files",
],
dex_preopt: {
enabled: false,
},
optimize: {
enabled: false,
},
platform_apis: true,
}

View File

@@ -1,34 +0,0 @@
# Copyright (C) 2018 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_TAGS := tests
LOCAL_COMPATIBILITY_SUITE := device-tests
LOCAL_STATIC_JAVA_LIBRARIES := androidx.test.runner ub-uiautomator
LOCAL_SRC_FILES := $(call all-subdir-java-files)
LOCAL_SRC_FILES += ../../src/com/android/server/pm/SuspendPackagesTest.java
LOCAL_PACKAGE_NAME := SuspendTestApp
LOCAL_DEX_PREOPT := false
LOCAL_PROGUARD_ENABLED := disabled
LOCAL_PRIVATE_PLATFORM_APIS := true
include $(BUILD_PACKAGE)

View File

@@ -0,0 +1,26 @@
// 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.
java_library {
name: "ShortcutManagerTestUtils",
srcs: ["src/**/*.java"],
libs: [
"mockito-target",
"android.test.runner.stubs",
],
sdk_version: "test_current",
}

View File

@@ -1,32 +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)
LOCAL_SRC_FILES := \
$(call all-java-files-under, src)
LOCAL_JAVA_LIBRARIES := \
mockito-target \
android.test.runner.stubs
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE := ShortcutManagerTestUtils
LOCAL_SDK_VERSION := test_current
include $(BUILD_STATIC_JAVA_LIBRARY)

View File

@@ -0,0 +1,58 @@
//########################################################################
// Build FrameworksUiServicesTests package
//########################################################################
android_test {
name: "FrameworksUiServicesTests",
// Include test java files
srcs: [
"src/**/*.java",
],
static_libs: [
"services.accessibility",
"services.core",
"services.devicepolicy",
"services.net",
"services.usage",
"guava",
"android-support-test",
"mockito-target-inline-minus-junit4",
"platform-test-annotations",
"testables",
],
libs: [
"android.test.runner",
"android.test.base",
],
dxflags: ["--multi-dex"],
platform_apis: true,
test_suites: ["device-tests"],
certificate: "platform",
compile_multilib: "both",
// These are not normally accessible from apps so they must be explicitly included.
jni_libs: [
"libdexmakerjvmtiagent",
"libmultiplejvmtiagentsinterferenceagent",
"libbacktrace",
"libbase",
"libbinder",
"libbinderthreadstate",
"libc++",
"libcutils",
"liblog",
"liblzma",
"libnativehelper",
"libnetdaidl",
"libui",
"libunwindstack",
"libutils",
],
}

View File

@@ -1,61 +0,0 @@
#########################################################################
# Build FrameworksUiServicesTests package
#########################################################################
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
# We only want this apk build for tests.
LOCAL_MODULE_TAGS := tests
# Include test java files and source from notifications package.
LOCAL_SRC_FILES := $(call all-java-files-under, src) \
$(call all-java-files-under, ../../core/java/com/android/server/notification) \
$(call all-java-files-under, ../../core/java/com/android/server/slice) \
LOCAL_STATIC_JAVA_LIBRARIES := \
services.accessibility \
services.core \
services.devicepolicy \
services.net \
services.usage \
guava \
android-support-test \
mockito-target-inline-minus-junit4 \
platform-test-annotations \
testables
LOCAL_JAVA_LIBRARIES := android.test.runner android.test.base
LOCAL_JACK_FLAGS := --multi-dex native
LOCAL_DX_FLAGS := --multi-dex
LOCAL_PACKAGE_NAME := FrameworksUiServicesTests
LOCAL_PRIVATE_PLATFORM_APIS := true
LOCAL_COMPATIBILITY_SUITE := device-tests
LOCAL_CERTIFICATE := platform
LOCAL_MULTILIB := both
# These are not normally accessible from apps so they must be explicitly included.
LOCAL_JNI_SHARED_LIBRARIES := \
libdexmakerjvmtiagent \
libmultiplejvmtiagentsinterferenceagent \
libbacktrace \
libbase \
libbinder \
libbinderthreadstate \
libc++ \
libcutils \
liblog \
liblzma \
libnativehelper \
libnetdaidl \
libui \
libunwindstack \
libutils
LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
include $(BUILD_PACKAGE)

View File

@@ -0,0 +1,52 @@
//########################################################################
// Build WmTests package
//########################################################################
android_test {
name: "WmTests",
// We only want this apk build for tests.
// Include all test java files.
srcs: [
"src/**/*.java",
],
static_libs: [
"frameworks-base-testutils",
"services.core",
"androidx.test.runner",
"androidx.test.rules",
"mockito-target-extended-minus-junit4",
"platform-test-annotations",
"servicestests-utils",
"truth-prebuilt",
"testables",
"ub-uiautomator",
"hamcrest-library",
],
libs: [
"android.test.mock",
"android.test.base",
"android.test.runner",
],
// These are not normally accessible from apps so they must be explicitly included.
jni_libs: [
"libdexmakerjvmtiagent",
"libstaticjvmtiagent",
],
platform_apis: true,
test_suites: ["device-tests"],
certificate: "platform",
dxflags: ["--multi-dex"],
optimize: {
enabled: false,
},
}

View File

@@ -1,53 +0,0 @@
#########################################################################
# Build WmTests package
#########################################################################
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
# We only want this apk build for tests.
LOCAL_MODULE_TAGS := tests
# Include all test java files.
LOCAL_SRC_FILES := \
$(call all-java-files-under, src) \
$(call all-java-files-under, ../servicestests/utils) \
LOCAL_STATIC_JAVA_LIBRARIES := \
frameworks-base-testutils \
services.core \
androidx.test.runner \
androidx.test.rules \
mockito-target-extended-minus-junit4 \
platform-test-annotations \
truth-prebuilt \
testables \
ub-uiautomator \
hamcrest-library
LOCAL_JAVA_LIBRARIES := \
android.test.mock \
android.test.base \
android.test.runner \
# These are not normally accessible from apps so they must be explicitly included.
LOCAL_JNI_SHARED_LIBRARIES := \
libdexmakerjvmtiagent \
libstaticjvmtiagent \
LOCAL_PACKAGE_NAME := WmTests
LOCAL_PRIVATE_PLATFORM_APIS := true
LOCAL_COMPATIBILITY_SUITE := device-tests
LOCAL_CERTIFICATE := platform
LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
LOCAL_JACK_FLAGS := --multi-dex native
LOCAL_DX_FLAGS := --multi-dex
LOCAL_PROGUARD_ENABLED := disabled
include $(BUILD_PACKAGE)
include $(call all-makefiles-under, $(LOCAL_PATH))