BUILD 2.6 KB

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