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