| 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 | 9b16e34 | 2019-10-09 13:29:16 +0100 | [diff] [blame] | 35 | header_libs: ["libnativebridge-headers"], |
| 36 | cppflags: ["-fvisibility=protected"], |
| 37 | } |
| 38 | |
| 39 | cc_library_shared { |
| 40 | name: "libnativebridge-dummy", |
| 41 | srcs: ["DummyNativeBridge.cpp"], |
| 42 | defaults: ["libnativebridge-dummy-defaults"], |
| 43 | } |
| 44 | |
| 45 | cc_library_shared { |
| 46 | name: "libnativebridge2-dummy", |
| 47 | srcs: ["DummyNativeBridge2.cpp"], |
| 48 | defaults: ["libnativebridge-dummy-defaults"], |
| 49 | } |
| 50 | |
| 51 | cc_library_shared { |
| 52 | name: "libnativebridge3-dummy", |
| 53 | srcs: ["DummyNativeBridge3.cpp"], |
| 54 | defaults: ["libnativebridge-dummy-defaults"], |
| 55 | } |
| 56 | |
| 57 | // Build the unit tests. |
| 58 | cc_defaults { |
| 59 | name: "libnativebridge-tests-defaults", |
| Martin Stjernholm | 2a21cc6 | 2019-10-22 12:14:20 +0100 | [diff] [blame^] | 60 | defaults: [ |
| 61 | "art_defaults", |
| 62 | "art_test_defaults", |
| Orion Hodson | 9b16e34 | 2019-10-09 13:29:16 +0100 | [diff] [blame] | 63 | ], |
| Martin Stjernholm | 2a21cc6 | 2019-10-22 12:14:20 +0100 | [diff] [blame^] | 64 | test_per_src: true, |
| 65 | // TODO(mast): Split up art_gtest_defaults so that it can be used for the |
| 66 | // following without pulling in lots of libs. |
| 67 | target: { |
| 68 | linux: { |
| 69 | cflags: [ |
| 70 | // gtest issue |
| 71 | "-Wno-used-but-marked-unused", |
| 72 | "-Wno-deprecated", |
| 73 | "-Wno-missing-noreturn", |
| 74 | ], |
| 75 | }, |
| 76 | }, |
| Orion Hodson | 9b16e34 | 2019-10-09 13:29:16 +0100 | [diff] [blame] | 77 | |
| 78 | srcs: [ |
| 79 | "CodeCacheCreate_test.cpp", |
| 80 | "CodeCacheExists_test.cpp", |
| 81 | "CodeCacheStatFail_test.cpp", |
| 82 | "CompleteFlow_test.cpp", |
| 83 | "InvalidCharsNativeBridge_test.cpp", |
| 84 | "NativeBridge2Signal_test.cpp", |
| 85 | "NativeBridgeVersion_test.cpp", |
| 86 | "NeedsNativeBridge_test.cpp", |
| 87 | "PreInitializeNativeBridge_test.cpp", |
| 88 | "PreInitializeNativeBridgeFail1_test.cpp", |
| 89 | "PreInitializeNativeBridgeFail2_test.cpp", |
| 90 | "ReSetupNativeBridge_test.cpp", |
| 91 | "UnavailableNativeBridge_test.cpp", |
| 92 | "ValidNameNativeBridge_test.cpp", |
| 93 | "NativeBridge3UnloadLibrary_test.cpp", |
| 94 | "NativeBridge3GetError_test.cpp", |
| 95 | "NativeBridge3IsPathSupported_test.cpp", |
| 96 | "NativeBridge3InitAnonymousNamespace_test.cpp", |
| 97 | "NativeBridge3CreateNamespace_test.cpp", |
| 98 | "NativeBridge3LoadLibraryExt_test.cpp", |
| 99 | ], |
| 100 | |
| 101 | shared_libs: [ |
| 102 | "liblog", |
| 103 | "libnativebridge-dummy", |
| 104 | ], |
| 105 | header_libs: ["libbase_headers"], |
| 106 | } |
| 107 | |
| 108 | cc_test { |
| 109 | name: "libnativebridge-tests", |
| 110 | defaults: ["libnativebridge-tests-defaults"], |
| Orion Hodson | 9b16e34 | 2019-10-09 13:29:16 +0100 | [diff] [blame] | 111 | shared_libs: ["libnativebridge"], |
| 112 | } |
| 113 | |
| 114 | cc_test { |
| 115 | name: "libnativebridge-lazy-tests", |
| 116 | defaults: ["libnativebridge-tests-defaults"], |
| Martin Stjernholm | 2a21cc6 | 2019-10-22 12:14:20 +0100 | [diff] [blame^] | 117 | host_supported: false, |
| Orion Hodson | 9b16e34 | 2019-10-09 13:29:16 +0100 | [diff] [blame] | 118 | shared_libs: ["libnativebridge_lazy"], |
| 119 | } |
| 120 | |
| 121 | // Build the test for the C API. |
| 122 | cc_test { |
| 123 | name: "libnativebridge-api-tests", |
| Martin Stjernholm | 2a21cc6 | 2019-10-22 12:14:20 +0100 | [diff] [blame^] | 124 | defaults: [ |
| 125 | "art_defaults", |
| 126 | "art_test_defaults", |
| 127 | ], |
| Orion Hodson | 9b16e34 | 2019-10-09 13:29:16 +0100 | [diff] [blame] | 128 | test_per_src: true, |
| Martin Stjernholm | 2a21cc6 | 2019-10-22 12:14:20 +0100 | [diff] [blame^] | 129 | // TODO(mast): Split up art_gtest_defaults so that it can be used for the |
| 130 | // following without pulling in lots of libs. |
| 131 | target: { |
| 132 | linux: { |
| 133 | cflags: [ |
| 134 | // gtest issue |
| 135 | "-Wno-used-but-marked-unused", |
| 136 | "-Wno-deprecated", |
| 137 | "-Wno-missing-noreturn", |
| 138 | ], |
| 139 | }, |
| 140 | }, |
| Orion Hodson | 9b16e34 | 2019-10-09 13:29:16 +0100 | [diff] [blame] | 141 | srcs: [ |
| 142 | "NativeBridgeApi.c", |
| 143 | ], |
| 144 | header_libs: ["libnativebridge-headers"], |
| 145 | } |