BUILD 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  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/diagnostics:testdata",
  13. "//toolchain/driver:testdata",
  14. "//toolchain/format:testdata",
  15. "//toolchain/language_server:testdata",
  16. "//toolchain/lex:testdata",
  17. "//toolchain/lower:testdata",
  18. "//toolchain/parse:testdata",
  19. ],
  20. )
  21. filegroup(
  22. name = "minimal_preludes",
  23. data = [
  24. "//toolchain/testing/min_prelude",
  25. ],
  26. )
  27. cc_library(
  28. name = "compile_helper",
  29. testonly = 1,
  30. srcs = ["compile_helper.cpp"],
  31. hdrs = ["compile_helper.h"],
  32. deps = [
  33. "//toolchain/diagnostics:diagnostic_emitter",
  34. "//toolchain/lex",
  35. "//toolchain/parse",
  36. "//toolchain/parse:tree",
  37. "//toolchain/source:source_buffer",
  38. "@llvm-project//llvm:Support",
  39. ],
  40. )
  41. cc_library(
  42. name = "coverage_helper",
  43. testonly = 1,
  44. hdrs = ["coverage_helper.h"],
  45. deps = [
  46. "//common:find",
  47. "//common:set",
  48. "@googletest//:gtest",
  49. "@llvm-project//llvm:Support",
  50. "@re2",
  51. ],
  52. )
  53. file_test(
  54. name = "file_test",
  55. size = "small",
  56. timeout = "moderate", # Taking >60 seconds in GitHub actions
  57. srcs = ["file_test.cpp"],
  58. data = [":minimal_preludes"],
  59. tests = [":all_testdata"],
  60. deps = [
  61. "//common:all_llvm_targets",
  62. "//common:error",
  63. "//testing/file_test:file_test_base",
  64. "//toolchain/driver",
  65. "@abseil-cpp//absl/strings",
  66. "@llvm-project//llvm:Support",
  67. ],
  68. )
  69. cc_library(
  70. name = "yaml_test_helpers",
  71. testonly = 1,
  72. srcs = ["yaml_test_helpers.cpp"],
  73. hdrs = ["yaml_test_helpers.h"],
  74. deps = [
  75. "//common:error",
  76. "//common:ostream",
  77. "//common:raw_string_ostream",
  78. "@abseil-cpp//absl/strings",
  79. "@googletest//:gtest",
  80. "@llvm-project//llvm:Support",
  81. ],
  82. )
  83. cc_test(
  84. name = "yaml_test_helpers_test",
  85. size = "small",
  86. srcs = ["yaml_test_helpers_test.cpp"],
  87. deps = [
  88. ":yaml_test_helpers",
  89. "//testing/base:gtest_main",
  90. "@googletest//:gtest",
  91. ],
  92. )