blob: ea606a1947ba07dc19aa1b5d9a6829f3e56d96c9 [file] [log] [blame]
Dan Willemsen2e1591b2016-07-12 17:20:18 -07001//
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",
Colin Cross155c9832017-02-23 17:49:23 -080021 host_supported: true,
Dan Willemsen2e1591b2016-07-12 17:20:18 -070022
23 srcs: [
Dan Willemsen2e1591b2016-07-12 17:20:18 -070024 "BitSet_test.cpp",
Dan Willemsen2e1591b2016-07-12 17:20:18 -070025 "LruCache_test.cpp",
Colin Crossa0931eb2017-02-23 16:04:45 -080026 "Singleton_test.cpp",
Dan Willemsen2e1591b2016-07-12 17:20:18 -070027 "String8_test.cpp",
28 "StrongPointer_test.cpp",
Dan Willemsen2e1591b2016-07-12 17:20:18 -070029 "Unicode_test.cpp",
30 "Vector_test.cpp",
31 ],
32
Colin Cross155c9832017-02-23 17:49:23 -080033 target: {
34 android: {
35 srcs: [
36 "BlobCache_test.cpp",
37 "Looper_test.cpp",
38 "RefBase_test.cpp",
39 "SystemClock_test.cpp",
40 ],
41 shared_libs: [
42 "libz",
43 "liblog",
44 "libcutils",
45 "libutils",
Colin Crossa0931eb2017-02-23 16:04:45 -080046 "libbase",
47 "libdl",
Colin Cross155c9832017-02-23 17:49:23 -080048 ],
49 },
50 linux: {
51 srcs: [
52 "Looper_test.cpp",
53 "RefBase_test.cpp",
54 ],
55 },
56 host: {
57 static_libs: [
58 "libutils",
59 "liblog",
Colin Crossa0931eb2017-02-23 16:04:45 -080060 "libbase",
Colin Cross155c9832017-02-23 17:49:23 -080061 ],
Colin Crossa0931eb2017-02-23 16:04:45 -080062 host_ldlibs: ["-ldl"],
Colin Cross155c9832017-02-23 17:49:23 -080063 },
64 },
Dan Willemsen2e1591b2016-07-12 17:20:18 -070065
Colin Crossa0931eb2017-02-23 16:04:45 -080066 required: [
67 "libutils_tests_singleton1",
68 "libutils_tests_singleton2",
69 ],
70
Colin Cross155c9832017-02-23 17:49:23 -080071 cflags: [
72 "-Wall",
73 "-Wextra",
74 "-Werror",
Dan Willemsen2e1591b2016-07-12 17:20:18 -070075 ],
76}
Colin Crossa0931eb2017-02-23 16:04:45 -080077
78cc_test_library {
79 name: "libutils_tests_singleton1",
80 host_supported: true,
81 relative_install_path: "libutils_tests",
82 srcs: ["Singleton_test1.cpp"],
83}
84
85cc_test_library {
86 name: "libutils_tests_singleton2",
87 host_supported: true,
88 relative_install_path: "libutils_tests",
89 srcs: ["Singleton_test2.cpp"],
90 shared_libs: ["libutils_tests_singleton1"],
91}