• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
17package {
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
26cc_defaults {
27    name: "libnativebridge-test-case-defaults",
28    defaults: [
29        "art_defaults",
30        "art_test_defaults",
31    ],
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    },
44    header_libs: [
45        "jni_headers",
46        "libnativebridge-headers",
47    ],
48    cppflags: ["-fvisibility=protected"],
49}
50
51cc_test_library {
52    name: "libnativebridge-test-case",
53    srcs: ["NativeBridgeTestCase.cpp"],
54    defaults: ["libnativebridge-test-case-defaults"],
55}
56
57cc_test_library {
58    name: "libnativebridge2-test-case",
59    srcs: ["NativeBridgeTestCase2.cpp"],
60    defaults: ["libnativebridge-test-case-defaults"],
61}
62
63cc_test_library {
64    name: "libnativebridge3-test-case",
65    srcs: ["NativeBridgeTestCase3.cpp"],
66    defaults: ["libnativebridge-test-case-defaults"],
67}
68
69cc_test_library {
70    name: "libnativebridge6-test-case",
71    srcs: ["NativeBridgeTestCase6.cpp"],
72    defaults: ["libnativebridge-test-case-defaults"],
73    shared_libs: [
74        "libnativebridge6prezygotefork",
75    ],
76}
77
78// A helper library to produce test-case side effect of PreZygoteForkNativeBridge.
79cc_test_library {
80    name: "libnativebridge6prezygotefork",
81    srcs: ["NativeBridge6PreZygoteFork_lib.cpp"],
82    defaults: ["libnativebridge-test-case-defaults"],
83}
84
85cc_defaults {
86    name: "libnativebridge-tests-defaults",
87    defaults: [
88        "art_defaults",
89        "art_test_defaults",
90    ],
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    },
103}
104
105cc_test {
106    name: "libnativebridge-tests",
107    defaults: ["libnativebridge-tests-defaults"],
108
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
113    srcs: [
114        "NativeBridgeApi.c",
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",
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",
134        "NativeBridge6PreZygoteFork_test.cpp",
135    ],
136
137    shared_libs: [
138        "liblog",
139        "libnativebridge",
140        "libnativebridge-test-case",
141        "libnativebridge2-test-case",
142        "libnativebridge3-test-case",
143        "libnativebridge6-test-case",
144        "libnativebridge6prezygotefork",
145    ],
146    header_libs: ["libbase_headers"],
147}
148
149cc_test {
150    name: "libnativebridge-lazy-tests",
151    defaults: ["libnativebridge-tests-defaults"],
152    host_supported: false,
153    test_suites: ["device-tests"],
154    static_libs: [
155        "libbase",
156        "libnativebridge_lazy",
157    ],
158    srcs: ["libnativebridge_lazy_test.cpp"],
159}
160