BUILD 2.1 KB

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