| Orion Hodson | 9b16e34 | 2019-10-09 13:29:16 +0100 | [diff] [blame] | 1 | // |
| 2 | // Copyright (C) 2017 The Android Open Source Project |
| 3 | // |
| 4 | // Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | // you may not use this file except in compliance with the License. |
| 6 | // You may obtain a copy of the License at |
| 7 | // |
| 8 | // http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | // |
| 10 | // Unless required by applicable law or agreed to in writing, software |
| 11 | // distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | // See the License for the specific language governing permissions and |
| 14 | // limitations under the License. |
| 15 | // |
| 16 | |
| Bob Badour | 9150de6 | 2021-02-26 03:22:24 -0800 | [diff] [blame] | 17 | package { |
| 18 | // See: http://go/android-license-faq |
| 19 | // A large-scale-change added 'default_applicable_licenses' to import |
| 20 | // all of the 'license_kinds' from "art_license" |
| 21 | // to get the below license kinds: |
| 22 | // SPDX-license-identifier-Apache-2.0 |
| 23 | default_applicable_licenses: ["art_license"], |
| 24 | } |
| 25 | |
| Orion Hodson | 9b16e34 | 2019-10-09 13:29:16 +0100 | [diff] [blame] | 26 | cc_defaults { |
| Orion Hodson | d1ccdfa | 2020-07-27 14:12:46 +0100 | [diff] [blame] | 27 | name: "libnativebridge-test-case-defaults", |
| Martin Stjernholm | 2a21cc6 | 2019-10-22 12:14:20 +0100 | [diff] [blame] | 28 | defaults: [ |
| 29 | "art_defaults", |
| 30 | "art_test_defaults", |
| Orion Hodson | 9b16e34 | 2019-10-09 13:29:16 +0100 | [diff] [blame] | 31 | ], |
| Martin Stjernholm | 2a21cc6 | 2019-10-22 12:14:20 +0100 | [diff] [blame] | 32 | // TODO(mast): Split up art_gtest_defaults so that it can be used for the |
| 33 | // following without pulling in lots of libs. |
| 34 | target: { |
| 35 | linux: { |
| 36 | cflags: [ |
| 37 | // gtest issue |
| 38 | "-Wno-used-but-marked-unused", |
| 39 | "-Wno-deprecated", |
| 40 | "-Wno-missing-noreturn", |
| 41 | ], |
| 42 | }, |
| 43 | }, |
| Orion Hodson | 00cb81d | 2020-04-03 06:47:07 +0100 | [diff] [blame] | 44 | header_libs: [ |
| 45 | "jni_headers", |
| 46 | "libnativebridge-headers", |
| 47 | ], |
| Orion Hodson | 9b16e34 | 2019-10-09 13:29:16 +0100 | [diff] [blame] | 48 | cppflags: ["-fvisibility=protected"], |
| 49 | } |
| 50 | |
| Martin Stjernholm | d90291b | 2021-05-27 20:54:22 +0100 | [diff] [blame] | 51 | cc_test_library { |
| Orion Hodson | d1ccdfa | 2020-07-27 14:12:46 +0100 | [diff] [blame] | 52 | name: "libnativebridge-test-case", |
| 53 | srcs: ["NativeBridgeTestCase.cpp"], |
| 54 | defaults: ["libnativebridge-test-case-defaults"], |
| Orion Hodson | 9b16e34 | 2019-10-09 13:29:16 +0100 | [diff] [blame] | 55 | } |
| 56 | |
| Martin Stjernholm | d90291b | 2021-05-27 20:54:22 +0100 | [diff] [blame] | 57 | cc_test_library { |
| Orion Hodson | d1ccdfa | 2020-07-27 14:12:46 +0100 | [diff] [blame] | 58 | name: "libnativebridge2-test-case", |
| 59 | srcs: ["NativeBridgeTestCase2.cpp"], |
| 60 | defaults: ["libnativebridge-test-case-defaults"], |
| Orion Hodson | 9b16e34 | 2019-10-09 13:29:16 +0100 | [diff] [blame] | 61 | } |
| 62 | |
| Martin Stjernholm | d90291b | 2021-05-27 20:54:22 +0100 | [diff] [blame] | 63 | cc_test_library { |
| Orion Hodson | d1ccdfa | 2020-07-27 14:12:46 +0100 | [diff] [blame] | 64 | name: "libnativebridge3-test-case", |
| 65 | srcs: ["NativeBridgeTestCase3.cpp"], |
| 66 | defaults: ["libnativebridge-test-case-defaults"], |
| Orion Hodson | 9b16e34 | 2019-10-09 13:29:16 +0100 | [diff] [blame] | 67 | } |
| 68 | |
| Martin Stjernholm | d90291b | 2021-05-27 20:54:22 +0100 | [diff] [blame] | 69 | cc_test_library { |
| Orion Hodson | d1ccdfa | 2020-07-27 14:12:46 +0100 | [diff] [blame] | 70 | name: "libnativebridge6-test-case", |
| 71 | srcs: ["NativeBridgeTestCase6.cpp"], |
| 72 | defaults: ["libnativebridge-test-case-defaults"], |
| Lev Rumyantsev | abafbe7 | 2019-12-13 15:49:37 -0800 | [diff] [blame] | 73 | shared_libs: [ |
| 74 | "libnativebridge6prezygotefork", |
| 75 | ], |
| 76 | } |
| 77 | |
| Orion Hodson | d1ccdfa | 2020-07-27 14:12:46 +0100 | [diff] [blame] | 78 | // A helper library to produce test-case side effect of PreZygoteForkNativeBridge. |
| Martin Stjernholm | d90291b | 2021-05-27 20:54:22 +0100 | [diff] [blame] | 79 | cc_test_library { |
| Lev Rumyantsev | abafbe7 | 2019-12-13 15:49:37 -0800 | [diff] [blame] | 80 | name: "libnativebridge6prezygotefork", |
| 81 | srcs: ["NativeBridge6PreZygoteFork_lib.cpp"], |
| Orion Hodson | d1ccdfa | 2020-07-27 14:12:46 +0100 | [diff] [blame] | 82 | defaults: ["libnativebridge-test-case-defaults"], |
| Lev Rumyantsev | abafbe7 | 2019-12-13 15:49:37 -0800 | [diff] [blame] | 83 | } |
| 84 | |
| Orion Hodson | 9b16e34 | 2019-10-09 13:29:16 +0100 | [diff] [blame] | 85 | cc_defaults { |
| 86 | name: "libnativebridge-tests-defaults", |
| Martin Stjernholm | 2a21cc6 | 2019-10-22 12:14:20 +0100 | [diff] [blame] | 87 | defaults: [ |
| 88 | "art_defaults", |
| 89 | "art_test_defaults", |
| Orion Hodson | 9b16e34 | 2019-10-09 13:29:16 +0100 | [diff] [blame] | 90 | ], |
| Martin Stjernholm | 2a21cc6 | 2019-10-22 12:14:20 +0100 | [diff] [blame] | 91 | // TODO(mast): Split up art_gtest_defaults so that it can be used for the |
| 92 | // following without pulling in lots of libs. |
| 93 | target: { |
| 94 | linux: { |
| 95 | cflags: [ |
| 96 | // gtest issue |
| 97 | "-Wno-used-but-marked-unused", |
| 98 | "-Wno-deprecated", |
| 99 | "-Wno-missing-noreturn", |
| 100 | ], |
| 101 | }, |
| 102 | }, |
| Martin Stjernholm | 19d1feb | 2021-03-30 22:35:24 +0100 | [diff] [blame] | 103 | } |
| 104 | |
| 105 | cc_test { |
| 106 | name: "libnativebridge-tests", |
| 107 | defaults: ["libnativebridge-tests-defaults"], |
| Orion Hodson | 9b16e34 | 2019-10-09 13:29:16 +0100 | [diff] [blame] | 108 | |
| Martin Stjernholm | d90291b | 2021-05-27 20:54:22 +0100 | [diff] [blame] | 109 | // native_bridge.cc doesn't support reloading the native bridge after |
| 110 | // unloading, so each test needs to be its own process. |
| 111 | test_per_src: true, |
| 112 | |
| Orion Hodson | 9b16e34 | 2019-10-09 13:29:16 +0100 | [diff] [blame] | 113 | srcs: [ |
| Martin Stjernholm | 6034c07 | 2021-06-02 00:35:39 +0100 | [diff] [blame] | 114 | "NativeBridgeApi.c", |
| Orion Hodson | 9b16e34 | 2019-10-09 13:29:16 +0100 | [diff] [blame] | 115 | "CodeCacheCreate_test.cpp", |
| 116 | "CodeCacheExists_test.cpp", |
| 117 | "CodeCacheStatFail_test.cpp", |
| 118 | "CompleteFlow_test.cpp", |
| 119 | "InvalidCharsNativeBridge_test.cpp", |
| 120 | "NativeBridge2Signal_test.cpp", |
| 121 | "NativeBridgeVersion_test.cpp", |
| 122 | "NeedsNativeBridge_test.cpp", |
| 123 | "PreInitializeNativeBridge_test.cpp", |
| Orion Hodson | 9b16e34 | 2019-10-09 13:29:16 +0100 | [diff] [blame] | 124 | "PreInitializeNativeBridgeFail2_test.cpp", |
| 125 | "ReSetupNativeBridge_test.cpp", |
| 126 | "UnavailableNativeBridge_test.cpp", |
| 127 | "ValidNameNativeBridge_test.cpp", |
| 128 | "NativeBridge3UnloadLibrary_test.cpp", |
| 129 | "NativeBridge3GetError_test.cpp", |
| 130 | "NativeBridge3IsPathSupported_test.cpp", |
| 131 | "NativeBridge3InitAnonymousNamespace_test.cpp", |
| 132 | "NativeBridge3CreateNamespace_test.cpp", |
| 133 | "NativeBridge3LoadLibraryExt_test.cpp", |
| Lev Rumyantsev | abafbe7 | 2019-12-13 15:49:37 -0800 | [diff] [blame] | 134 | "NativeBridge6PreZygoteFork_test.cpp", |
| Orion Hodson | 9b16e34 | 2019-10-09 13:29:16 +0100 | [diff] [blame] | 135 | ], |
| 136 | |
| 137 | shared_libs: [ |
| 138 | "liblog", |
| Martin Stjernholm | 19d1feb | 2021-03-30 22:35:24 +0100 | [diff] [blame] | 139 | "libnativebridge", |
| Orion Hodson | d1ccdfa | 2020-07-27 14:12:46 +0100 | [diff] [blame] | 140 | "libnativebridge-test-case", |
| Martin Stjernholm | d90291b | 2021-05-27 20:54:22 +0100 | [diff] [blame] | 141 | "libnativebridge2-test-case", |
| 142 | "libnativebridge3-test-case", |
| 143 | "libnativebridge6-test-case", |
| Lev Rumyantsev | abafbe7 | 2019-12-13 15:49:37 -0800 | [diff] [blame] | 144 | "libnativebridge6prezygotefork", |
| Orion Hodson | 9b16e34 | 2019-10-09 13:29:16 +0100 | [diff] [blame] | 145 | ], |
| 146 | header_libs: ["libbase_headers"], |
| 147 | } |
| 148 | |
| 149 | cc_test { |
| Orion Hodson | 9b16e34 | 2019-10-09 13:29:16 +0100 | [diff] [blame] | 150 | name: "libnativebridge-lazy-tests", |
| 151 | defaults: ["libnativebridge-tests-defaults"], |
| Martin Stjernholm | 2a21cc6 | 2019-10-22 12:14:20 +0100 | [diff] [blame] | 152 | host_supported: false, |
| Martin Stjernholm | 19d1feb | 2021-03-30 22:35:24 +0100 | [diff] [blame] | 153 | test_suites: ["device-tests"], |
| 154 | static_libs: [ |
| 155 | "libbase", |
| 156 | "libnativebridge_lazy", |
| 157 | ], |
| 158 | srcs: ["libnativebridge_lazy_test.cpp"], |
| Orion Hodson | 9b16e34 | 2019-10-09 13:29:16 +0100 | [diff] [blame] | 159 | } |