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/protozero:unittests", 22 "src/tracing/core:unittests", 23 "src/tracing:unittests", 24 "src/profiling:unittests", 25 "src/profiling/symbolizer:unittests", 26] 27 28if (enable_perfetto_ipc) { 29 perfetto_unittests_targets += [ "src/tracing/test:tracing_integration_test" ] 30} 31 32if (enable_perfetto_tools && current_toolchain == host_toolchain) { 33 perfetto_unittests_targets += [ "tools/ftrace_proto_gen:unittests" ] 34} 35 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. 39if ((is_linux || is_android) && !perfetto_build_with_embedder) { 40 # This test depends on pthread and can't run on non-Linux-based OS. 41 perfetto_unittests_targets += [ "tools/sanitizers_unittests" ] 42} 43 44if (enable_perfetto_ipc) { 45 perfetto_unittests_targets += [ 46 "src/tracing/ipc:unittests", 47 "src/ipc:unittests", 48 ] 49} 50 51if (enable_perfetto_platform_services) { 52 perfetto_unittests_targets += [ 53 "src/perfetto_cmd:unittests", 54 "src/traced/service:unittests", 55 ] 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 } 64} 65 66if (enable_perfetto_heapprofd || enable_perfetto_traced_perf) { 67 perfetto_unittests_targets += [ "src/profiling/common:unittests" ] 68} 69 70if (enable_perfetto_heapprofd) { 71 perfetto_unittests_targets += [ 72 "src/profiling/memory:unittests", 73 "src/profiling/memory:ring_buffer_unittests", 74 ] 75} 76 77if (enable_perfetto_traced_perf) { 78 perfetto_unittests_targets += [ "src/profiling/perf:producer_unittests" ] 79} 80 81if (enable_perfetto_trace_processor) { 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 } 87} 88