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} 29 30cc_benchmark { 31 name: "liblog-benchmarks", 32 cflags: [ 33 "-Wall", 34 "-Wextra", 35 "-Werror", 36 "-fno-builtin", 37 ], 38 shared_libs: [ 39 "libm", 40 "libbase", 41 "libcutils", 42 ], 43 static_libs: ["liblog"], 44 srcs: ["liblog_benchmark.cpp"], 45} 46 47// ----------------------------------------------------------------------------- 48// Unit tests. 49// ----------------------------------------------------------------------------- 50 51cc_defaults { 52 name: "liblog-tests-defaults", 53 54 cflags: [ 55 "-fstack-protector-all", 56 "-g", 57 "-Wall", 58 "-Wextra", 59 "-Werror", 60 "-fno-builtin", 61 ], 62 srcs: [ 63 "libc_test.cpp", 64 "liblog_default_tag.cpp", 65 "liblog_global_state.cpp", 66 "liblog_test.cpp", 67 "log_id_test.cpp", 68 "log_radio_test.cpp", 69 "log_read_test.cpp", 70 "log_system_test.cpp", 71 "log_time_test.cpp", 72 "log_wrap_test.cpp", 73 "logd_writer_test.cpp", 74 "logprint_test.cpp", 75 ], 76 shared_libs: [ 77 "libcutils", 78 "libbase", 79 ], 80 static_libs: ["liblog"], 81 isolated: true, 82 require_root: true, 83} 84 85// Build tests for the device (with .so). Run with: 86// adb shell /data/nativetest/liblog-unit-tests/liblog-unit-tests 87cc_test { 88 name: "liblog-unit-tests", 89 defaults: ["liblog-tests-defaults"], 90} 91 92cc_test { 93 name: "CtsLiblogTestCases", 94 defaults: ["liblog-tests-defaults"], 95 multilib: { 96 lib32: { 97 suffix: "32", 98 }, 99 lib64: { 100 suffix: "64", 101 }, 102 }, 103 104 cflags: ["-DNO_PSTORE"], 105 test_suites: [ 106 "cts", 107 "device-tests", 108 ], 109 test_config: "device_test_config.xml", 110} 111 112cc_test_host { 113 name: "liblog-host-test", 114 static_libs: ["liblog"], 115 shared_libs: ["libbase"], 116 srcs: [ 117 "liblog_host_test.cpp", 118 "liblog_default_tag.cpp", 119 "liblog_global_state.cpp", 120 ], 121 isolated: true, 122} 123