1// Copyright (C) 2018 The Android Open Source Project
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//      http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15package {
16    default_team: "trendy_team_native_tools_libraries",
17    default_applicable_licenses: ["Android-Apache-2.0"],
18}
19
20cc_defaults {
21    name: "libgtest_isolated_defaults",
22    vendor_available: true,
23    product_available: true,
24    native_bridge_supported: true,
25}
26
27cc_library_static {
28    name: "libgtest_isolated",
29    defaults: ["libgtest_isolated_defaults"],
30    host_supported: true,
31    cflags: [
32        "-Wall",
33        "-Werror",
34        "-Wextra",
35        "-Wconversion",
36    ],
37    export_include_dirs: ["include"],
38
39    srcs: [
40        "Color.cpp",
41        "Isolate.cpp",
42        "IsolateMain.cpp",
43        "NanoTime.cpp",
44        "Options.cpp",
45        "Test.cpp",
46    ],
47
48    whole_static_libs: [
49        "libgtest",
50    ],
51
52    // Add liblog as a shared library so that gtests can override liblog
53    // functions without getting duplicate symbols.
54    shared_libs: [
55        "liblog",
56    ],
57}
58
59cc_library_static {
60    name: "libgtest_isolated_main",
61    defaults: ["libgtest_isolated_defaults"],
62    host_supported: true,
63    cflags: [
64        "-Wall",
65        "-Werror",
66        "-Wextra",
67    ],
68    srcs: [
69        "Main.cpp",
70    ],
71
72    whole_static_libs: [
73        "libgtest_isolated",
74    ],
75
76    // Add liblog as a shared library so that gtests can override liblog
77    // functions without getting duplicate symbols.
78    shared_libs: [
79        "liblog",
80    ],
81}
82
83cc_test {
84    name: "gtest_isolated_tests",
85    defaults: ["libgtest_isolated_defaults"],
86    host_supported: true,
87    tidy_timeout_srcs: [
88        "tests/OptionsTest.cpp",
89        "tests/SystemTests.cpp",
90    ],
91    srcs: [
92        "tests/OptionsTest.cpp",
93        "tests/SystemTests.cpp",
94    ],
95    cflags: [
96        "-Wall",
97        "-Werror",
98        "-Wextra",
99    ],
100
101    shared_libs: [
102        "libbase",
103        "liblog",
104    ],
105    static_libs: [
106        "libgmock",
107    ],
108    whole_static_libs: ["libgtest_isolated_main"],
109
110    test_suites: ["device-tests"],
111}
112