# 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",
  ]
  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" ]
}
