blob: a3e7ffe73f6d3bdadc5ef7e7b82038691a1c19a1 [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 "SystemClock_test.cpp",
38 ],
39 shared_libs: [
40 "libz",
41 "liblog",
42 "libcutils",
43 "libutils",
Colin Crossa0931eb2017-02-23 16:04:45 -080044 "libbase",
Colin Cross155c9832017-02-23 17:49:23 -080045 ],
46 },
Dan Willemsenbdddcab2017-10-03 14:17:31 -070047 linux: {
Colin Cross155c9832017-02-23 17:49:23 -080048 srcs: [
49 "Looper_test.cpp",
50 "RefBase_test.cpp",
51 ],
52 },
53 host: {
54 static_libs: [
55 "libutils",
56 "liblog",
Colin Crossa0931eb2017-02-23 16:04:45 -080057 "libbase",
Colin Cross155c9832017-02-23 17:49:23 -080058 ],
59 },
60 },
Dan Willemsen2e1591b2016-07-12 17:20:18 -070061
Colin Crossa0931eb2017-02-23 16:04:45 -080062 required: [
63 "libutils_tests_singleton1",
64 "libutils_tests_singleton2",
65 ],
66
Colin Cross155c9832017-02-23 17:49:23 -080067 cflags: [
68 "-Wall",
69 "-Wextra",
70 "-Werror",
Siarhei Vishniakou4e5b6912017-07-12 13:36:51 -070071 "-Wthread-safety",
Dan Willemsen2e1591b2016-07-12 17:20:18 -070072 ],
73}
Colin Crossa0931eb2017-02-23 16:04:45 -080074
75cc_test_library {
76 name: "libutils_tests_singleton1",
77 host_supported: true,
78 relative_install_path: "libutils_tests",
79 srcs: ["Singleton_test1.cpp"],
Chih-Hung Hsieh122352d2017-10-02 15:20:07 -070080 cflags: ["-Wall", "-Werror"],
Colin Crossa0931eb2017-02-23 16:04:45 -080081}
82
83cc_test_library {
84 name: "libutils_tests_singleton2",
85 host_supported: true,
86 relative_install_path: "libutils_tests",
87 srcs: ["Singleton_test2.cpp"],
Chih-Hung Hsieh122352d2017-10-02 15:20:07 -070088 cflags: ["-Wall", "-Werror"],
Colin Crossa0931eb2017-02-23 16:04:45 -080089 shared_libs: ["libutils_tests_singleton1"],
90}