blob: 7b62c2436ffa4df2987547b39d378cc4e112f603 [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: [
Colin Cross155c9832017-02-23 17:49:23 -080036 "Looper_test.cpp",
37 "RefBase_test.cpp",
38 "SystemClock_test.cpp",
39 ],
40 shared_libs: [
41 "libz",
42 "liblog",
43 "libcutils",
44 "libutils",
Colin Crossa0931eb2017-02-23 16:04:45 -080045 "libbase",
46 "libdl",
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 ],
Colin Crossa0931eb2017-02-23 16:04:45 -080061 host_ldlibs: ["-ldl"],
Colin Cross155c9832017-02-23 17:49:23 -080062 },
63 },
Dan Willemsen2e1591b2016-07-12 17:20:18 -070064
Colin Crossa0931eb2017-02-23 16:04:45 -080065 required: [
66 "libutils_tests_singleton1",
67 "libutils_tests_singleton2",
68 ],
69
Colin Cross155c9832017-02-23 17:49:23 -080070 cflags: [
71 "-Wall",
72 "-Wextra",
73 "-Werror",
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}