# 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:unittests",
  "src/profiling:unittests",
]

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/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/traced/service: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_metrics) {
    perfetto_unittests_targets += [ "src/trace_processor/metrics:unittests" ]
  }
}
