blob: 62f5acb4eaaac9bf09654fe505ca1d9bf6148f32 [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",
Elliott Hugheseb0ef142019-02-06 14:28:32 -080025 "FileMap_test.cpp",
Dan Willemsen2e1591b2016-07-12 17:20:18 -070026 "LruCache_test.cpp",
Siarhei Vishniakou4e5b6912017-07-12 13:36:51 -070027 "Mutex_test.cpp",
Colin Crossa0931eb2017-02-23 16:04:45 -080028 "Singleton_test.cpp",
Dan Willemsen2e1591b2016-07-12 17:20:18 -070029 "String8_test.cpp",
30 "StrongPointer_test.cpp",
Dan Willemsen2e1591b2016-07-12 17:20:18 -070031 "Unicode_test.cpp",
32 "Vector_test.cpp",
33 ],
34
Colin Cross155c9832017-02-23 17:49:23 -080035 target: {
36 android: {
37 srcs: [
Colin Cross155c9832017-02-23 17:49:23 -080038 "SystemClock_test.cpp",
39 ],
40 shared_libs: [
41 "libz",
42 "liblog",
43 "libcutils",
44 "libutils",
Colin Crossa0931eb2017-02-23 16:04:45 -080045 "libbase",
Colin Cross155c9832017-02-23 17:49:23 -080046 ],
47 },
Dan Willemsenbdddcab2017-10-03 14:17:31 -070048 linux: {
Colin Cross155c9832017-02-23 17:49:23 -080049 srcs: [
50 "Looper_test.cpp",
51 "RefBase_test.cpp",
52 ],
53 },
54 host: {
55 static_libs: [
56 "libutils",
57 "liblog",
Colin Crossa0931eb2017-02-23 16:04:45 -080058 "libbase",
Colin Cross155c9832017-02-23 17:49:23 -080059 ],
60 },
61 },
Dan Willemsen2e1591b2016-07-12 17:20:18 -070062
Colin Crossa0931eb2017-02-23 16:04:45 -080063 required: [
64 "libutils_tests_singleton1",
65 "libutils_tests_singleton2",
66 ],
67
Colin Cross155c9832017-02-23 17:49:23 -080068 cflags: [
69 "-Wall",
70 "-Wextra",
71 "-Werror",
Siarhei Vishniakou4e5b6912017-07-12 13:36:51 -070072 "-Wthread-safety",
Dan Willemsen2e1591b2016-07-12 17:20:18 -070073 ],
74}
Colin Crossa0931eb2017-02-23 16:04:45 -080075
76cc_test_library {
77 name: "libutils_tests_singleton1",
78 host_supported: true,
79 relative_install_path: "libutils_tests",
80 srcs: ["Singleton_test1.cpp"],
Elliott Hughesdc699a22018-02-16 17:58:14 -080081 cflags: [
82 "-Wall",
83 "-Werror",
84 ],
Colin Crossa0931eb2017-02-23 16:04:45 -080085}
86
87cc_test_library {
88 name: "libutils_tests_singleton2",
89 host_supported: true,
90 relative_install_path: "libutils_tests",
91 srcs: ["Singleton_test2.cpp"],
Elliott Hughesdc699a22018-02-16 17:58:14 -080092 cflags: [
93 "-Wall",
94 "-Werror",
95 ],
Colin Crossa0931eb2017-02-23 16:04:45 -080096 shared_libs: ["libutils_tests_singleton1"],
97}