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