1
    2
    3
    4
    5
    6
    7
    8
    9
   10
   11
   12
   13
   14
   15
   16
   17
   18
   19
   20
   21
   22
   23
   24
   25
   26
   27
   28
   29
   30
   31
   32
   33
   34
   35
   36
   37
   38
   39
   40
   41
   42
   43
   44
   45
   46
   47
   48
   49
   50
   51
   52
   53
   54
   55
   56
   57
   58
   59
   60
   61
   62
   63
   64
   65
   66
   67
   68
   69
   70
   71
   72
   73
   74
   75
   76
   77
   78
   79
   80
   81
   82
   83

build / android / test / BUILD.gn [blame]

# Copyright 2021 The Chromium Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import("//build/config/android/android_nocompile.gni")
import("missing_symbol_test.gni")
import("nocompile_gn/nocompile_sources.gni")

group("android_nocompile_tests") {
  testonly = true

  # No-compile tests use an output directory dedicated to no-compile tests.
  # All test suites use targets in nocompile_gn/BUILD.gn in order to share the
  # same target output directory and avoid running 'gn gen' for each
  # android_nocompile_test_suite().
  deps = [
    ":android_lint_tests",
    ":android_lookup_dep_tests",
  ]
}

android_nocompile_test_suite("android_lint_tests") {
  # Depend on lint script so that the action is re-run whenever the script is  modified.
  pydeps = [ "//build/android/gyp/lint.pydeps" ]

  tests = [
    {
      target = "nocompile_gn:default_locale_lint_test"
      nocompile_sources =
          rebase_path(default_locale_lint_test_nocompile_sources,
                      "",
                      "nocompile_gn")
      expected_compile_output_regex = "Warning:.*DefaultLocale"
    },
    {
      target = "nocompile_gn:new_api_lint_test"
      nocompile_sources =
          rebase_path(new_api_lint_test_nocompile_sources, "", "nocompile_gn")
      expected_compile_output_regex = "Error:.*NewApi"
    },
  ]
}

android_nocompile_test_suite("android_lookup_dep_tests") {
  sources =
      [ rebase_path(missing_symbol_generated_importer_template_nocompile_source,
                    "",
                    "nocompile_gn") ]

  tests = [
    {
      target = "nocompile_gn:import_child_missing_symbol_test_java"
      nocompile_sources =
          rebase_path(import_child_missing_symbol_test_nocompile_sources,
                      "",
                      "nocompile_gn")
      expected_compile_output_regex = "Hint: Try adding the following to //build/android/test/nocompile_gn:import_child_missing_symbol_test_java\n *\"//build/android/test/nocompile_gn:sub_b_java\""
    },
    {
      target = "nocompile_gn:import_parent_missing_symbol_test_java"
      nocompile_sources = []
      expected_compile_output_regex = "Hint: Try adding the following to //build/android/test/nocompile_gn:import_parent_missing_symbol_test_java\n *\"//build/android/test/nocompile_gn:b_java\""
    },
    {
      target = "nocompile_gn:import_turbine_missing_symbol_test_java"
      nocompile_sources =
          rebase_path(import_turbine_missing_symbol_test_nocompile_sources,
                      "",
                      "nocompile_gn")
      expected_compile_output_regex = "Hint: Try adding the following to //build/android/test/nocompile_gn:import_turbine_missing_symbol_test_java\n *\"//build/android/test/nocompile_gn:b_java\""
    },
    {
      target = "nocompile_gn:prebuilt_missing_symbol_test_java"
      nocompile_sources = []
      expected_compile_output_regex = "Hint: Try adding the following to //build/android/test/nocompile_gn:prebuilt_missing_symbol_test_java\n *\"//build/android/test/nocompile_gn:c_prebuilt_java\""
    },
    {
      target = "nocompile_gn:cpp_template_missing_symbol_test_java"
      nocompile_sources = []
      expected_compile_output_regex = "Hint: Try adding the following to //build/android/test/nocompile_gn:cpp_template_missing_symbol_test_java\n *\"//build/android/test/nocompile_gn:d_java\""
    },
  ]
}