# 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/base/threading:unittests",
  "src/protozero:unittests",
  "src/shared_lib:unittests",
  "src/tracing/core:unittests",
  "src/tracing/service:unittests",
  "src/tracing:unittests",
  "src/profiling:unittests",
  "src/profiling/symbolizer:unittests",
]

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 += [ "test/sanitizers:unittests" ]
}

if (enable_perfetto_tools) {
  perfetto_unittests_targets += [ "src/tools: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/service:unittests",
    "src/kernel_utils:unittests",
  ]
  if (enable_perfetto_traced_probes) {
    perfetto_unittests_targets += [
      "src/traced/probes:unittests",
      "src/kallsyms: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" ]
  perfetto_unittests_targets += [ "src/traceconv:unittests" ]

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

if (enable_perfetto_traced_relay) {
  perfetto_unittests_targets += [ "src/traced_relay:unittests" ]
}

perfetto_unittests_targets += [ "src/trace_redaction:unittests" ]
