BUILD 2.1 KB

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