Dan Willemsen | 3e963f9 | 2018-10-31 10:32:32 -0700 | [diff] [blame] | 1 | // |
| 2 | // Copyright (C) 2013-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 | // ----------------------------------------------------------------------------- |
| 18 | // Benchmarks. |
| 19 | // ----------------------------------------------------------------------------- |
| 20 | |
| 21 | // Build benchmarks for the device. Run with: |
| 22 | // adb shell liblog-benchmarks |
| 23 | cc_benchmark { |
| 24 | name: "liblog-benchmarks", |
| 25 | cflags: [ |
| 26 | "-Wall", |
| 27 | "-Wextra", |
| 28 | "-Werror", |
| 29 | "-fno-builtin", |
| 30 | ], |
| 31 | shared_libs: [ |
Dan Willemsen | 3e963f9 | 2018-10-31 10:32:32 -0700 | [diff] [blame] | 32 | "libm", |
| 33 | "libbase", |
Tom Cherry | 05de1ba | 2019-02-12 11:26:23 -0800 | [diff] [blame] | 34 | "libcutils", |
Dan Willemsen | 3e963f9 | 2018-10-31 10:32:32 -0700 | [diff] [blame] | 35 | ], |
Tom Cherry | bbf2a0d | 2019-01-15 13:12:44 -0800 | [diff] [blame] | 36 | static_libs: ["liblog"], |
Dan Willemsen | 3e963f9 | 2018-10-31 10:32:32 -0700 | [diff] [blame] | 37 | srcs: ["liblog_benchmark.cpp"], |
| 38 | } |
| 39 | |
| 40 | // ----------------------------------------------------------------------------- |
| 41 | // Unit tests. |
| 42 | // ----------------------------------------------------------------------------- |
| 43 | |
| 44 | cc_defaults { |
| 45 | name: "liblog-tests-defaults", |
| 46 | |
| 47 | cflags: [ |
| 48 | "-fstack-protector-all", |
| 49 | "-g", |
| 50 | "-Wall", |
| 51 | "-Wextra", |
| 52 | "-Werror", |
| 53 | "-fno-builtin", |
| 54 | ], |
| 55 | srcs: [ |
| 56 | "libc_test.cpp", |
Tom Cherry | 69ee5dd | 2020-01-22 07:48:42 -0800 | [diff] [blame^] | 57 | "liblog_default_tag.cpp", |
Tom Cherry | 349b0c4 | 2020-01-08 14:47:42 -0800 | [diff] [blame] | 58 | "liblog_global_state.cpp", |
Tom Cherry | 2238ce2 | 2019-09-30 13:51:09 -0700 | [diff] [blame] | 59 | "liblog_test.cpp", |
Dan Willemsen | 3e963f9 | 2018-10-31 10:32:32 -0700 | [diff] [blame] | 60 | "log_id_test.cpp", |
| 61 | "log_radio_test.cpp", |
| 62 | "log_read_test.cpp", |
| 63 | "log_system_test.cpp", |
| 64 | "log_time_test.cpp", |
| 65 | "log_wrap_test.cpp", |
Tom Cherry | 9158984 | 2019-04-25 13:10:30 -0700 | [diff] [blame] | 66 | "logprint_test.cpp", |
Tom Cherry | 2a6811b | 2019-12-11 12:56:01 -0800 | [diff] [blame] | 67 | "rwlock_test.cpp", |
Dan Willemsen | 3e963f9 | 2018-10-31 10:32:32 -0700 | [diff] [blame] | 68 | ], |
| 69 | shared_libs: [ |
Dan Willemsen | 3e963f9 | 2018-10-31 10:32:32 -0700 | [diff] [blame] | 70 | "libcutils", |
| 71 | "libbase", |
| 72 | ], |
Tom Cherry | bbf2a0d | 2019-01-15 13:12:44 -0800 | [diff] [blame] | 73 | static_libs: ["liblog"], |
Tom Cherry | 7e99b22 | 2019-10-04 13:05:50 -0700 | [diff] [blame] | 74 | isolated: true, |
Dan Willemsen | 3e963f9 | 2018-10-31 10:32:32 -0700 | [diff] [blame] | 75 | } |
| 76 | |
| 77 | // Build tests for the device (with .so). Run with: |
| 78 | // adb shell /data/nativetest/liblog-unit-tests/liblog-unit-tests |
| 79 | cc_test { |
| 80 | name: "liblog-unit-tests", |
| 81 | defaults: ["liblog-tests-defaults"], |
| 82 | } |
| 83 | |
| 84 | cc_test { |
| 85 | name: "CtsLiblogTestCases", |
| 86 | defaults: ["liblog-tests-defaults"], |
| 87 | multilib: { |
| 88 | lib32: { |
| 89 | suffix: "32", |
| 90 | }, |
| 91 | lib64: { |
| 92 | suffix: "64", |
| 93 | }, |
| 94 | }, |
| 95 | |
| 96 | cflags: ["-DNO_PSTORE"], |
| 97 | test_suites: [ |
| 98 | "cts", |
| 99 | "vts", |
| 100 | ], |
| 101 | } |
Tom Cherry | d953ba3 | 2019-12-10 14:45:02 -0800 | [diff] [blame] | 102 | |
| 103 | cc_test_host { |
| 104 | name: "liblog-host-test", |
| 105 | static_libs: ["liblog"], |
| 106 | shared_libs: ["libbase"], |
| 107 | srcs: ["liblog_host_test.cpp"], |
| 108 | isolated: true, |
| 109 | } |