BUILD 2.0 KB

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