BUILD 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. srcs = ["test_raw_ostream_test.cpp"],
  37. deps = [
  38. ":test_raw_ostream",
  39. "//testing/base:gtest_main",
  40. "@com_google_googletest//:gtest",
  41. ],
  42. )