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

Commit d057e233 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Convert FrameworksCoreTests to Android.bp"

parents 17c63bab 85e2be0e
Loading
Loading
Loading
Loading
+113 −0
Original line number Diff line number Diff line
android_test {
    name: "FrameworksCoreTests",

    srcs: [
        "src/**/*.java",
        "src/**/I*.aidl",
        "DisabledTestApp/src/**/*.java",
        "EnabledTestApp/src/**/*.java",
        "BinderProxyCountingTestApp/src/**/*.java",
        "BinderProxyCountingTestService/src/**/*.java",
        "aidl/**/I*.aidl",
    ],

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

    dxflags: ["--core-library"],

    aaptflags: [
        "-0 .dat",
        "-0 .gld",
        "-c fa",
    ],
    static_libs: [
        "frameworks-base-testutils",
        "core-tests-support",
        "android-common",
        "frameworks-core-util-lib",
        "mockwebserver",
        "guava",
        "androidx.test.espresso.core",
        "androidx.test.ext.junit",
        "androidx.test.runner",
        "androidx.test.rules",
        "mockito-target-minus-junit4",
        "ub-uiautomator",
        "platform-test-annotations",
        "truth-prebuilt",
        "print-test-util-lib",
        "testng",
    ],

    libs: [
        "android.test.runner",
        "telephony-common",
        "testables",
        "org.apache.http.legacy",
        "android.test.base",
        "android.test.mock",
        "framework-atb-backward-compatibility",
    ],

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

    certificate: "platform",

    resource_dirs: ["res"],
    resource_zips: [":FrameworksCoreTests_apks_as_resources"],
}

// Rules to copy all the test apks to the intermediate raw resource directory
java_genrule {
    name: "FrameworksCoreTests_apks_as_resources",
    srcs: [
        ":FrameworksCoreTests_install",
        ":FrameworksCoreTests_install_bad_dex",
        ":FrameworksCoreTests_install_complete_package_info",
        ":FrameworksCoreTests_install_decl_perm",
        ":FrameworksCoreTests_install_jni_lib_open_from_apk",
        ":FrameworksCoreTests_install_loc_auto",
        ":FrameworksCoreTests_install_loc_internal",
        ":FrameworksCoreTests_install_loc_sdcard",
        ":FrameworksCoreTests_install_loc_unspecified",
        ":FrameworksCoreTests_install_multi_package",
        ":FrameworksCoreTests_install_split_base",
        ":FrameworksCoreTests_install_split_feature_a",
        ":FrameworksCoreTests_install_use_perm_good",
        ":FrameworksCoreTests_install_uses_feature",
        ":FrameworksCoreTests_install_verifier_bad",
        ":FrameworksCoreTests_install_verifier_good",
        ":FrameworksCoreTests_keyset_permdef_sa_unone",
        ":FrameworksCoreTests_keyset_permuse_sa_ua_ub",
        ":FrameworksCoreTests_keyset_permuse_sb_ua_ub",
        ":FrameworksCoreTests_keyset_sab_ua",
        ":FrameworksCoreTests_keyset_sa_ua",
        ":FrameworksCoreTests_keyset_sa_uab",
        ":FrameworksCoreTests_keyset_sa_ua_ub",
        ":FrameworksCoreTests_keyset_sa_ub",
        ":FrameworksCoreTests_keyset_sa_unone",
        ":FrameworksCoreTests_keyset_sau_ub",
        ":FrameworksCoreTests_keyset_sb_ua",
        ":FrameworksCoreTests_keyset_sb_ub",
        ":FrameworksCoreTests_keyset_splata_api",
        ":FrameworksCoreTests_keyset_splat_api",
        ":FrameworksCoreTests_locales",
        ":FrameworksCoreTests_version_1",
        ":FrameworksCoreTests_version_1_diff",
        ":FrameworksCoreTests_version_1_nosys",
        ":FrameworksCoreTests_version_2",
        ":FrameworksCoreTests_version_2_diff",
        ":FrameworksCoreTests_version_3",
    ],
    out: ["FrameworkCoreTests_apks_as_resources.res.zip"],
    tools: ["soong_zip"],

    cmd: "mkdir -p $(genDir)/res/raw && " +
        "for i in $(in); do " +
        "  x=$${i##*FrameworksCoreTests_}; echo $${x}; cp $$i $(genDir)/res/raw/$${x%.apk};" +
        "done && " +
        "$(location soong_zip) -o $(out) -C $(genDir)/res -D $(genDir)/res",
}

