# Copyright (C) 2019 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import("perfetto.gni")

perfetto_unittests_targets = [
  "gn:default_deps",
  "gn:gtest_main",
  "src/base:unittests",
  "src/protozero:unittests",
  "src/tracing/core:unittests",
  "src/profiling:unittests",
  "src/profiling/symbolizer:unittests",
]

if (enable_perfetto_ipc) {
  perfetto_unittests_targets += [ "src/tracing/test:tracing_integration_test" ]
}

if (enable_perfetto_tools && current_toolchain == host_toolchain) {
  perfetto_unittests_targets += [ "tools/ftrace_proto_gen:unittests" ]
}

# TODO(primiano): sanitizers_unittests shouldn't really be under tools. It's
# not a tool and it's intended to run on both host and targets to check that
# sanitizers are actually working.
if ((is_linux || is_android) && !perfetto_build_with_embedder) {
  # This test depends on pthread and can't run on non-Linux-based OS.
  perfetto_unittests_targets += [ "tools/sanitizers_unittests" ]
}

if (enable_perfetto_ipc) {
  perfetto_unittests_targets += [
    "src/tracing/ipc:unittests",
    "src/ipc:unittests",
  ]
}

if (enable_perfetto_platform_services) {
  perfetto_unittests_targets += [
    "src/perfetto_cmd:unittests",
    "src/traced/probes:unittests",
    "src/traced/probes/filesystem:unittests",
    "src/traced/probes/ftrace:unittests",
    "src/kallsyms:unittests",
    "src/traced/service:unittests",
  ]
}

if (enable_perfetto_heapprofd || enable_perfetto_traced_perf) {
  perfetto_unittests_targets += [ "src/profiling/common:unittests" ]
}

if (enable_perfetto_heapprofd) {
  perfetto_unittests_targets += [
    "src/profiling/memory:unittests",
    "src/profiling/memory:ring_buffer_unittests",
  ]
}

if (enable_perfetto_traced_perf) {
  perfetto_unittests_targets += [ "src/profiling/perf:producer_unittests" ]
}

if (enable_perfetto_trace_processor) {
  perfetto_unittests_targets += [ "src/trace_processor:unittests" ]

  if (enable_perfetto_trace_processor_sqlite) {
    perfetto_unittests_targets += [ "src/trace_processor/metrics:unittests" ]
  }
}
