blob: 50bf0abd25b027b265c4a467ecf5bbed91ab77f9 [file] [log] [blame]
Orion Hodson9b16e342019-10-09 13:29:16 +01001//
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
17cc_defaults {
18 name: "libnativebridge-dummy-defaults",
Martin Stjernholm2a21cc62019-10-22 12:14:20 +010019 defaults: [
20 "art_defaults",
21 "art_test_defaults",
Orion Hodson9b16e342019-10-09 13:29:16 +010022 ],
Martin Stjernholm2a21cc62019-10-22 12:14:20 +010023 // 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 Hodson00cb81d2020-04-03 06:47:07 +010035 header_libs: [
36 "jni_headers",
37 "libnativebridge-headers",
38 ],
Orion Hodson9b16e342019-10-09 13:29:16 +010039 cppflags: ["-fvisibility=protected"],
40}
41
42cc_library_shared {
43 name: "libnativebridge-dummy",
44 srcs: ["DummyNativeBridge.cpp"],
45 defaults: ["libnativebridge-dummy-defaults"],
46}
47
48cc_library_shared {
49 name: "libnativebridge2-dummy",
50 srcs: ["DummyNativeBridge2.cpp"],
51 defaults: ["libnativebridge-dummy-defaults"],
52}
53
54cc_library_shared {
55 name: "libnativebridge3-dummy",
56 srcs: ["DummyNativeBridge3.cpp"],
57 defaults: ["libnativebridge-dummy-defaults"],
58}
59
Lev Rumyantsevabafbe72019-12-13 15:49:37 -080060cc_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.
70cc_library_shared {
71 name: "libnativebridge6prezygotefork",
72 srcs: ["NativeBridge6PreZygoteFork_lib.cpp"],
73 defaults: ["libnativebridge-dummy-defaults"],
74}
75
Orion Hodson9b16e342019-10-09 13:29:16 +010076// Build the unit tests.
77cc_defaults {
78 name: "libnativebridge-tests-defaults",
Martin Stjernholm2a21cc62019-10-22 12:14:20 +010079 defaults: [
80 "art_defaults",
81 "art_test_defaults",
Orion Hodson9b16e342019-10-09 13:29:16 +010082 ],
Christopher Ferrisfc5e2ef2020-05-08 00:08:42 +000083 test_per_src: true,
Martin Stjernholm2a21cc62019-10-22 12:14:20 +010084 // 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 Hodson9b16e342019-10-09 13:29:16 +010096
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 Rumyantsevabafbe72019-12-13 15:49:37 -0800118 "NativeBridge6PreZygoteFork_test.cpp",
Orion Hodson9b16e342019-10-09 13:29:16 +0100119 ],
120
121 shared_libs: [
122 "liblog",
123 "libnativebridge-dummy",
Lev Rumyantsevabafbe72019-12-13 15:49:37 -0800124 "libnativebridge6prezygotefork",
Orion Hodson9b16e342019-10-09 13:29:16 +0100125 ],
126 header_libs: ["libbase_headers"],
127}
128
129cc_test {
130 name: "libnativebridge-tests",
131 defaults: ["libnativebridge-tests-defaults"],
Orion Hodson9b16e342019-10-09 13:29:16 +0100132 shared_libs: ["libnativebridge"],
133}
134
135cc_test {
136 name: "libnativebridge-lazy-tests",
137 defaults: ["libnativebridge-tests-defaults"],
Martin Stjernholm2a21cc62019-10-22 12:14:20 +0100138 host_supported: false,
Orion Hodson9b16e342019-10-09 13:29:16 +0100139 shared_libs: ["libnativebridge_lazy"],
140}
141
142// Build the test for the C API.
143cc_test {
144 name: "libnativebridge-api-tests",
Martin Stjernholm2a21cc62019-10-22 12:14:20 +0100145 defaults: [
146 "art_defaults",
147 "art_test_defaults",
148 ],
Christopher Ferrisfc5e2ef2020-05-08 00:08:42 +0000149 test_per_src: true,
Martin Stjernholm2a21cc62019-10-22 12:14:20 +0100150 // 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 Hodson9b16e342019-10-09 13:29:16 +0100162 srcs: [
163 "NativeBridgeApi.c",
164 ],
Orion Hodson00cb81d2020-04-03 06:47:07 +0100165 header_libs: [
166 "jni_headers",
167 "libnativebridge-headers",
168 ],
Orion Hodson9b16e342019-10-09 13:29:16 +0100169}