1# Copyright (C) 2018. Huawei Technologies Co., Ltd. All rights reserved. 2# Use of this source code is governed by a BSD-style license that can be 3# found in the LICENSE file. 4 5config("gtest_private_config") { 6 visibility = [ ":*" ] 7 include_dirs = [ "googletest" ] 8} 9 10config("gtest_config") { 11 include_dirs = [ "googletest/include" ] 12} 13 14static_library("gtest") { 15 testonly = true 16 public = [ 17 "googletest/include/gtest/gtest.h", 18 "googletest/include/gtest/gtest-spi.h", 19 ] 20 sources = [ 21 "googletest/include/gtest/gtest-death-test.h", 22 "googletest/include/gtest/gtest-message.h", 23 "googletest/include/gtest/gtest-param-test.h", 24 "googletest/include/gtest/gtest-printers.h", 25 "googletest/include/gtest/gtest-test-part.h", 26 "googletest/include/gtest/gtest-typed-test.h", 27 "googletest/include/gtest/gtest_pred_impl.h", 28 "googletest/include/gtest/gtest_prod.h", 29 "googletest/include/gtest/internal/custom/gtest-port.h", 30 "googletest/include/gtest/internal/custom/gtest-printers.h", 31 "googletest/include/gtest/internal/custom/gtest.h", 32 "googletest/include/gtest/internal/gtest-death-test-internal.h", 33 "googletest/include/gtest/internal/gtest-filepath.h", 34 "googletest/include/gtest/internal/gtest-internal.h", 35 "googletest/include/gtest/internal/gtest-linked_ptr.h", 36 "googletest/include/gtest/internal/gtest-param-util-generated.h", 37 "googletest/include/gtest/internal/gtest-param-util.h", 38 "googletest/include/gtest/internal/gtest-port-arch.h", 39 "googletest/include/gtest/internal/gtest-port.h", 40 "googletest/include/gtest/internal/gtest-string.h", 41 "googletest/include/gtest/internal/gtest-tuple.h", 42 "googletest/include/gtest/internal/gtest-type-util.h", 43 "googletest/include/gtest/hwext/gtest-ext.h", 44 "googletest/include/gtest/hwext/gtest-filter.h", 45 "googletest/include/gtest/hwext/gtest-tag.h", 46 "googletest/include/gtest/hwext/utils.h", 47 "googletest/src/gtest-all.cc", 48 "googletest/src/gtest-death-test.cc", 49 "googletest/src/gtest-filepath.cc", 50 "googletest/src/gtest-internal-inl.h", 51 "googletest/src/gtest-port.cc", 52 "googletest/src/gtest-printers.cc", 53 "googletest/src/gtest-test-part.cc", 54 "googletest/src/gtest-typed-test.cc", 55 "googletest/src/gtest.cc", 56 "googletest/src/hwext/gtest-ext.cc", 57 "googletest/src/hwext/gtest-filter.cc", 58 "googletest/src/hwext/gtest-tag.cc", 59 "googletest/src/hwext/gtest-utils.cc", 60 ] 61 sources -= [ "googletest/src/gtest-all.cc" ] 62 public_configs = [ ":gtest_config" ] 63 configs += [ ":gtest_private_config" ] 64 configs -= ["//build/config/coverage:default_coverage"] 65} 66 67static_library("gtest_main") { 68 testonly = true 69 sources = [ 70 "googletest/src/gtest_main.cc", 71 ] 72 public_deps = [ 73 ":gtest", 74 ] 75 configs -= ["//build/config/coverage:default_coverage"] 76} 77 78 79config("gmock_private_config") { 80 visibility = [ ":*" ] 81 include_dirs = [ "googlemock" ] 82} 83 84config("gmock_config") { 85 include_dirs = [ "googlemock/include" ] 86 87 cflags_cc = [ 88 # The MOCK_METHODn() macros do not specify "override", which triggers this 89 # warning in users: "error: 'Method' overrides a member function but is not 90 # marked 'override' [-Werror,-Winconsistent-missing-override]". Suppress 91 # these warnings until https://github.com/google/googletest/issues/533 is 92 # fixed. 93 "-Wno-inconsistent-missing-override", 94 ] 95} 96 97static_library("gmock") { 98 testonly = true 99 public = [ 100 "googlemock/include/gmock/gmock.h", 101 ] 102 sources = [ 103 "googlemock/include/gmock/gmock-actions.h", 104 "googlemock/include/gmock/gmock-cardinalities.h", 105 "googlemock/include/gmock/gmock-generated-actions.h", 106 "googlemock/include/gmock/gmock-generated-function-mockers.h", 107 "googlemock/include/gmock/gmock-generated-matchers.h", 108 "googlemock/include/gmock/gmock-generated-nice-strict.h", 109 "googlemock/include/gmock/gmock-matchers.h", 110 "googlemock/include/gmock/gmock-more-actions.h", 111 "googlemock/include/gmock/gmock-more-matchers.h", 112 "googlemock/include/gmock/gmock-spec-builders.h", 113 "googlemock/include/gmock/internal/custom/gmock-generated-actions.h", 114 "googlemock/include/gmock/internal/custom/gmock-matchers.h", 115 "googlemock/include/gmock/internal/custom/gmock-port.h", 116 "googlemock/include/gmock/internal/gmock-generated-internal-utils.h", 117 "googlemock/include/gmock/internal/gmock-internal-utils.h", 118 "googlemock/include/gmock/internal/gmock-port.h", 119 "googlemock/src/gmock-all.cc", 120 "googlemock/src/gmock-cardinalities.cc", 121 "googlemock/src/gmock-internal-utils.cc", 122 "googlemock/src/gmock-matchers.cc", 123 "googlemock/src/gmock-spec-builders.cc", 124 "googlemock/src/gmock.cc", 125 ] 126 sources -= [ "googlemock/src/gmock-all.cc" ] 127 public_configs = [ ":gmock_config" ] 128 configs += [ ":gmock_private_config" ] 129 configs -= ["//build/config/coverage:default_coverage"] 130 deps = [ 131 ":gtest", 132 ] 133} 134 135static_library("gmock_main") { 136 testonly = true 137 sources = [ 138 "googlemock/src/gmock_main.cc", 139 ] 140 public_deps = [ 141 ":gmock", 142 ":gtest", 143 ] 144 configs -= ["//build/config/coverage:default_coverage"] 145} 146 147