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_applicable_licenses: ["Android-Apache-2.0"],
17}
18
19cc_library_static {
20    name: "libgtest_isolated",
21    host_supported: true,
22    cflags: ["-Wall", "-Werror"],
23    export_include_dirs: ["include"],
24
25    srcs: [
26        "Color.cpp",
27        "Isolate.cpp",
28        "IsolateMain.cpp",
29        "NanoTime.cpp",
30        "Options.cpp",
31        "Test.cpp",
32    ],
33
34    whole_static_libs: [
35        "libgtest",
36    ],
37
38    // Add liblog as a shared library so that gtests can override liblog
39    // functions without getting duplicate symbols.
40    shared_libs: [
41        "liblog",
42    ],
43}
44
45cc_library_static {
46    name: "libgtest_isolated_main",
47    host_supported: true,
48    cflags: ["-Wall", "-Werror"],
49    srcs: [
50        "Main.cpp",
51    ],
52
53    whole_static_libs: [
54        "libgtest_isolated",
55    ],
56
57    // Add liblog as a shared library so that gtests can override liblog
58    // functions without getting duplicate symbols.
59    shared_libs: [
60        "liblog",
61    ],
62}
63
64cc_test {
65    name: "gtest_isolated_tests",
66    host_supported: true,
67    srcs: [
68        "tests/OptionsTest.cpp",
69        "tests/SystemTests.cpp",
70    ],
71    cflags: ["-Wall", "-Werror"],
72
73    shared_libs: [
74        "libbase",
75        "liblog",
76    ],
77    static_libs: [
78        "libgmock",
79    ],
80    whole_static_libs: ["libgtest_isolated_main"],
81
82    test_suites: ["device-tests"],
83}
84