blob: 1a2b48219bf61383bc750e40b089b0558d9872a8 [file] [log] [blame]
Primiano Tucci02c11762019-08-30 00:57:59 +02001# Copyright (C) 2019 The Android Open Source Project
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15import("perfetto.gni")
16
17perfetto_unittests_targets = [
18 "gn:default_deps",
19 "gn:gtest_main",
20 "src/base:unittests",
21 "src/protozero:unittests",
Primiano Tuccic4c063b2020-01-27 09:34:46 +000022 "src/tracing/core:unittests",
Alexander Timin02d79852021-01-15 16:31:24 +000023 "src/tracing:unittests",
Florian Mayer82375962019-11-20 16:45:28 +000024 "src/profiling:unittests",
Florian Mayer4dd5a1f2020-07-14 13:00:51 +010025 "src/profiling/symbolizer:unittests",
Primiano Tucci02c11762019-08-30 00:57:59 +020026]
27
Primiano Tucci230fbe52020-01-27 12:59:10 +000028if (enable_perfetto_ipc) {
29 perfetto_unittests_targets += [ "src/tracing/test:tracing_integration_test" ]
30}
31
Primiano Tuccif33540e2019-09-19 12:35:57 +010032if (enable_perfetto_tools && current_toolchain == host_toolchain) {
33 perfetto_unittests_targets += [ "tools/ftrace_proto_gen:unittests" ]
Primiano Tucci02c11762019-08-30 00:57:59 +020034}
35
Primiano Tuccif33540e2019-09-19 12:35:57 +010036# TODO(primiano): sanitizers_unittests shouldn't really be under tools. It's
37# not a tool and it's intended to run on both host and targets to check that
38# sanitizers are actually working.
Sami Kyostilaabc57fb2019-09-23 15:55:14 +010039if ((is_linux || is_android) && !perfetto_build_with_embedder) {
Primiano Tucci84a1bf42019-09-20 15:57:06 +010040 # This test depends on pthread and can't run on non-Linux-based OS.
41 perfetto_unittests_targets += [ "tools/sanitizers_unittests" ]
42}
Primiano Tuccif33540e2019-09-19 12:35:57 +010043
Primiano Tucci02c11762019-08-30 00:57:59 +020044if (enable_perfetto_ipc) {
Primiano Tuccic4c063b2020-01-27 09:34:46 +000045 perfetto_unittests_targets += [
46 "src/tracing/ipc:unittests",
47 "src/ipc:unittests",
48 ]
Primiano Tucci02c11762019-08-30 00:57:59 +020049}
50
51if (enable_perfetto_platform_services) {
52 perfetto_unittests_targets += [
53 "src/perfetto_cmd:unittests",
Primiano Tucci02c11762019-08-30 00:57:59 +020054 "src/traced/service:unittests",
55 ]
Primiano Tuccia7f5a8e2021-01-02 17:10:50 +010056 if (enable_perfetto_traced_probes) {
57 perfetto_unittests_targets += [
58 "src/traced/probes:unittests",
59 "src/traced/probes/filesystem:unittests",
60 "src/traced/probes/ftrace:unittests",
61 "src/kallsyms:unittests",
62 ]
63 }
Primiano Tucci02c11762019-08-30 00:57:59 +020064}
65
Ryan Savitski683b57f2020-02-06 22:09:19 +000066if (enable_perfetto_heapprofd || enable_perfetto_traced_perf) {
67 perfetto_unittests_targets += [ "src/profiling/common:unittests" ]
68}
69
Primiano Tucci02c11762019-08-30 00:57:59 +020070if (enable_perfetto_heapprofd) {
71 perfetto_unittests_targets += [
72 "src/profiling/memory:unittests",
73 "src/profiling/memory:ring_buffer_unittests",
74 ]
75}
76
Ryan Savitskia76b3cc2019-11-20 16:25:24 +000077if (enable_perfetto_traced_perf) {
78 perfetto_unittests_targets += [ "src/profiling/perf:producer_unittests" ]
79}
80
Primiano Tucci02c11762019-08-30 00:57:59 +020081if (enable_perfetto_trace_processor) {
Mikhail Khokhlov0f7e68d2020-01-16 15:39:27 +000082 perfetto_unittests_targets += [ "src/trace_processor:unittests" ]
83
84 if (enable_perfetto_trace_processor_sqlite) {
85 perfetto_unittests_targets += [ "src/trace_processor/metrics:unittests" ]
86 }
Primiano Tucci02c11762019-08-30 00:57:59 +020087}