blob: 7cae13351574ee9753f676273aff29c81f40dee7 [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",
Siarhei Vishniakou4e5b6912017-07-12 13:36:51 -070026 "Mutex_test.cpp",
Colin Crossa0931eb2017-02-23 16:04:45 -080027 "Singleton_test.cpp",
Dan Willemsen2e1591b2016-07-12 17:20:18 -070028 "String8_test.cpp",
29 "StrongPointer_test.cpp",
Dan Willemsen2e1591b2016-07-12 17:20:18 -070030 "Unicode_test.cpp",
31 "Vector_test.cpp",
32 ],
33
Colin Cross155c9832017-02-23 17:49:23 -080034 target: {
35 android: {
36 srcs: [
37 "BlobCache_test.cpp",
38 "Looper_test.cpp",
39 "RefBase_test.cpp",
40 "SystemClock_test.cpp",
41 ],
42 shared_libs: [
43 "libz",
44 "liblog",
45 "libcutils",
46 "libutils",
Colin Crossa0931eb2017-02-23 16:04:45 -080047 "libbase",
48 "libdl",
Colin Cross155c9832017-02-23 17:49:23 -080049 ],
50 },
51 linux: {
52 srcs: [
53 "Looper_test.cpp",
54 "RefBase_test.cpp",
55 ],
56 },
57 host: {
58 static_libs: [
59 "libutils",
60 "liblog",
Colin Crossa0931eb2017-02-23 16:04:45 -080061 "libbase",
Colin Cross155c9832017-02-23 17:49:23 -080062 ],
Colin Crossa0931eb2017-02-23 16:04:45 -080063 host_ldlibs: ["-ldl"],
Colin Cross155c9832017-02-23 17:49:23 -080064 },
65 },
Dan Willemsen2e1591b2016-07-12 17:20:18 -070066
Colin Crossa0931eb2017-02-23 16:04:45 -080067 required: [
68 "libutils_tests_singleton1",
69 "libutils_tests_singleton2",
70 ],
71
Colin Cross155c9832017-02-23 17:49:23 -080072 cflags: [
73 "-Wall",
74 "-Wextra",
75 "-Werror",
Siarhei Vishniakou4e5b6912017-07-12 13:36:51 -070076 "-Wthread-safety",
Dan Willemsen2e1591b2016-07-12 17:20:18 -070077 ],
78}
Colin Crossa0931eb2017-02-23 16:04:45 -080079
80cc_test_library {
81 name: "libutils_tests_singleton1",
82 host_supported: true,
83 relative_install_path: "libutils_tests",
84 srcs: ["Singleton_test1.cpp"],
85}
86
87cc_test_library {
88 name: "libutils_tests_singleton2",
89 host_supported: true,
90 relative_install_path: "libutils_tests",
91 srcs: ["Singleton_test2.cpp"],
92 shared_libs: ["libutils_tests_singleton1"],
93}