BUILD 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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:build_data",
  41. "//common:check",
  42. "//common:error",
  43. "//common:exe_path",
  44. "//common:find",
  45. "//common:init_llvm",
  46. "//common:ostream",
  47. "//common:pretty_stack_trace_function",
  48. "//common:raw_string_ostream",
  49. "//common:set",
  50. "//testing/base:file_helpers",
  51. "@abseil-cpp//absl/flags:flag",
  52. "@abseil-cpp//absl/flags:parse",
  53. "@abseil-cpp//absl/strings",
  54. "@googletest//:gtest",
  55. "@llvm-project//llvm:Support",
  56. ],
  57. )
  58. file_test(
  59. name = "file_test_base_test",
  60. size = "small",
  61. srcs = ["file_test_base_test.cpp"],
  62. data = glob(["testdata/include_files/**"]),
  63. tests = glob(
  64. ["testdata/**"],
  65. exclude = ["testdata/include_files/**"],
  66. ),
  67. deps = [
  68. ":file_test_base",
  69. "//common:ostream",
  70. "@googletest//:gtest",
  71. "@llvm-project//llvm:Support",
  72. ],
  73. )
  74. # Note this is separate from the implementation; see the .h file.
  75. cc_library(
  76. name = "manifest",
  77. testonly = 1,
  78. hdrs = ["manifest.h"],
  79. deps = ["@llvm-project//llvm:Support"],
  80. )
  81. # Used through `file_test` in rules.bzl.
  82. cc_library(
  83. name = "manifest_impl",
  84. testonly = 1,
  85. srcs = ["manifest.cpp"],
  86. deps = [":manifest"],
  87. )