BUILD 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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")
  5. load("rules.bzl", "file_test")
  6. package(default_visibility = ["//visibility:public"])
  7. cc_library(
  8. name = "autoupdate",
  9. testonly = 1,
  10. srcs = ["autoupdate.cpp"],
  11. hdrs = [
  12. "autoupdate.h",
  13. "line.h",
  14. ],
  15. deps = [
  16. "//common:check",
  17. "//common:ostream",
  18. "//common:raw_string_ostream",
  19. "//testing/base:file_helpers",
  20. "@abseil-cpp//absl/strings",
  21. "@abseil-cpp//absl/strings:string_view",
  22. "@llvm-project//llvm:Support",
  23. "@re2",
  24. ],
  25. )
  26. cc_library(
  27. name = "file_test_base",
  28. testonly = 1,
  29. srcs = [
  30. "file_test_base.cpp",
  31. "run_test.cpp",
  32. "run_test.h",
  33. "test_file.cpp",
  34. "test_file.h",
  35. ],
  36. hdrs = ["file_test_base.h"],
  37. deps = [
  38. ":autoupdate",
  39. ":manifest",
  40. "//common:check",
  41. "//common:error",
  42. "//common:exe_path",
  43. "//common:find",
  44. "//common:init_llvm",
  45. "//common:ostream",
  46. "//common:raw_string_ostream",
  47. "//testing/base:file_helpers",
  48. "@abseil-cpp//absl/flags:flag",
  49. "@abseil-cpp//absl/flags:parse",
  50. "@abseil-cpp//absl/strings",
  51. "@googletest//:gtest",
  52. "@llvm-project//llvm:Support",
  53. ],
  54. )
  55. file_test(
  56. name = "file_test_base_test",
  57. size = "small",
  58. srcs = ["file_test_base_test.cpp"],
  59. tests = glob(["testdata/**"]),
  60. deps = [
  61. ":file_test_base",
  62. "//common:ostream",
  63. "@googletest//:gtest",
  64. "@llvm-project//llvm:Support",
  65. ],
  66. )
  67. # Note this is separate from the implementation; see the .h file.
  68. cc_library(
  69. name = "manifest",
  70. testonly = 1,
  71. hdrs = ["manifest.h"],
  72. deps = ["@llvm-project//llvm:Support"],
  73. )
  74. # Used through `file_test` in rules.bzl.
  75. cc_library(
  76. name = "manifest_impl",
  77. testonly = 1,
  78. srcs = ["manifest.cpp"],
  79. deps = [":manifest"],
  80. )