BUILD 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. # Part of the Carbon Language project, under the Apache License v2.0 with LLVM
  2. # Exceptions. See /LICENSE for license information.
  3. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  4. load("//bazel/cc_rules:defs.bzl", "cc_library", "cc_test")
  5. load("//testing/file_test:rules.bzl", "file_test")
  6. package(default_visibility = ["//visibility:public"])
  7. filegroup(
  8. name = "all_testdata",
  9. srcs = [
  10. "//toolchain/check:testdata",
  11. "//toolchain/codegen:testdata",
  12. "//toolchain/driver:testdata",
  13. "//toolchain/format:testdata",
  14. "//toolchain/language_server:testdata",
  15. "//toolchain/lex:testdata",
  16. "//toolchain/lower:testdata",
  17. "//toolchain/parse:testdata",
  18. ],
  19. )
  20. filegroup(
  21. name = "min_prelude",
  22. srcs = glob(["testdata/min_prelude/**/*.carbon"]),
  23. visibility = ["//visibility:public"],
  24. )
  25. cc_library(
  26. name = "compile_helper",
  27. testonly = 1,
  28. srcs = ["compile_helper.cpp"],
  29. hdrs = ["compile_helper.h"],
  30. deps = [
  31. "//toolchain/diagnostics:emitter",
  32. "//toolchain/lex",
  33. "//toolchain/parse",
  34. "//toolchain/parse:tree",
  35. "//toolchain/source:source_buffer",
  36. "@llvm-project//llvm:Support",
  37. ],
  38. )
  39. cc_library(
  40. name = "coverage_helper",
  41. testonly = 1,
  42. hdrs = ["coverage_helper.h"],
  43. deps = [
  44. "//common:find",
  45. "//common:set",
  46. "@googletest//:gtest",
  47. "@llvm-project//llvm:Support",
  48. "@re2",
  49. ],
  50. )
  51. file_test(
  52. name = "file_test",
  53. size = "small",
  54. timeout = "moderate", # Taking >60 seconds in GitHub actions
  55. srcs = ["file_test.cpp"],
  56. data = [
  57. ":min_prelude",
  58. "//toolchain/install:clang_headers_manifest.txt",
  59. "//toolchain/install:installed_clang_headers",
  60. ],
  61. tests = [":all_testdata"],
  62. deps = [
  63. "//common:all_llvm_targets",
  64. "//common:error",
  65. "//testing/file_test:autoupdate",
  66. "//testing/file_test:file_test_base",
  67. "//toolchain/driver",
  68. "@abseil-cpp//absl/strings",
  69. "@llvm-project//llvm:Support",
  70. ],
  71. )
  72. cc_library(
  73. name = "yaml_test_helpers",
  74. testonly = 1,
  75. srcs = ["yaml_test_helpers.cpp"],
  76. hdrs = ["yaml_test_helpers.h"],
  77. deps = [
  78. "//common:error",
  79. "//common:ostream",
  80. "//common:raw_string_ostream",
  81. "@abseil-cpp//absl/strings",
  82. "@googletest//:gtest",
  83. "@llvm-project//llvm:Support",
  84. ],
  85. )
  86. cc_test(
  87. name = "yaml_test_helpers_test",
  88. size = "small",
  89. srcs = ["yaml_test_helpers_test.cpp"],
  90. deps = [
  91. ":yaml_test_helpers",
  92. "//common:error_test_helpers",
  93. "//testing/base:gtest_main",
  94. "@googletest//:gtest",
  95. ],
  96. )