xref: /aosp_15_r20/external/perfetto/gn/perfetto_unittests.gni (revision 6dbdd20afdafa5e3ca9b8809fa73465d530080dc)
1# 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/base/threading:unittests",
22  "src/protozero:unittests",
23  "src/shared_lib:unittests",
24  "src/tracing/core:unittests",
25  "src/tracing/service:unittests",
26  "src/tracing:unittests",
27  "src/profiling:unittests",
28  "src/profiling/symbolizer:unittests",
29]
30
31if ((is_linux || is_android) && !perfetto_build_with_embedder) {
32  # This test depends on pthread and can't run on non-Linux-based OS.
33  perfetto_unittests_targets += [ "test/sanitizers:unittests" ]
34}
35
36if (enable_perfetto_tools) {
37  perfetto_unittests_targets += [ "src/tools:unittests" ]
38}
39
40if (enable_perfetto_ipc) {
41  perfetto_unittests_targets += [
42    "src/tracing/ipc:unittests",
43    "src/ipc:unittests",
44  ]
45}
46
47if (enable_perfetto_platform_services) {
48  perfetto_unittests_targets += [
49    "src/perfetto_cmd:unittests",
50    "src/traced/service:unittests",
51    "src/kernel_utils:unittests",
52  ]
53  if (enable_perfetto_traced_probes) {
54    perfetto_unittests_targets += [
55      "src/traced/probes:unittests",
56      "src/kallsyms:unittests",
57    ]
58  }
59}
60
61if (enable_perfetto_heapprofd || enable_perfetto_traced_perf) {
62  perfetto_unittests_targets += [ "src/profiling/common:unittests" ]
63}
64
65if (enable_perfetto_heapprofd) {
66  perfetto_unittests_targets += [
67    "src/profiling/memory:unittests",
68    "src/profiling/memory:ring_buffer_unittests",
69  ]
70}
71
72if (enable_perfetto_traced_perf) {
73  perfetto_unittests_targets += [ "src/profiling/perf:producer_unittests" ]
74}
75
76if (enable_perfetto_trace_processor) {
77  perfetto_unittests_targets += [ "src/trace_processor:unittests" ]
78  perfetto_unittests_targets += [ "src/trace_config_utils:unittests" ]
79
80  if (enable_perfetto_trace_processor_sqlite) {
81    perfetto_unittests_targets += [ "src/trace_processor/metrics:unittests" ]
82  }
83}
84
85if (enable_perfetto_traced_relay) {
86  perfetto_unittests_targets += [ "src/traced_relay:unittests" ]
87}
88
89perfetto_unittests_targets += [ "src/trace_redaction:unittests" ]
90