BUILD 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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("@rules_cc//cc:defs.bzl", "cc_library", "cc_test")
  5. load("//bazel/cc_toolchains:defs.bzl", "cc_env")
  6. load("//testing/file_test:rules.bzl", "file_test")
  7. package(default_visibility = ["//visibility:public"])
  8. cc_library(
  9. name = "compile_helper",
  10. testonly = 1,
  11. srcs = ["compile_helper.cpp"],
  12. hdrs = ["compile_helper.h"],
  13. deps = [
  14. "//toolchain/diagnostics:diagnostic_emitter",
  15. "//toolchain/lex",
  16. "//toolchain/parse",
  17. "//toolchain/parse:tree",
  18. "//toolchain/source:source_buffer",
  19. "@llvm-project//llvm:Support",
  20. ],
  21. )
  22. file_test(
  23. name = "file_test",
  24. size = "small",
  25. timeout = "moderate", # Taking >60 seconds in GitHub actions
  26. srcs = ["file_test.cpp"],
  27. env = cc_env(),
  28. tests = [
  29. "//toolchain/check:testdata",
  30. "//toolchain/codegen:testdata",
  31. "//toolchain/diagnostics:testdata",
  32. "//toolchain/driver:testdata",
  33. "//toolchain/format:testdata",
  34. "//toolchain/lex:testdata",
  35. "//toolchain/lower:testdata",
  36. "//toolchain/parse:testdata",
  37. ],
  38. deps = [
  39. "//common:all_llvm_targets",
  40. "//common:error",
  41. "//testing/file_test:file_test_base",
  42. "//toolchain/driver",
  43. "@llvm-project//llvm:Support",
  44. ],
  45. )
  46. cc_library(
  47. name = "yaml_test_helpers",
  48. testonly = 1,
  49. srcs = ["yaml_test_helpers.cpp"],
  50. hdrs = ["yaml_test_helpers.h"],
  51. deps = [
  52. "//common:error",
  53. "//common:ostream",
  54. "@abseil-cpp//absl/strings",
  55. "@googletest//:gtest",
  56. "@llvm-project//llvm:Support",
  57. ],
  58. )
  59. cc_test(
  60. name = "yaml_test_helpers_test",
  61. size = "small",
  62. srcs = ["yaml_test_helpers_test.cpp"],
  63. deps = [
  64. ":yaml_test_helpers",
  65. "//testing/base:gtest_main",
  66. "@googletest//:gtest",
  67. ],
  68. )