BUILD 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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. "@abseil-cpp//absl/strings",
  48. "@googletest//:gtest",
  49. "@llvm-project//llvm:Support",
  50. ],
  51. )
  52. file_test(
  53. name = "file_test_base_test",
  54. size = "small",
  55. srcs = ["file_test_base_test.cpp"],
  56. tests = glob(["testdata/**"]),
  57. deps = [
  58. ":file_test_base",
  59. "//common:ostream",
  60. "@googletest//:gtest",
  61. "@llvm-project//llvm:Support",
  62. ],
  63. )