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 23package { 24 // A large-scale-change added 'default_applicable_licenses' to import 25 // the below license kinds from "system_logging_liblog_license": 26 // SPDX-license-identifier-Apache-2.0 27 default_applicable_licenses: ["system_logging_liblog_license"], 28 default_team: "trendy_team_native_tools_libraries", 29} 30 31cc_benchmark { 32 name: "liblog-benchmarks", 33 cflags: [ 34 "-Wall", 35 "-Wextra", 36 "-Werror", 37 "-Wno-unused-result", 38 "-fno-builtin", 39 ], 40 shared_libs: [ 41 "libbase", 42 "libcutils", 43 ], 44 static_libs: ["liblog"], 45 srcs: ["liblog_benchmark.cpp"], 46 host_supported: true, 47} 48 49// ----------------------------------------------------------------------------- 50// Fuzzers. 51// ----------------------------------------------------------------------------- 52 53cc_fuzz { 54 name: "liblog_convertPrintable_fuzzer", 55 srcs: [ 56 "liblog_convertPrintable_fuzzer.cpp", 57 ], 58 static_libs: ["liblog"], 59 host_supported: true, 60} 61 62// ----------------------------------------------------------------------------- 63// Unit tests. 64// ----------------------------------------------------------------------------- 65 66cc_defaults { 67 name: "liblog-tests-defaults", 68 69 cflags: [ 70 "-fstack-protector-all", 71 "-g", 72 "-Wall", 73 "-Wextra", 74 "-Werror", 75 "-fno-builtin", 76 ], 77 srcs: [ 78 "libc_test.cpp", 79 "liblog_default_tag.cpp", 80 "liblog_global_state.cpp", 81 "liblog_test.cpp", 82 "log_id_test.cpp", 83 "log_radio_test.cpp", 84 "log_read_test.cpp", 85 "log_system_test.cpp", 86 "log_time_test.cpp", 87 "log_wrap_test.cpp", 88 "logd_writer_test.cpp", 89 "logprint_test.cpp", 90 ], 91 shared_libs: [ 92 "libcutils", 93 "libbase", 94 ], 95 static_libs: ["liblog"], 96 isolated: true, 97 require_root: true, 98} 99 100// Build tests for the device (with .so). Run with: 101// adb shell /data/nativetest/liblog-unit-tests/liblog-unit-tests 102cc_test { 103 name: "liblog-unit-tests", 104 defaults: ["liblog-tests-defaults"], 105} 106 107cc_test { 108 name: "CtsLiblogTestCases", 109 defaults: ["liblog-tests-defaults"], 110 multilib: { 111 lib32: { 112 suffix: "32", 113 }, 114 lib64: { 115 suffix: "64", 116 }, 117 }, 118 119 cflags: ["-DNO_PSTORE"], 120 test_suites: [ 121 "cts", 122 "device-tests", 123 ], 124 test_config: "device_test_config.xml", 125 data: [ 126 "liblog_device_preparer.sh", 127 ], 128} 129 130sh_test { 131 name: "liblog_device_preparer.sh", 132 src: "liblog_device_preparer.sh", 133 test_suites: [ 134 "cts", 135 "general-tests", 136 ], 137} 138 139cc_test_host { 140 name: "liblog-host-test", 141 static_libs: ["liblog"], 142 shared_libs: ["libbase"], 143 srcs: [ 144 "liblog_host_test.cpp", 145 "liblog_default_tag.cpp", 146 "liblog_global_state.cpp", 147 "logprint_test.cpp", 148 ], 149 isolated: true, 150} 151