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 | |
| 17 | cc_defaults { |
| 18 | name: "libnativebridge-dummy-defaults", |
Martin Stjernholm | 2a21cc6 | 2019-10-22 12:14:20 +0100 | [diff] [blame] | 19 | defaults: [ |
| 20 | "art_defaults", |
| 21 | "art_test_defaults", |
Orion Hodson | 9b16e34 | 2019-10-09 13:29:16 +0100 | [diff] [blame] | 22 | ], |
Martin Stjernholm | 2a21cc6 | 2019-10-22 12:14:20 +0100 | [diff] [blame] | 23 | // TODO(mast): Split up art_gtest_defaults so that it can be used for the |
| 24 | // following without pulling in lots of libs. |
| 25 | target: { |
| 26 | linux: { |
| 27 | cflags: [ |
| 28 | // gtest issue |
| 29 | "-Wno-used-but-marked-unused", |
| 30 | "-Wno-deprecated", |
| 31 | "-Wno-missing-noreturn", |
| 32 | ], |
| 33 | }, |
| 34 | }, |
Orion Hodson | 00cb81d | 2020-04-03 06:47:07 +0100 | [diff] [blame] | 35 | header_libs: [ |
| 36 | "jni_headers", |
| 37 | "libnativebridge-headers", |
| 38 | ], |
Orion Hodson | 9b16e34 | 2019-10-09 13:29:16 +0100 | [diff] [blame] | 39 | cppflags: ["-fvisibility=protected"], |
| 40 | } |
| 41 | |
| 42 | cc_library_shared { |
| 43 | name: "libnativebridge-dummy", |
| 44 | srcs: ["DummyNativeBridge.cpp"], |
| 45 | defaults: ["libnativebridge-dummy-defaults"], |
| 46 | } |
| 47 | |
| 48 | cc_library_shared { |
| 49 | name: "libnativebridge2-dummy", |
| 50 | srcs: ["DummyNativeBridge2.cpp"], |
| 51 | defaults: ["libnativebridge-dummy-defaults"], |
| 52 | } |
| 53 | |
| 54 | cc_library_shared { |
| 55 | name: "libnativebridge3-dummy", |
| 56 | srcs: ["DummyNativeBridge3.cpp"], |
| 57 | defaults: ["libnativebridge-dummy-defaults"], |
| 58 | } |
| 59 | |
Lev Rumyantsev | abafbe7 | 2019-12-13 15:49:37 -0800 | [diff] [blame] | 60 | cc_library_shared { |
| 61 | name: "libnativebridge6-dummy", |
| 62 | srcs: ["DummyNativeBridge6.cpp"], |
| 63 | defaults: ["libnativebridge-dummy-defaults"], |
| 64 | shared_libs: [ |
| 65 | "libnativebridge6prezygotefork", |
| 66 | ], |
| 67 | } |
| 68 | |
| 69 | // A helper library to produce dummy side effect of PreZygoteForkNativeBridge. |
| 70 | cc_library_shared { |
| 71 | name: "libnativebridge6prezygotefork", |
| 72 | srcs: ["NativeBridge6PreZygoteFork_lib.cpp"], |
| 73 | defaults: ["libnativebridge-dummy-defaults"], |
| 74 | } |
| 75 | |
Orion Hodson | 9b16e34 | 2019-10-09 13:29:16 +0100 | [diff] [blame] | 76 | // Build the unit tests. |
| 77 | cc_defaults { |
| 78 | name: "libnativebridge-tests-defaults", |
Martin Stjernholm | 2a21cc6 | 2019-10-22 12:14:20 +0100 | [diff] [blame] | 79 | defaults: [ |
| 80 | "art_defaults", |
| 81 | "art_test_defaults", |
Orion Hodson | 9b16e34 | 2019-10-09 13:29:16 +0100 | [diff] [blame] | 82 | ], |
Christopher Ferris | fc5e2ef | 2020-05-08 00:08:42 +0000 | [diff] [blame] | 83 | test_per_src: true, |
Martin Stjernholm | 2a21cc6 | 2019-10-22 12:14:20 +0100 | [diff] [blame] | 84 | // TODO(mast): Split up art_gtest_defaults so that it can be used for the |
| 85 | // following without pulling in lots of libs. |
| 86 | target: { |
| 87 | linux: { |
| 88 | cflags: [ |
| 89 | // gtest issue |
| 90 | "-Wno-used-but-marked-unused", |
| 91 | "-Wno-deprecated", |
| 92 | "-Wno-missing-noreturn", |
| 93 | ], |
| 94 | }, |
| 95 | }, |
Orion Hodson | 9b16e34 | 2019-10-09 13:29:16 +0100 | [diff] [blame] | 96 | |
| 97 | srcs: [ |
| 98 | "CodeCacheCreate_test.cpp", |
| 99 | "CodeCacheExists_test.cpp", |
| 100 | "CodeCacheStatFail_test.cpp", |
| 101 | "CompleteFlow_test.cpp", |
| 102 | "InvalidCharsNativeBridge_test.cpp", |
| 103 | "NativeBridge2Signal_test.cpp", |
| 104 | "NativeBridgeVersion_test.cpp", |
| 105 | "NeedsNativeBridge_test.cpp", |
| 106 | "PreInitializeNativeBridge_test.cpp", |
| 107 | "PreInitializeNativeBridgeFail1_test.cpp", |
| 108 | "PreInitializeNativeBridgeFail2_test.cpp", |
| 109 | "ReSetupNativeBridge_test.cpp", |
| 110 | "UnavailableNativeBridge_test.cpp", |
| 111 | "ValidNameNativeBridge_test.cpp", |
| 112 | "NativeBridge3UnloadLibrary_test.cpp", |
| 113 | "NativeBridge3GetError_test.cpp", |
| 114 | "NativeBridge3IsPathSupported_test.cpp", |
| 115 | "NativeBridge3InitAnonymousNamespace_test.cpp", |
| 116 | "NativeBridge3CreateNamespace_test.cpp", |
| 117 | "NativeBridge3LoadLibraryExt_test.cpp", |
Lev Rumyantsev | abafbe7 | 2019-12-13 15:49:37 -0800 | [diff] [blame] | 118 | "NativeBridge6PreZygoteFork_test.cpp", |
Orion Hodson | 9b16e34 | 2019-10-09 13:29:16 +0100 | [diff] [blame] | 119 | ], |
| 120 | |
| 121 | shared_libs: [ |
| 122 | "liblog", |
| 123 | "libnativebridge-dummy", |
Lev Rumyantsev | abafbe7 | 2019-12-13 15:49:37 -0800 | [diff] [blame] | 124 | "libnativebridge6prezygotefork", |
Orion Hodson | 9b16e34 | 2019-10-09 13:29:16 +0100 | [diff] [blame] | 125 | ], |
| 126 | header_libs: ["libbase_headers"], |
| 127 | } |
| 128 | |
| 129 | cc_test { |
| 130 | name: "libnativebridge-tests", |
| 131 | defaults: ["libnativebridge-tests-defaults"], |
Orion Hodson | 9b16e34 | 2019-10-09 13:29:16 +0100 | [diff] [blame] | 132 | shared_libs: ["libnativebridge"], |
| 133 | } |
| 134 | |
| 135 | cc_test { |
| 136 | name: "libnativebridge-lazy-tests", |
| 137 | defaults: ["libnativebridge-tests-defaults"], |
Martin Stjernholm | 2a21cc6 | 2019-10-22 12:14:20 +0100 | [diff] [blame] | 138 | host_supported: false, |
Orion Hodson | 9b16e34 | 2019-10-09 13:29:16 +0100 | [diff] [blame] | 139 | shared_libs: ["libnativebridge_lazy"], |
| 140 | } |
| 141 | |
| 142 | // Build the test for the C API. |
| 143 | cc_test { |
| 144 | name: "libnativebridge-api-tests", |
Martin Stjernholm | 2a21cc6 | 2019-10-22 12:14:20 +0100 | [diff] [blame] | 145 | defaults: [ |
| 146 | "art_defaults", |
| 147 | "art_test_defaults", |
| 148 | ], |
Christopher Ferris | fc5e2ef | 2020-05-08 00:08:42 +0000 | [diff] [blame] | 149 | test_per_src: true, |
Martin Stjernholm | 2a21cc6 | 2019-10-22 12:14:20 +0100 | [diff] [blame] | 150 | // TODO(mast): Split up art_gtest_defaults so that it can be used for the |
| 151 | // following without pulling in lots of libs. |
| 152 | target: { |
| 153 | linux: { |
| 154 | cflags: [ |
| 155 | // gtest issue |
| 156 | "-Wno-used-but-marked-unused", |
| 157 | "-Wno-deprecated", |
| 158 | "-Wno-missing-noreturn", |
| 159 | ], |
| 160 | }, |
| 161 | }, |
Orion Hodson | 9b16e34 | 2019-10-09 13:29:16 +0100 | [diff] [blame] | 162 | srcs: [ |
| 163 | "NativeBridgeApi.c", |
| 164 | ], |
Orion Hodson | 00cb81d | 2020-04-03 06:47:07 +0100 | [diff] [blame] | 165 | header_libs: [ |
| 166 | "jni_headers", |
| 167 | "libnativebridge-headers", |
| 168 | ], |
Orion Hodson | 9b16e34 | 2019-10-09 13:29:16 +0100 | [diff] [blame] | 169 | } |