BUILD 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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_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. "//common:check",
  39. "//common:error",
  40. "//common:exe_path",
  41. "//common:init_llvm",
  42. "//common:ostream",
  43. "//common:raw_string_ostream",
  44. "//testing/base:file_helpers",
  45. "@abseil-cpp//absl/flags:flag",
  46. "@abseil-cpp//absl/flags:parse",
  47. "@googletest//:gtest",
  48. "@llvm-project//llvm:Support",
  49. ],
  50. )
  51. file_test(
  52. name = "file_test_base_test",
  53. size = "small",
  54. srcs = ["file_test_base_test.cpp"],
  55. tests = glob(["testdata/**"]),
  56. deps = [
  57. ":file_test_base",
  58. "//common:ostream",
  59. "@googletest//:gtest",
  60. "@llvm-project//llvm:Support",
  61. ],
  62. )