BUILD 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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:diagnostic_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 = [":min_prelude"],
  57. tests = [":all_testdata"],
  58. deps = [
  59. "//common:all_llvm_targets",
  60. "//common:error",
  61. "//testing/file_test:file_test_base",
  62. "//toolchain/driver",
  63. "@abseil-cpp//absl/strings",
  64. "@llvm-project//llvm:Support",
  65. ],
  66. )
  67. cc_library(
  68. name = "yaml_test_helpers",
  69. testonly = 1,
  70. srcs = ["yaml_test_helpers.cpp"],
  71. hdrs = ["yaml_test_helpers.h"],
  72. deps = [
  73. "//common:error",
  74. "//common:ostream",
  75. "//common:raw_string_ostream",
  76. "@abseil-cpp//absl/strings",
  77. "@googletest//:gtest",
  78. "@llvm-project//llvm:Support",
  79. ],
  80. )
  81. cc_test(
  82. name = "yaml_test_helpers_test",
  83. size = "small",
  84. srcs = ["yaml_test_helpers_test.cpp"],
  85. deps = [
  86. ":yaml_test_helpers",
  87. "//testing/base:gtest_main",
  88. "@googletest//:gtest",
  89. ],
  90. )