blob: 2bb84673850287cd726a84fb4da5877c52cdf0b3 [file] [log] [blame]
Tomasz Wasilczyke38d3a62017-05-08 15:29:10 -07001//
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",
19
20 host_supported: true,
21 cflags: [
22 "-Wall",
23 "-Wextra",
24 "-Werror",
25 ],
Jiyong Park00f2ebe2019-01-29 00:08:55 +090026 header_libs: ["libnativebridge-headers"],
Tomasz Wasilczyke38d3a62017-05-08 15:29:10 -070027 cppflags: ["-fvisibility=protected"],
Tomasz Wasilczyke38d3a62017-05-08 15:29:10 -070028}
29
30cc_library_shared {
31 name: "libnativebridge-dummy",
32 srcs: ["DummyNativeBridge.cpp"],
33 defaults: ["libnativebridge-dummy-defaults"],
34}
35
36cc_library_shared {
37 name: "libnativebridge2-dummy",
38 srcs: ["DummyNativeBridge2.cpp"],
39 defaults: ["libnativebridge-dummy-defaults"],
40}
41
42cc_library_shared {
43 name: "libnativebridge3-dummy",
44 srcs: ["DummyNativeBridge3.cpp"],
45 defaults: ["libnativebridge-dummy-defaults"],
46}
Dan Willemsen3e963f92018-10-31 10:32:32 -070047
48// Build the unit tests.
Jiyong Park00f2ebe2019-01-29 00:08:55 +090049cc_defaults {
50 name: "libnativebridge-tests-defaults",
Dan Willemsen3e963f92018-10-31 10:32:32 -070051 test_per_src: true,
52
53 cflags: [
54 "-Wall",
55 "-Werror",
56 ],
57
58 srcs: [
59 "CodeCacheCreate_test.cpp",
60 "CodeCacheExists_test.cpp",
61 "CodeCacheStatFail_test.cpp",
62 "CompleteFlow_test.cpp",
63 "InvalidCharsNativeBridge_test.cpp",
64 "NativeBridge2Signal_test.cpp",
65 "NativeBridgeVersion_test.cpp",
66 "NeedsNativeBridge_test.cpp",
67 "PreInitializeNativeBridge_test.cpp",
68 "PreInitializeNativeBridgeFail1_test.cpp",
69 "PreInitializeNativeBridgeFail2_test.cpp",
70 "ReSetupNativeBridge_test.cpp",
71 "UnavailableNativeBridge_test.cpp",
72 "ValidNameNativeBridge_test.cpp",
73 "NativeBridge3UnloadLibrary_test.cpp",
74 "NativeBridge3GetError_test.cpp",
75 "NativeBridge3IsPathSupported_test.cpp",
76 "NativeBridge3InitAnonymousNamespace_test.cpp",
77 "NativeBridge3CreateNamespace_test.cpp",
78 "NativeBridge3LoadLibraryExt_test.cpp",
79 ],
80
81 shared_libs: [
82 "liblog",
Dan Willemsen3e963f92018-10-31 10:32:32 -070083 "libnativebridge-dummy",
84 ],
85 header_libs: ["libbase_headers"],
86}
Nicolas Geoffrayd9b4d9b2019-01-10 16:27:54 +000087
Jiyong Park00f2ebe2019-01-29 00:08:55 +090088cc_test {
89 name: "libnativebridge-tests",
90 defaults: ["libnativebridge-tests-defaults"],
91 host_supported: true,
92 shared_libs: ["libnativebridge"],
93}
94
95cc_test {
96 name: "libnativebridge-lazy-tests",
97 defaults: ["libnativebridge-tests-defaults"],
98 shared_libs: ["libnativebridge_lazy"],
99}
100
Nicolas Geoffrayd9b4d9b2019-01-10 16:27:54 +0000101// Build the test for the C API.
Nicolas Geoffrayb6b910b2019-01-14 13:40:16 +0000102cc_test {
Nicolas Geoffrayd9b4d9b2019-01-10 16:27:54 +0000103 name: "libnativebridge-api-tests",
104 host_supported: true,
105 test_per_src: true,
106 srcs: [
107 "NativeBridgeApi.c",
108 ],
Jiyong Park00f2ebe2019-01-29 00:08:55 +0900109 header_libs: ["libnativebridge-headers"],
Nicolas Geoffrayd9b4d9b2019-01-10 16:27:54 +0000110}