core/tests/coretests/Android.mk

deleted100644 → 0
+0 −85
Original line number Diff line number Diff line
ACTUAL_LOCAL_PATH := $(call my-dir)

# this var will hold all the test apk module names later.
FrameworkCoreTests_all_apks :=

# We have to include the subdir makefiles first
# so that FrameworkCoreTests_all_apks will be populated correctly.
include $(call all-makefiles-under,$(ACTUAL_LOCAL_PATH))

LOCAL_PATH := $(ACTUAL_LOCAL_PATH)

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-Iaidl-files-under, src) \
	$(call all-java-files-under, DisabledTestApp/src) \
	$(call all-java-files-under, EnabledTestApp/src) \
	$(call all-java-files-under, BinderProxyCountingTestApp/src) \
	$(call all-java-files-under, BinderProxyCountingTestService/src) \
	$(call all-Iaidl-files-under, aidl)

LOCAL_AIDL_INCLUDES := $(LOCAL_PATH)/aidl

LOCAL_DX_FLAGS := --core-library
LOCAL_JACK_FLAGS := --multi-dex native
LOCAL_AAPT_FLAGS = -0 dat -0 gld -c fa
LOCAL_STATIC_JAVA_LIBRARIES := \
    frameworks-base-testutils \
    core-tests-support \
    android-common \
    frameworks-core-util-lib \
    mockwebserver \
    guava \
    androidx.test.espresso.core \
    androidx.test.ext.junit \
    androidx.test.runner \
    androidx.test.rules \
    mockito-target-minus-junit4 \
    ub-uiautomator \
    platform-test-annotations \
    truth-prebuilt \
    print-test-util-lib \
    testng # TODO: remove once Android migrates to JUnit 4.12, which provide assertThrows

LOCAL_JAVA_LIBRARIES := \
    android.test.runner \
    telephony-common \
    testables \
    org.apache.http.legacy \
    android.test.base \
    android.test.mock \
    framework-atb-backward-compatibility \

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

LOCAL_CERTIFICATE := platform

# intermediate dir to include all the test apks as raw resource
FrameworkCoreTests_intermediates := $(call intermediates-dir-for,APPS,$(LOCAL_PACKAGE_NAME))/test_apks/res
LOCAL_RESOURCE_DIR := $(FrameworkCoreTests_intermediates) $(LOCAL_PATH)/res

# Disable AAPT2 because the hacks below depend on the AAPT rules implementation
LOCAL_USE_AAPT2 := false

include $(BUILD_PACKAGE)
# Rules to copy all the test apks to the intermediate raw resource directory
FrameworkCoreTests_all_apks_res := $(addprefix $(FrameworkCoreTests_intermediates)/raw/, \
    $(foreach a, $(FrameworkCoreTests_all_apks), $(patsubst FrameworkCoreTests_%,%,$(a))))

$(FrameworkCoreTests_all_apks_res): $(FrameworkCoreTests_intermediates)/raw/%: $(call intermediates-dir-for,APPS,FrameworkCoreTests_%)/package.apk
	$(call copy-file-to-new-target)

# Use R_file_stamp as dependency because we want the test apks in place before the R.java is generated.
$(R_file_stamp) : $(FrameworkCoreTests_all_apks_res)

FrameworkCoreTests_all_apks :=
FrameworkCoreTests_intermediates :=
FrameworkCoreTests_all_apks_res :=
+25 −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.

android_test_helper_app {
    name: "BinderProxyCountingTestApp",

    static_libs: ["coretests-aidl"],
    srcs: ["**/*.java"],

    sdk_version: "current",
    certificate: "platform",

    test_suites: ["device-tests"],
}
+0 −29
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.

LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)

LOCAL_MODULE_TAGS := tests

LOCAL_STATIC_JAVA_LIBRARIES := coretests-aidl
LOCAL_SRC_FILES := $(call all-subdir-java-files)

LOCAL_PACKAGE_NAME := BinderProxyCountingTestApp
LOCAL_SDK_VERSION := current
LOCAL_CERTIFICATE := platform

LOCAL_COMPATIBILITY_SUITE := device-tests
include $(BUILD_PACKAGE)
+25 −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.

android_test_helper_app {
    name: "BinderProxyCountingTestService",

    static_libs: ["coretests-aidl"],
    srcs: ["**/*.java"],

    platform_apis: true,
    certificate: "platform",

    test_suites: ["device-tests"],
}
Loading