BUILD 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. #
  5. # Trivial, single-file testing libraries. More complex libraries should get
  6. # their own directory.
  7. load("@rules_cc//cc:defs.bzl", "cc_library", "cc_test")
  8. package(default_visibility = ["//visibility:public"])
  9. # This does extra initialization on top of googletest's gtest_main in order to
  10. # provide stack traces on unexpected exits, because we normally rely on LLVM
  11. # code for that.
  12. #
  13. # This replaces "@com_google_googletest//:gtest_main";
  14. # "@com_google_googletest//:gtest" should still be used directly.
  15. cc_library(
  16. name = "gtest_main",
  17. testonly = 1,
  18. srcs = ["gtest_main.cpp"],
  19. deps = [
  20. "@com_google_googletest//:gtest",
  21. "@llvm-project//llvm:Support",
  22. ],
  23. )
  24. cc_library(
  25. name = "test_raw_ostream",
  26. testonly = 1,
  27. hdrs = ["test_raw_ostream.h"],
  28. deps = [
  29. "//common:ostream",
  30. "@com_google_googletest//:gtest",
  31. "@llvm-project//llvm:Support",
  32. ],
  33. )
  34. cc_test(
  35. name = "test_raw_ostream_test",
  36. size = "small",
  37. srcs = ["test_raw_ostream_test.cpp"],
  38. deps = [
  39. ":test_raw_ostream",
  40. "//testing/base:gtest_main",
  41. "@com_google_googletest//:gtest",
  42. ],
  43. )