Primiano Tucci | 02c1176 | 2019-08-30 00:57:59 +0200 | [diff] [blame] | 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 | |
| 15 | import("perfetto.gni") |
| 16 | |
| 17 | perfetto_unittests_targets = [ |
| 18 | "gn:default_deps", |
| 19 | "gn:gtest_main", |
| 20 | "src/base:unittests", |
| 21 | "src/protozero:unittests", |
Primiano Tucci | c4c063b | 2020-01-27 09:34:46 +0000 | [diff] [blame] | 22 | "src/tracing/core:unittests", |
Alexander Timin | 02d7985 | 2021-01-15 16:31:24 +0000 | [diff] [blame] | 23 | "src/tracing:unittests", |
Florian Mayer | 8237596 | 2019-11-20 16:45:28 +0000 | [diff] [blame] | 24 | "src/profiling:unittests", |
Florian Mayer | 4dd5a1f | 2020-07-14 13:00:51 +0100 | [diff] [blame] | 25 | "src/profiling/symbolizer:unittests", |
Primiano Tucci | 02c1176 | 2019-08-30 00:57:59 +0200 | [diff] [blame] | 26 | ] |
| 27 | |
Primiano Tucci | 230fbe5 | 2020-01-27 12:59:10 +0000 | [diff] [blame] | 28 | if (enable_perfetto_ipc) { |
| 29 | perfetto_unittests_targets += [ "src/tracing/test:tracing_integration_test" ] |
| 30 | } |
| 31 | |
Primiano Tucci | f33540e | 2019-09-19 12:35:57 +0100 | [diff] [blame] | 32 | if (enable_perfetto_tools && current_toolchain == host_toolchain) { |
| 33 | perfetto_unittests_targets += [ "tools/ftrace_proto_gen:unittests" ] |
Primiano Tucci | 02c1176 | 2019-08-30 00:57:59 +0200 | [diff] [blame] | 34 | } |
| 35 | |
Primiano Tucci | f33540e | 2019-09-19 12:35:57 +0100 | [diff] [blame] | 36 | # 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 Kyostila | abc57fb | 2019-09-23 15:55:14 +0100 | [diff] [blame] | 39 | if ((is_linux || is_android) && !perfetto_build_with_embedder) { |
Primiano Tucci | 84a1bf4 | 2019-09-20 15:57:06 +0100 | [diff] [blame] | 40 | # This test depends on pthread and can't run on non-Linux-based OS. |
| 41 | perfetto_unittests_targets += [ "tools/sanitizers_unittests" ] |
| 42 | } |
Primiano Tucci | f33540e | 2019-09-19 12:35:57 +0100 | [diff] [blame] | 43 | |
Primiano Tucci | 02c1176 | 2019-08-30 00:57:59 +0200 | [diff] [blame] | 44 | if (enable_perfetto_ipc) { |
Primiano Tucci | c4c063b | 2020-01-27 09:34:46 +0000 | [diff] [blame] | 45 | perfetto_unittests_targets += [ |
| 46 | "src/tracing/ipc:unittests", |
| 47 | "src/ipc:unittests", |
| 48 | ] |
Primiano Tucci | 02c1176 | 2019-08-30 00:57:59 +0200 | [diff] [blame] | 49 | } |
| 50 | |
| 51 | if (enable_perfetto_platform_services) { |
| 52 | perfetto_unittests_targets += [ |
| 53 | "src/perfetto_cmd:unittests", |
Primiano Tucci | 02c1176 | 2019-08-30 00:57:59 +0200 | [diff] [blame] | 54 | "src/traced/service:unittests", |
| 55 | ] |
Primiano Tucci | a7f5a8e | 2021-01-02 17:10:50 +0100 | [diff] [blame] | 56 | 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 Tucci | 02c1176 | 2019-08-30 00:57:59 +0200 | [diff] [blame] | 64 | } |
| 65 | |
Ryan Savitski | 683b57f | 2020-02-06 22:09:19 +0000 | [diff] [blame] | 66 | if (enable_perfetto_heapprofd || enable_perfetto_traced_perf) { |
| 67 | perfetto_unittests_targets += [ "src/profiling/common:unittests" ] |
| 68 | } |
| 69 | |
Primiano Tucci | 02c1176 | 2019-08-30 00:57:59 +0200 | [diff] [blame] | 70 | if (enable_perfetto_heapprofd) { |
| 71 | perfetto_unittests_targets += [ |
| 72 | "src/profiling/memory:unittests", |
| 73 | "src/profiling/memory:ring_buffer_unittests", |
| 74 | ] |
| 75 | } |
| 76 | |
Ryan Savitski | a76b3cc | 2019-11-20 16:25:24 +0000 | [diff] [blame] | 77 | if (enable_perfetto_traced_perf) { |
| 78 | perfetto_unittests_targets += [ "src/profiling/perf:producer_unittests" ] |
| 79 | } |
| 80 | |
Primiano Tucci | 02c1176 | 2019-08-30 00:57:59 +0200 | [diff] [blame] | 81 | if (enable_perfetto_trace_processor) { |
Mikhail Khokhlov | 0f7e68d | 2020-01-16 15:39:27 +0000 | [diff] [blame] | 82 | 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 Tucci | 02c1176 | 2019-08-30 00:57:59 +0200 | [diff] [blame] | 87 | } |