Dan Willemsen | 2e1591b | 2016-07-12 17:20:18 -0700 | [diff] [blame] | 1 | // |
| 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 | |
| 19 | cc_test { |
| 20 | name: "libutils_tests", |
Colin Cross | 155c983 | 2017-02-23 17:49:23 -0800 | [diff] [blame] | 21 | host_supported: true, |
Dan Willemsen | 2e1591b | 2016-07-12 17:20:18 -0700 | [diff] [blame] | 22 | |
| 23 | srcs: [ |
Dan Willemsen | 2e1591b | 2016-07-12 17:20:18 -0700 | [diff] [blame] | 24 | "BitSet_test.cpp", |
Elliott Hughes | eb0ef14 | 2019-02-06 14:28:32 -0800 | [diff] [blame] | 25 | "FileMap_test.cpp", |
Dan Willemsen | 2e1591b | 2016-07-12 17:20:18 -0700 | [diff] [blame] | 26 | "LruCache_test.cpp", |
Siarhei Vishniakou | 4e5b691 | 2017-07-12 13:36:51 -0700 | [diff] [blame] | 27 | "Mutex_test.cpp", |
Colin Cross | a0931eb | 2017-02-23 16:04:45 -0800 | [diff] [blame] | 28 | "Singleton_test.cpp", |
Dan Willemsen | 2e1591b | 2016-07-12 17:20:18 -0700 | [diff] [blame] | 29 | "String8_test.cpp", |
| 30 | "StrongPointer_test.cpp", |
Dan Willemsen | 2e1591b | 2016-07-12 17:20:18 -0700 | [diff] [blame] | 31 | "Unicode_test.cpp", |
| 32 | "Vector_test.cpp", |
| 33 | ], |
| 34 | |
Colin Cross | 155c983 | 2017-02-23 17:49:23 -0800 | [diff] [blame] | 35 | target: { |
| 36 | android: { |
| 37 | srcs: [ |
Colin Cross | 155c983 | 2017-02-23 17:49:23 -0800 | [diff] [blame] | 38 | "SystemClock_test.cpp", |
| 39 | ], |
| 40 | shared_libs: [ |
| 41 | "libz", |
| 42 | "liblog", |
| 43 | "libcutils", |
| 44 | "libutils", |
Colin Cross | a0931eb | 2017-02-23 16:04:45 -0800 | [diff] [blame] | 45 | "libbase", |
Colin Cross | 155c983 | 2017-02-23 17:49:23 -0800 | [diff] [blame] | 46 | ], |
| 47 | }, |
Dan Willemsen | bdddcab | 2017-10-03 14:17:31 -0700 | [diff] [blame] | 48 | linux: { |
Colin Cross | 155c983 | 2017-02-23 17:49:23 -0800 | [diff] [blame] | 49 | srcs: [ |
| 50 | "Looper_test.cpp", |
| 51 | "RefBase_test.cpp", |
| 52 | ], |
| 53 | }, |
| 54 | host: { |
| 55 | static_libs: [ |
| 56 | "libutils", |
| 57 | "liblog", |
Colin Cross | a0931eb | 2017-02-23 16:04:45 -0800 | [diff] [blame] | 58 | "libbase", |
Colin Cross | 155c983 | 2017-02-23 17:49:23 -0800 | [diff] [blame] | 59 | ], |
| 60 | }, |
| 61 | }, |
Dan Willemsen | 2e1591b | 2016-07-12 17:20:18 -0700 | [diff] [blame] | 62 | |
Colin Cross | a0931eb | 2017-02-23 16:04:45 -0800 | [diff] [blame] | 63 | required: [ |
| 64 | "libutils_tests_singleton1", |
| 65 | "libutils_tests_singleton2", |
| 66 | ], |
| 67 | |
Colin Cross | 155c983 | 2017-02-23 17:49:23 -0800 | [diff] [blame] | 68 | cflags: [ |
| 69 | "-Wall", |
| 70 | "-Wextra", |
| 71 | "-Werror", |
Siarhei Vishniakou | 4e5b691 | 2017-07-12 13:36:51 -0700 | [diff] [blame] | 72 | "-Wthread-safety", |
Dan Willemsen | 2e1591b | 2016-07-12 17:20:18 -0700 | [diff] [blame] | 73 | ], |
| 74 | } |
Colin Cross | a0931eb | 2017-02-23 16:04:45 -0800 | [diff] [blame] | 75 | |
| 76 | cc_test_library { |
| 77 | name: "libutils_tests_singleton1", |
| 78 | host_supported: true, |
| 79 | relative_install_path: "libutils_tests", |
| 80 | srcs: ["Singleton_test1.cpp"], |
Elliott Hughes | dc699a2 | 2018-02-16 17:58:14 -0800 | [diff] [blame] | 81 | cflags: [ |
| 82 | "-Wall", |
| 83 | "-Werror", |
| 84 | ], |
Colin Cross | a0931eb | 2017-02-23 16:04:45 -0800 | [diff] [blame] | 85 | } |
| 86 | |
| 87 | cc_test_library { |
| 88 | name: "libutils_tests_singleton2", |
| 89 | host_supported: true, |
| 90 | relative_install_path: "libutils_tests", |
| 91 | srcs: ["Singleton_test2.cpp"], |
Elliott Hughes | dc699a2 | 2018-02-16 17:58:14 -0800 | [diff] [blame] | 92 | cflags: [ |
| 93 | "-Wall", |
| 94 | "-Werror", |
| 95 | ], |
Colin Cross | a0931eb | 2017-02-23 16:04:45 -0800 | [diff] [blame] | 96 | shared_libs: ["libutils_tests_singleton1"], |
| 97 | } |