kythe.io@v0.0.68-0.20240422202219-7225dbc01741/kythe/cxx/extractor/testdata/BUILD (about)

     1  load(
     2      "//tools/build_rules/verifier_test:cc_indexer_test.bzl",
     3      "cc_bazel_extractor_test",
     4      "cc_extractor_test",
     5      "objc_bazel_extractor_test",
     6  )
     7  load("//tools:build_rules/testing.bzl", "shell_tool_test")
     8  
     9  package(
    10      default_visibility = ["//kythe:default_visibility"],
    11      features = ["layering_check"],
    12  )
    13  
    14  filegroup(
    15      name = "skip",
    16      srcs = ["skip_functions.sh"],
    17  )
    18  
    19  cc_test(
    20      name = "root_directory_test",
    21      srcs = ["root_directory_test.cc"],
    22      data = [
    23          "altroot/altpath/file.cc",
    24      ],
    25      deps = [
    26          "//kythe/cxx/common:path_utils",
    27          "//kythe/cxx/extractor:testlib",
    28          "//kythe/proto:analysis_cc_proto",
    29          "//third_party:gmock_main",
    30          "//third_party:gtest",
    31          "@com_github_inazarenko_protobuf_matchers//protobuf-matchers",
    32          "@com_google_absl//absl/strings",
    33      ],
    34  )
    35  
    36  cc_test(
    37      name = "alternate_platform_test",
    38      srcs = ["alternate_platform_test.cc"],
    39      data = ["arm.cc"],
    40      deps = [
    41          "//kythe/cxx/extractor:testlib",
    42          "//kythe/proto:analysis_cc_proto",
    43          "//third_party:gmock_main",
    44          "//third_party:gtest",
    45          "@com_github_inazarenko_protobuf_matchers//protobuf-matchers",
    46          "@com_google_absl//absl/strings",
    47      ],
    48  )
    49  
    50  cc_test(
    51      name = "main_source_file_env_dep_test",
    52      srcs = ["main_source_file_env_dep_test.cc"],
    53      data = [
    54          "main_source_file_env_dep.cc",
    55      ],
    56      deps = [
    57          "//kythe/cxx/extractor:testlib",
    58          "//kythe/proto:analysis_cc_proto",
    59          "//third_party:gmock_main",
    60          "//third_party:gtest",
    61          "@com_github_inazarenko_protobuf_matchers//protobuf-matchers",
    62          "@com_google_absl//absl/algorithm:container",
    63          "@com_google_absl//absl/strings",
    64      ],
    65  )
    66  
    67  cc_test(
    68      name = "main_source_file_no_env_dep_test",
    69      srcs = ["main_source_file_no_env_dep_test.cc"],
    70      data = [
    71          "main_source_file_no_env_dep.cc",
    72      ],
    73      deps = [
    74          "//kythe/cxx/extractor:testlib",
    75          "//kythe/proto:analysis_cc_proto",
    76          "//third_party:gmock_main",
    77          "//third_party:gtest",
    78          "@com_github_inazarenko_protobuf_matchers//protobuf-matchers",
    79          "@com_google_absl//absl/algorithm:container",
    80          "@com_google_absl//absl/strings",
    81      ],
    82  )
    83  
    84  cc_test(
    85      name = "header_only_module_test",
    86      srcs = ["header_only_module_test.cc"],
    87      data = [
    88          "header_only_module.cppmap",
    89          "header_only_module.h",
    90      ],
    91      deps = [
    92          "//kythe/cxx/extractor:testlib",
    93          "//kythe/proto:analysis_cc_proto",
    94          "//third_party:gmock_main",
    95          "//third_party:gtest",
    96          "@com_github_inazarenko_protobuf_matchers//protobuf-matchers",
    97          "@com_google_absl//absl/algorithm:container",
    98          "@com_google_absl//absl/strings",
    99      ],
   100  )
   101  
   102  cc_test(
   103      name = "extract_transcript_test",
   104      srcs = ["extract_transcript_test.cc"],
   105      data = [
   106          "transcript_a.h",
   107          "transcript_b.h",
   108          "transcript_main.cc",
   109      ],
   110      deps = [
   111          "//kythe/cxx/extractor:testlib",
   112          "//kythe/proto:analysis_cc_proto",
   113          "//third_party:gmock_main",
   114          "//third_party:gtest",
   115          "@com_github_inazarenko_protobuf_matchers//protobuf-matchers",
   116          "@com_google_absl//absl/strings",
   117      ],
   118  )
   119  
   120  cc_test(
   121      name = "claim_pragma_test",
   122      size = "small",
   123      srcs = ["claim_pragma_test.cc"],
   124      data = [
   125          "claim_a.h",
   126          "claim_b.h",
   127          "claim_main.cc",
   128      ],
   129      features = [
   130          "-layering_check",  # TODO: protocolbuffers/protobuf#10889
   131      ],
   132      deps = [
   133          "//kythe/cxx/extractor:lib",
   134          "//kythe/cxx/extractor:supported_language",
   135          "//third_party:gmock_main",
   136          "//third_party:gtest",
   137          "@com_google_absl//absl/log:check",
   138          "@com_google_absl//absl/memory",
   139          "@com_google_protobuf//:protobuf",
   140      ],
   141  )
   142  
   143  shell_tool_test(
   144      name = "stdin_names",
   145      data = [
   146          "stdin.vnames",
   147          "test_common.sh",
   148          "test_stdin_names_verify.cc",
   149      ],
   150      scriptfile = "test_stdin_names.sh",
   151      tools = {
   152          "EXTRACTOR": "//kythe/cxx/extractor:cxx_extractor",
   153          "INDEXER": "//kythe/cxx/indexer/cxx:indexer",
   154          "VERIFIER": "//kythe/cxx/verifier",
   155      },
   156  )
   157  
   158  shell_tool_test(
   159      name = "kzip",
   160      data = [
   161          "skip_functions.sh",
   162          "test_common.sh",
   163          "transcript_a.h",
   164          "transcript_b.h",
   165          "transcript_main.cc",
   166      ],
   167      scriptfile = "test_kzip.sh",
   168      tools = {
   169          "EXTRACTOR": "//kythe/cxx/extractor:cxx_extractor",
   170      },
   171  )
   172  
   173  cc_test(
   174      name = "has_include_test",
   175      srcs = ["has_include_test.cc"],
   176      data = [
   177          "has_include.cc",
   178          "has_include.h",
   179      ],
   180      deps = [
   181          "//kythe/cxx/extractor:testlib",
   182          "//kythe/proto:analysis_cc_proto",
   183          "//third_party:gmock_main",
   184          "//third_party:gtest",
   185          "@com_github_inazarenko_protobuf_matchers//protobuf-matchers",
   186          "@com_google_absl//absl/strings",
   187      ],
   188  )
   189  
   190  cc_test(
   191      name = "indirect_has_include_test",
   192      srcs = ["indirect_has_include_test.cc"],
   193      data = [
   194          "has_include.h",
   195          "indirect_has_include.cc",
   196          "indirect_has_include.h",
   197      ],
   198      deps = [
   199          "//kythe/cxx/extractor:testlib",
   200          "//kythe/proto:analysis_cc_proto",
   201          "//third_party:gmock_main",
   202          "//third_party:gtest",
   203          "@com_github_inazarenko_protobuf_matchers//protobuf-matchers",
   204          "@com_google_absl//absl/strings",
   205      ],
   206  )
   207  
   208  cc_test(
   209      name = "metadata_test",
   210      srcs = ["metadata_test.cc"],
   211      data = [
   212          "metadata.cc",
   213          "metadata.cc.meta",
   214      ],
   215      deps = [
   216          "//kythe/cxx/extractor:testlib",
   217          "//kythe/proto:analysis_cc_proto",
   218          "//third_party:gmock_main",
   219          "//third_party:gtest",
   220          "@com_github_inazarenko_protobuf_matchers//protobuf-matchers",
   221          "@com_google_absl//absl/strings",
   222      ],
   223  )
   224  
   225  cc_test(
   226      name = "modules_test",
   227      srcs = ["modules_test.cc"],
   228      data = [
   229          "modfoo.h",
   230          "modfoo.modulemap",
   231          "modules.cc",
   232      ],
   233      deps = [
   234          "//kythe/cxx/extractor:testlib",
   235          "//kythe/proto:analysis_cc_proto",
   236          "//third_party:gmock_main",
   237          "//third_party:gtest",
   238          "@com_github_inazarenko_protobuf_matchers//protobuf-matchers",
   239          "@com_google_absl//absl/algorithm:container",
   240          "@com_google_absl//absl/strings",
   241      ],
   242  )
   243  
   244  cc_test(
   245      name = "build_config_test",
   246      srcs = ["build_config_test.cc"],
   247      data = [
   248          "build_config.cc",
   249      ],
   250      features = [
   251          "-layering_check",  # TODO: protocolbuffers/protobuf#10889
   252      ],
   253      deps = [
   254          "//kythe/cxx/extractor:testlib",
   255          "//kythe/proto:analysis_cc_proto",
   256          "//kythe/proto:buildinfo_cc_proto",
   257          "//third_party:gmock_main",
   258          "//third_party:gtest",
   259          "@com_github_inazarenko_protobuf_matchers//protobuf-matchers",
   260          "@com_google_absl//absl/log",
   261          "@com_google_absl//absl/strings",
   262          "@com_google_protobuf//:protobuf",
   263      ],
   264  )
   265  
   266  cc_test(
   267      name = "installed_dir_test",
   268      srcs = ["installed_dir_test.cc"],
   269      data = [
   270          # Clang resolves the include directory relative to `bin`,
   271          # so the former needs to exist.
   272          "bin/clang",
   273          "include/c++/v1/dummy",
   274          "installed_dir.cc",
   275      ],
   276      deps = [
   277          "//kythe/cxx/extractor:testlib",
   278          "//kythe/proto:analysis_cc_proto",
   279          "//third_party:gmock_main",
   280          "//third_party:gtest",
   281          "@com_github_inazarenko_protobuf_matchers//protobuf-matchers",
   282          "@com_google_absl//absl/strings",
   283      ],
   284  )
   285  
   286  cc_extractor_test(
   287      name = "recursish_macro_test",
   288      size = "small",
   289      srcs = [
   290          "recursish_macro.cc",
   291      ],
   292  )
   293  
   294  cc_extractor_test(
   295      name = "extract_verify_test",
   296      size = "small",
   297      srcs = [
   298          "extract_verify_test.cc",
   299      ],
   300  )
   301  
   302  cc_extractor_test(
   303      name = "extract_verify_stddef_test",
   304      size = "small",
   305      srcs = [
   306          "extract_verify_stddef_test.cc",
   307      ],
   308  )
   309  
   310  cc_extractor_test(
   311      name = "extract_verify_std_string_test",
   312      size = "small",
   313      srcs = [
   314          "extract_verify_std_string_test.cc",
   315      ],
   316  )
   317  
   318  cc_extractor_test(
   319      name = "extract_verify_std_vector_test",
   320      size = "small",
   321      srcs = [
   322          "extract_verify_std_vector_test.cc",
   323      ],
   324  )
   325  
   326  cc_extractor_test(
   327      name = "extract_verify_iostream_test",
   328      size = "medium",
   329      srcs = [
   330          "extract_verify_iostream_test.cc",
   331      ],
   332  )
   333  
   334  objc_library(
   335      name = "objc_lib",
   336      srcs = ["objc_lib.m"],
   337      # This is a little tricky to build, so don't do it automatically.
   338      tags = [
   339          "arc-ignore",
   340          "broken",
   341          "manual",
   342      ],
   343      target_compatible_with = [
   344          "@platforms//os:osx",
   345      ],
   346  )
   347  
   348  # Test that we can use the bazel extractor to extract a .xa file, index the
   349  # result of the extraction, and verify the result of the indexing. The primary
   350  # purpose of this test is to see if the whole pipeline works without failure.
   351  # The actual verficiation being done is not important as long as *some*
   352  # verficiation is being done.
   353  #
   354  # The xa file is generated and copied into this directory by running the helper
   355  # script run_objc_bazel_extraction.sh.
   356  objc_bazel_extractor_test(
   357      name = "objc_lib_test",
   358      size = "small",
   359      src = "objc_lib.m",
   360      data = "objc_lib.xa",
   361      # This test no longer passes, even on OSX, so do not include it in our presubmit.
   362      tags = [
   363          "arc-ignore",
   364          "broken",
   365          "manual",
   366      ],
   367      target_compatible_with = [
   368          "@platforms//os:osx",
   369      ],
   370  )
   371  
   372  cc_library(
   373      name = "cc_lib",
   374      srcs = ["cc_lib.cc"],
   375      copts = ["-Wno-missing-prototypes"],
   376  )
   377  
   378  # Test that we can use the bazel extractor to extract a .xa file, index the
   379  # result of the extraction, and verify the result of the indexing. The primary
   380  # purpose of this test is to see if the whole pipeline works without failure.
   381  # The actual verficiation being done is not important.
   382  #
   383  # The xa file is generated and copied into this directory by running the helper
   384  # script run_cxx_bazel_extraction.sh.
   385  cc_bazel_extractor_test(
   386      name = "cc_lib_test",
   387      size = "small",
   388      src = "cc_lib.cc",
   389      data = "cc_lib.xa",
   390  )