blob: 171aafd3bce87414b86c07d0e04c7da55a5d832d [file] [log] [blame]
Dan Willemsen3e963f92018-10-31 10:32:32 -07001//
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
23cc_benchmark {
24 name: "liblog-benchmarks",
25 cflags: [
26 "-Wall",
27 "-Wextra",
28 "-Werror",
29 "-fno-builtin",
30 ],
31 shared_libs: [
Dan Willemsen3e963f92018-10-31 10:32:32 -070032 "libm",
33 "libbase",
Tom Cherry05de1ba2019-02-12 11:26:23 -080034 "libcutils",
Dan Willemsen3e963f92018-10-31 10:32:32 -070035 ],
Tom Cherrybbf2a0d2019-01-15 13:12:44 -080036 static_libs: ["liblog"],
Dan Willemsen3e963f92018-10-31 10:32:32 -070037 srcs: ["liblog_benchmark.cpp"],
38}
39
40// -----------------------------------------------------------------------------
41// Unit tests.
42// -----------------------------------------------------------------------------
43
44cc_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 Cherry69ee5dd2020-01-22 07:48:42 -080057 "liblog_default_tag.cpp",
Tom Cherry349b0c42020-01-08 14:47:42 -080058 "liblog_global_state.cpp",
Tom Cherry2238ce22019-09-30 13:51:09 -070059 "liblog_test.cpp",
Dan Willemsen3e963f92018-10-31 10:32:32 -070060 "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 Cherry7acfba22020-04-24 17:15:26 -070066 "logd_writer_test.cpp",
Tom Cherry91589842019-04-25 13:10:30 -070067 "logprint_test.cpp",
Dan Willemsen3e963f92018-10-31 10:32:32 -070068 ],
69 shared_libs: [
Dan Willemsen3e963f92018-10-31 10:32:32 -070070 "libcutils",
71 "libbase",
72 ],
Tom Cherrybbf2a0d2019-01-15 13:12:44 -080073 static_libs: ["liblog"],
Tom Cherry7e99b222019-10-04 13:05:50 -070074 isolated: true,
Tom Cherry20d4d232020-04-30 14:39:10 -070075 require_root: true,
Dan Willemsen3e963f92018-10-31 10:32:32 -070076}
77
78// Build tests for the device (with .so). Run with:
79// adb shell /data/nativetest/liblog-unit-tests/liblog-unit-tests
80cc_test {
81 name: "liblog-unit-tests",
82 defaults: ["liblog-tests-defaults"],
83}
84
85cc_test {
86 name: "CtsLiblogTestCases",
87 defaults: ["liblog-tests-defaults"],
88 multilib: {
89 lib32: {
90 suffix: "32",
91 },
92 lib64: {
93 suffix: "64",
94 },
95 },
96
97 cflags: ["-DNO_PSTORE"],
98 test_suites: [
99 "cts",
Tom Cherryb4bc99e2020-07-28 13:21:13 -0700100 "device-tests",
Dan Willemsen3e963f92018-10-31 10:32:32 -0700101 ],
102}
Tom Cherryd953ba32019-12-10 14:45:02 -0800103
104cc_test_host {
105 name: "liblog-host-test",
106 static_libs: ["liblog"],
107 shared_libs: ["libbase"],
Tom Cherry5676f3d2020-01-27 16:20:35 -0800108 srcs: [
109 "liblog_host_test.cpp",
110 "liblog_default_tag.cpp",
111 "liblog_global_state.cpp",
Tom Cherry5676f3d2020-01-27 16:20:35 -0800112 ],
Tom Cherryd953ba32019-12-10 14:45:02 -0800113 isolated: true,
114}