blob: 3fadef44dbe52f85ebddb21a245e6b12950cfecc [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: [
Colin Cross155c9832017-02-23 17:49:23 -080037 "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",
Colin Cross155c9832017-02-23 17:49:23 -080047 ],
48 },
49 linux: {
50 srcs: [
51 "Looper_test.cpp",
52 "RefBase_test.cpp",
53 ],
54 },
55 host: {
56 static_libs: [
57 "libutils",
58 "liblog",
Colin Crossa0931eb2017-02-23 16:04:45 -080059 "libbase",
Colin Cross155c9832017-02-23 17:49:23 -080060 ],
61 },
62 },
Dan Willemsen2e1591b2016-07-12 17:20:18 -070063
Colin Crossa0931eb2017-02-23 16:04:45 -080064 required: [
65 "libutils_tests_singleton1",
66 "libutils_tests_singleton2",
67 ],
68
Colin Cross155c9832017-02-23 17:49:23 -080069 cflags: [
70 "-Wall",
71 "-Wextra",
72 "-Werror",
Siarhei Vishniakou4e5b6912017-07-12 13:36:51 -070073 "-Wthread-safety",
Dan Willemsen2e1591b2016-07-12 17:20:18 -070074 ],
75}
Colin Crossa0931eb2017-02-23 16:04:45 -080076
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}