• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1//
2// Copyright (C) 2014 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
17// Build the unit tests.
18
19cc_test {
20    name: "libutils_tests",
21    host_supported: true,
22
23    srcs: [
24        "BitSet_test.cpp",
25        "LruCache_test.cpp",
26        "Singleton_test.cpp",
27        "String8_test.cpp",
28        "StrongPointer_test.cpp",
29        "Unicode_test.cpp",
30        "Vector_test.cpp",
31    ],
32
33    target: {
34        android: {
35            srcs: [
36                "Looper_test.cpp",
37                "RefBase_test.cpp",
38                "SystemClock_test.cpp",
39            ],
40            shared_libs: [
41                "libz",
42                "liblog",
43                "libcutils",
44                "libutils",
45                "libbase",
46                "libdl",
47            ],
48        },
49        linux: {
50            srcs: [
51                "Looper_test.cpp",
52                "RefBase_test.cpp",
53            ],
54        },
55        host: {
56            static_libs: [
57                "libutils",
58                "liblog",
59                "libbase",
60            ],
61            host_ldlibs: ["-ldl"],
62        },
63    },
64
65    required: [
66        "libutils_tests_singleton1",
67        "libutils_tests_singleton2",
68    ],
69
70    cflags: [
71        "-Wall",
72        "-Wextra",
73        "-Werror",
74    ],
75}
76
77cc_test_library {
78    name: "libutils_tests_singleton1",
79    host_supported: true,
80    relative_install_path: "libutils_tests",
81    srcs: ["Singleton_test1.cpp"],
82}
83
84cc_test_library {
85    name: "libutils_tests_singleton2",
86    host_supported: true,
87    relative_install_path: "libutils_tests",
88    srcs: ["Singleton_test2.cpp"],
89    shared_libs: ["libutils_tests_singleton1"],
90}
91