1// Copyright (C) 2024 The Android Open Source Project 2// 3// Licensed under the Apache License, Version 2.0 (the "License"); 4// you may not use this file except in compliance with the License. 5// You may obtain a copy of the License at 6// 7// http://www.apache.org/licenses/LICENSE-2.0 8// 9// Unless required by applicable law or agreed to in writing, software 10// distributed under the License is distributed on an "AS IS" BASIS, 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12// See the License for the specific language governing permissions and 13// limitations under the License. 14 15package { 16 default_applicable_licenses: ["frameworks_base_license"], 17 default_team: "trendy_team_android_kernel", 18} 19 20cc_defaults { 21 name: "libpunch_defaults", 22 stl: "none", 23 host_supported: true, 24 srcs: ["jni/android_test_jni_source.cpp"], 25 header_libs: ["jni_headers"], 26} 27 28cc_library { 29 name: "libpunchtest", 30 defaults: ["libpunch_defaults"], 31} 32 33cc_library { 34 name: "libpunchtest_4kb", 35 defaults: ["libpunch_defaults"], 36 ldflags: ["-z max-page-size=0x1000"], 37} 38 39android_test_helper_app { 40 name: "app_with_4kb_elf", 41 srcs: ["app_with_4kb_elf/src/**/*.java"], 42 manifest: "app_with_4kb_elf/app_with_4kb_elf.xml", 43 compile_multilib: "64", 44 jni_libs: [ 45 "libpunchtest_4kb", 46 ], 47 static_libs: [ 48 "androidx.test.rules", 49 "platform-test-annotations", 50 ], 51 use_embedded_native_libs: true, 52} 53 54android_test_helper_app { 55 name: "embedded_native_libs_test_app", 56 srcs: ["apk_embedded_native_libs/src/**/*.java"], 57 manifest: "apk_embedded_native_libs/embedded_native_libs_test_app.xml", 58 compile_multilib: "64", 59 jni_libs: [ 60 "libpunchtest", 61 ], 62 static_libs: [ 63 "androidx.test.rules", 64 "platform-test-annotations", 65 ], 66 use_embedded_native_libs: true, 67} 68 69android_test_helper_app { 70 name: "extract_native_libs_test_app", 71 srcs: ["apk_extract_native_libs/src/**/*.java"], 72 manifest: "apk_extract_native_libs/extract_native_libs_test_app.xml", 73 compile_multilib: "64", 74 jni_libs: [ 75 "libpunchtest", 76 ], 77 static_libs: [ 78 "androidx.test.rules", 79 "platform-test-annotations", 80 ], 81 use_embedded_native_libs: false, 82} 83 84java_test_host { 85 name: "FileSystemUtilsTests", 86 // Include all test java files 87 srcs: ["src/**/*.java"], 88 static_libs: [ 89 "junit", 90 "platform-test-annotations", 91 "truth", 92 ], 93 libs: [ 94 "tradefed", 95 "compatibility-host-util", 96 "compatibility-tradefed", 97 ], 98 device_common_data: [ 99 ":embedded_native_libs_test_app", 100 ":extract_native_libs_test_app", 101 ":app_with_4kb_elf", 102 ], 103 test_suites: ["general-tests"], 104 test_config: "AndroidTest.xml", 105} 106