# 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_integrationtests_targets = [
  "gn:default_deps",
  "src/tracing/test:client_api_integrationtests",
  "src/shared_lib/test:integrationtests",
]

if (enable_perfetto_ipc && enable_perfetto_system_consumer) {
  perfetto_integrationtests_targets += [
    "src/tracing/test:tracing_integration_test",
    "src/tracing:integrationtests",
  ]
}

if (enable_perfetto_traced_probes) {
  # enable_perfetto_traced_probes implies enable_perfetto_platform_services.
  perfetto_integrationtests_targets += [
    "src/traced/probes/ftrace:integrationtests",
    "test:perfetto_end_to_end_integrationtests",
  ]
}

if (enable_perfetto_heapprofd) {
  perfetto_integrationtests_targets +=
      [ "src/profiling/memory:end_to_end_tests" ]
}

# This test requires extra data files that are not easily available in Android
# builds.
# TODO(lalitm): looks like they don't work on standalone Android either because
# run_android_test doesn't push the test data.
if (enable_perfetto_trace_processor && perfetto_build_standalone &&
    !is_android) {
  perfetto_integrationtests_targets +=
      [ "src/trace_processor:integrationtests" ]
}

# This test requires traces that are not available on Android builds.
if (perfetto_build_standalone && !is_android) {
  perfetto_integrationtests_targets +=
      [ "src/trace_redaction:integrationtests" ]
}

if (enable_perfetto_traced_relay) {
  perfetto_integrationtests_targets += [ "src/traced_relay:integrationtests" ]
}
