Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 372fa2ed authored by Colin Cross's avatar Colin Cross Committed by Gerrit Code Review
Browse files

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

parents 33fe80f9 1d3245d6
Loading
Loading
Loading
Loading
+44 −0
Original line number Diff line number Diff line
// 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.devicepolicy",
        "frameworks-base-testutils",
        "androidx.test.runner",
        "mockito-target-extended-minus-junit4",
        "ShortcutManagerTestUtils",
        "compatibility-device-util",
        "truth-prebuilt",
    ],

    libs: ["android.test.mock"],

    jni_libs: [
        "libdexmakerjvmtiagent",
        "libstaticjvmtiagent",
    ],

    platform_apis: true,
    test_suites: ["device-tests"],

    optimize: {
        enabled: false,
    },
}
+0 −45
Original line number Diff line number Diff line
# 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.devicepolicy \
    frameworks-base-testutils \
    androidx.test.runner \
    mockito-target-extended-minus-junit4 \
    ShortcutManagerTestUtils \
    compatibility-device-util \
    truth-prebuilt

LOCAL_JAVA_LIBRARIES := \
    android.test.mock

LOCAL_JNI_SHARED_LIBRARIES := \
    libdexmakerjvmtiagent \
    libstaticjvmtiagent

LOCAL_PACKAGE_NAME := FrameworksMockingServicesTests
LOCAL_PRIVATE_PLATFORM_APIS := true
LOCAL_COMPATIBILITY_SUITE := device-tests

LOCAL_PROGUARD_ENABLED := disabled

include $(BUILD_PACKAGE)
+101 −0
Original line number Diff line number Diff line
//########################################################################
// 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",
        "android-support-test",
        "mockito-target-minus-junit4",
        "platform-test-annotations",
        "ShortcutManagerTestUtils",
        "truth-prebuilt",
        "testables",
        "testng",
        "ub-uiautomator",
        "platformprotosnano",
        "servicestests-utils",
    ],

    aidl: {
        local_include_dirs: ["aidl"],
    },

    libs: [
        "android.hidl.manager-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",
    ],
}
+0 −80
Original line number Diff line number Diff line
#########################################################################
# 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 \
    android-support-test \
    mockito-target-minus-junit4 \
    platform-test-annotations \
    ShortcutManagerTestUtils \
    truth-prebuilt \
    testables \
    testng \
    ub-uiautomator\
    platformprotosnano

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.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))
+22 −0
Original line number Diff line number Diff line
// 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",
    ],
}
Loading