diff options
author | misterg <misterg@google.com> | 2017-08-08 19:17:56 (GMT) |
---|---|---|
committer | misterg <misterg@google.com> | 2017-08-08 19:17:56 (GMT) |
commit | 8815087cfa124b8b7f6e991189ec50a6bd439c83 (patch) | |
tree | 360be5a775004cbe6f230ad97eaaea89b32e53a6 /googletest | |
parent | aecea3842c3a0dbe74ac982b67a240e4cc466cf6 (diff) | |
download | googletest-8815087cfa124b8b7f6e991189ec50a6bd439c83.zip googletest-8815087cfa124b8b7f6e991189ec50a6bd439c83.tar.gz googletest-8815087cfa124b8b7f6e991189ec50a6bd439c83.tar.bz2 |
WIP
Diffstat (limited to 'googletest')
-rw-r--r-- | googletest/test/BUILD.bazel | 133 |
1 files changed, 133 insertions, 0 deletions
diff --git a/googletest/test/BUILD.bazel b/googletest/test/BUILD.bazel new file mode 100644 index 0000000..3281efb --- /dev/null +++ b/googletest/test/BUILD.bazel @@ -0,0 +1,133 @@ +# Copyright 2017 Google Inc. All Rights Reserved. +# Author: misterg@google.com (Gennadiy Civil) +# +# Description: +# Bazel BUILD file for googletest/test, initial revision +# +licenses(["notice"]) + +""" gtest own tests """ + +#on windows exclude gtest-tuple.h and gtest-tuple_test.cc +filegroup( + name = "win_only_test_files", + srcs = glob( + include = [ + "gtest-*.cc", + "*.h", + "googletest/include/gtest/**/*.h", + ], + exclude = [ + "googletest/src/gtest-unittest-api_test.cc", + "googletest/include/gtest/internal/gtest-tuple.h", + "gtest-tuple_test.cc", + "googletest/src/gtest-all.cc", + "gtest_all_test.cc", + "gtest-death-test_ex_test.cc", + "gtest-listener_test.cc", + "gtest-unittest-api_test.cc", + "gtest-param-test_test.cc", + ], + ), +) + +filegroup( + name = "default_test_files", + srcs = glob( + include = [ + "gtest-*.cc", + "*.h", + "googletest/include/gtest/**/*.h", + ], + exclude = [ + "googletest/src/gtest-unittest-api_test.cc", + "googletest/src/gtest-all.cc", + "gtest_all_test.cc", + "gtest-death-test_ex_test.cc", + "gtest-listener_test.cc", + "gtest-unittest-api_test.cc", + "gtest-param-test_test.cc", + ], + ), +) + +cc_test( + name = "gtest_all_test", + size = "small", + srcs = select({ + "//:win": [":win_only_test_files"], + "//conditions:default": [":default_test_files"], + }), + copts = select({ + "//:win": ["-DGTEST_USE_OWN_TR1_TUPLE=0"], + "//conditions:default": ["-DGTEST_USE_OWN_TR1_TUPLE=1"], + }), + includes = [ + "googletest", + "googletest/include", + "googletest/include/internal", + "googletest/test", + ], + linkopts = select({ + "//:win": [], + "//conditions:default": [ + "-pthread", + ], + }), + deps = ["//:gtest_main"], +) + +#These googletest tests have their own main() +cc_test( + name = "gtest-listener_test", + size = "small", + srcs = [ + "gtest-listener_test.cc", + ], + deps = [ + "//:gtest_main", + ], +) + +cc_test( + name = "gtest-unittest-api_test", + size = "small", + srcs = [ + "gtest-unittest-api_test.cc", + ], + deps = [ + "//:gtest_main", + ], +) + +cc_test( + name = "gtest-param-test_test", + size = "small", + srcs = [ + "gtest-param-test2_test.cc", + "gtest-param-test_test.cc", + "gtest-param-test_test.h", + ], + deps = [ + "//:gtest_main", + ], +) + +#Verifies interaction of death tests and exceptions. +cc_test( + name = "gtest-death-test_ex_catch_test", + size = "small", + srcs = ["gtest-death-test_ex_test.cc"], + copts = ["-fexceptions"], + defines = ["GTEST_ENABLE_CATCH_EXCEPTIONS_=0"], + deps = ["//:gtest_ex"], +) + +cc_test( + name = "gtest-death-test_ex_nocatch_test", + size = "small", + srcs = ["gtest-death-test_ex_test.cc"], + copts = ["-fexceptions"], + defines = ["GTEST_ENABLE_CATCH_EXCEPTIONS_=1"], + deps = ["//:gtest_ex"], +) |