blob: 9b6a95d51ed078f489a2841fd5ed80e29b1e027f [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",
Florian Mayer82375962019-11-20 16:45:28 +000023 "src/profiling:unittests",
Florian Mayer4dd5a1f2020-07-14 13:00:51 +010024 "src/profiling/symbolizer:unittests",
Primiano Tucci02c11762019-08-30 00:57:59 +020025]
26
Primiano Tucci230fbe52020-01-27 12:59:10 +000027if (enable_perfetto_ipc) {
28 perfetto_unittests_targets += [ "src/tracing/test:tracing_integration_test" ]
29}
30
Primiano Tuccif33540e2019-09-19 12:35:57 +010031if (enable_perfetto_tools && current_toolchain == host_toolchain) {
32 perfetto_unittests_targets += [ "tools/ftrace_proto_gen:unittests" ]
Primiano Tucci02c11762019-08-30 00:57:59 +020033}
34
Primiano Tuccif33540e2019-09-19 12:35:57 +010035# TODO(primiano): sanitizers_unittests shouldn't really be under tools. It's
36# not a tool and it's intended to run on both host and targets to check that
37# sanitizers are actually working.
Sami Kyostilaabc57fb2019-09-23 15:55:14 +010038if ((is_linux || is_android) && !perfetto_build_with_embedder) {
Primiano Tucci84a1bf42019-09-20 15:57:06 +010039 # This test depends on pthread and can't run on non-Linux-based OS.
40 perfetto_unittests_targets += [ "tools/sanitizers_unittests" ]
41}
Primiano Tuccif33540e2019-09-19 12:35:57 +010042
Primiano Tucci02c11762019-08-30 00:57:59 +020043if (enable_perfetto_ipc) {
Primiano Tuccic4c063b2020-01-27 09:34:46 +000044 perfetto_unittests_targets += [
45 "src/tracing/ipc:unittests",
46 "src/ipc:unittests",
47 ]
Primiano Tucci02c11762019-08-30 00:57:59 +020048}
49
50if (enable_perfetto_platform_services) {
51 perfetto_unittests_targets += [
52 "src/perfetto_cmd:unittests",
53 "src/traced/probes:unittests",
54 "src/traced/probes/filesystem:unittests",
55 "src/traced/probes/ftrace:unittests",
Ryan Savitskidc218882020-11-16 18:02:02 +000056 "src/kallsyms:unittests",
Primiano Tucci02c11762019-08-30 00:57:59 +020057 "src/traced/service:unittests",
58 ]
59}
60
Ryan Savitski683b57f2020-02-06 22:09:19 +000061if (enable_perfetto_heapprofd || enable_perfetto_traced_perf) {
62 perfetto_unittests_targets += [ "src/profiling/common:unittests" ]
63}
64
Primiano Tucci02c11762019-08-30 00:57:59 +020065if (enable_perfetto_heapprofd) {
66 perfetto_unittests_targets += [
67 "src/profiling/memory:unittests",
68 "src/profiling/memory:ring_buffer_unittests",
69 ]
70}
71
Ryan Savitskia76b3cc2019-11-20 16:25:24 +000072if (enable_perfetto_traced_perf) {
73 perfetto_unittests_targets += [ "src/profiling/perf:producer_unittests" ]
74}
75
Primiano Tucci02c11762019-08-30 00:57:59 +020076if (enable_perfetto_trace_processor) {
Mikhail Khokhlov0f7e68d2020-01-16 15:39:27 +000077 perfetto_unittests_targets += [ "src/trace_processor:unittests" ]
78
79 if (enable_perfetto_trace_processor_sqlite) {
80 perfetto_unittests_targets += [ "src/trace_processor/metrics:unittests" ]
81 }
Primiano Tucci02c11762019-08-30 00:57:59 +020082}