| OLD | NEW |
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 import("//build_overrides/gtest.gni") | 5 import("//build_overrides/gtest.gni") |
| 6 | 6 |
| 7 config("gtest_config") { | 7 config("gtest_config") { |
| 8 visibility = [ | 8 visibility = [ |
| 9 ":*", | 9 ":*", |
| 10 "//testing/gmock:*", # gmock also shares this config. | 10 "//testing/gmock:*", # gmock also shares this config. |
| 11 ] | 11 ] |
| 12 | 12 |
| 13 defines = [ | 13 defines = [ |
| 14 # In order to allow regex matches in gtest to be shared between Windows | 14 # In order to allow regex matches in gtest to be shared between Windows |
| 15 # and other systems, we tell gtest to always use it's internal engine. | 15 # and other systems, we tell gtest to always use it's internal engine. |
| 16 "GTEST_HAS_POSIX_RE=0", | 16 "GTEST_HAS_POSIX_RE=0", |
| 17 | 17 |
| 18 # Chrome doesn't support / require C++11, yet. | 18 # Chrome doesn't support / require C++11, yet. |
| 19 "GTEST_LANG_CXX11=0", | 19 "GTEST_LANG_CXX11=0", |
| 20 ] | 20 ] |
| 21 | 21 |
| 22 # Gtest headers need to be able to find themselves. | 22 # Gtest headers need to be able to find themselves. |
| 23 include_dirs = [ "include" ] | 23 include_dirs = [ "../third_party/googletest/googletest/include" ] |
| 24 | 24 |
| 25 if (is_win) { | 25 if (is_win) { |
| 26 cflags = [ "/wd4800" ] # Unused variable warning. | 26 cflags = [ "/wd4800" ] # Unused variable warning. |
| 27 } | 27 } |
| 28 | 28 |
| 29 if (is_posix) { | 29 if (is_posix) { |
| 30 defines += [ | 30 defines += [ |
| 31 # gtest isn't able to figure out when RTTI is disabled for gcc | 31 # gtest isn't able to figure out when RTTI is disabled for gcc |
| 32 # versions older than 4.3.2, and assumes it's enabled. Our Mac | 32 # versions older than 4.3.2, and assumes it's enabled. Our Mac |
| 33 # and Linux builds disable RTTI, and cannot guarantee that the | 33 # and Linux builds disable RTTI, and cannot guarantee that the |
| (...skipping 19 matching lines...) Expand all Loading... |
| 53 "GTEST_HAS_TR1_TUPLE=1", | 53 "GTEST_HAS_TR1_TUPLE=1", |
| 54 ] | 54 ] |
| 55 } | 55 } |
| 56 } | 56 } |
| 57 | 57 |
| 58 config("gtest_direct_config") { | 58 config("gtest_direct_config") { |
| 59 visibility = [ ":*" ] | 59 visibility = [ ":*" ] |
| 60 defines = [ "UNIT_TEST" ] | 60 defines = [ "UNIT_TEST" ] |
| 61 } | 61 } |
| 62 | 62 |
| 63 config("gtest_warnings") { | |
| 64 if (is_win && is_clang) { | |
| 65 # The Mutex constructor initializer list in gtest-port.cc is incorrectly | |
| 66 # ordered. See | |
| 67 # https://groups.google.com/d/msg/googletestframework/S5uSV8L2TX8/U1FaTDa6J6
sJ. | |
| 68 cflags = [ "-Wno-reorder" ] | |
| 69 } | |
| 70 } | |
| 71 | |
| 72 static_library("gtest") { | 63 static_library("gtest") { |
| 73 testonly = true | 64 testonly = true |
| 74 sources = [ | 65 sources = [ |
| 66 "../third_party/googletest/googletest/include/gtest/gtest-death-test.h", |
| 67 "../third_party/googletest/googletest/include/gtest/gtest-message.h", |
| 68 "../third_party/googletest/googletest/include/gtest/gtest-param-test.h", |
| 69 "../third_party/googletest/googletest/include/gtest/gtest-printers.h", |
| 70 "../third_party/googletest/googletest/include/gtest/gtest-spi.h", |
| 71 "../third_party/googletest/googletest/include/gtest/gtest-test-part.h", |
| 72 "../third_party/googletest/googletest/include/gtest/gtest-typed-test.h", |
| 73 "../third_party/googletest/googletest/include/gtest/gtest.h", |
| 74 "../third_party/googletest/googletest/include/gtest/gtest_pred_impl.h", |
| 75 "../third_party/googletest/googletest/include/gtest/internal/gtest-death-tes
t-internal.h", |
| 76 "../third_party/googletest/googletest/include/gtest/internal/gtest-filepath.
h", |
| 77 "../third_party/googletest/googletest/include/gtest/internal/gtest-internal.
h", |
| 78 "../third_party/googletest/googletest/include/gtest/internal/gtest-linked_pt
r.h", |
| 79 "../third_party/googletest/googletest/include/gtest/internal/gtest-param-uti
l-generated.h", |
| 80 "../third_party/googletest/googletest/include/gtest/internal/gtest-param-uti
l.h", |
| 81 "../third_party/googletest/googletest/include/gtest/internal/gtest-port.h", |
| 82 "../third_party/googletest/googletest/include/gtest/internal/gtest-string.h"
, |
| 83 "../third_party/googletest/googletest/include/gtest/internal/gtest-tuple.h", |
| 84 "../third_party/googletest/googletest/include/gtest/internal/gtest-type-util
.h", |
| 75 "include/gtest/gtest-death-test.h", | 85 "include/gtest/gtest-death-test.h", |
| 76 "include/gtest/gtest-message.h", | 86 "include/gtest/gtest-message.h", |
| 77 "include/gtest/gtest-param-test.h", | 87 "include/gtest/gtest-param-test.h", |
| 78 "include/gtest/gtest-printers.h", | 88 "include/gtest/gtest-printers.h", |
| 79 "include/gtest/gtest-spi.h", | 89 "include/gtest/gtest-spi.h", |
| 80 "include/gtest/gtest-test-part.h", | 90 "include/gtest/gtest-test-part.h", |
| 81 "include/gtest/gtest-typed-test.h", | 91 "include/gtest/gtest-typed-test.h", |
| 82 "include/gtest/gtest.h", | 92 "include/gtest/gtest.h", |
| 83 "include/gtest/gtest_pred_impl.h", | 93 "include/gtest/gtest_pred_impl.h", |
| 84 "include/gtest/internal/gtest-death-test-internal.h", | 94 "include/gtest/internal/gtest-death-test-internal.h", |
| 85 "include/gtest/internal/gtest-filepath.h", | 95 "include/gtest/internal/gtest-filepath.h", |
| 86 "include/gtest/internal/gtest-internal.h", | 96 "include/gtest/internal/gtest-internal.h", |
| 87 "include/gtest/internal/gtest-linked_ptr.h", | 97 "include/gtest/internal/gtest-linked_ptr.h", |
| 88 "include/gtest/internal/gtest-param-util-generated.h", | 98 "include/gtest/internal/gtest-param-util-generated.h", |
| 89 "include/gtest/internal/gtest-param-util.h", | 99 "include/gtest/internal/gtest-param-util.h", |
| 90 "include/gtest/internal/gtest-port.h", | 100 "include/gtest/internal/gtest-port.h", |
| 91 "include/gtest/internal/gtest-string.h", | 101 "include/gtest/internal/gtest-string.h", |
| 92 "include/gtest/internal/gtest-tuple.h", | 102 "include/gtest/internal/gtest-tuple.h", |
| 93 "include/gtest/internal/gtest-type-util.h", | 103 "include/gtest/internal/gtest-type-util.h", |
| 94 | 104 |
| 95 #"gtest/src/gtest-all.cc", # Not needed by our build. | 105 #"gtest/src/gtest-all.cc", # Not needed by our build. |
| 96 "src/gtest-death-test.cc", | 106 "../third_party/googletest/googletest/src/gtest-death-test.cc", |
| 97 "src/gtest-filepath.cc", | 107 "../third_party/googletest/googletest/src/gtest-filepath.cc", |
| 98 "src/gtest-internal-inl.h", | 108 "../third_party/googletest/googletest/src/gtest-internal-inl.h", |
| 99 "src/gtest-port.cc", | 109 "../third_party/googletest/googletest/src/gtest-port.cc", |
| 100 "src/gtest-printers.cc", | 110 "../third_party/googletest/googletest/src/gtest-printers.cc", |
| 101 "src/gtest-test-part.cc", | 111 "../third_party/googletest/googletest/src/gtest-test-part.cc", |
| 102 "src/gtest-typed-test.cc", | 112 "../third_party/googletest/googletest/src/gtest-typed-test.cc", |
| 103 "src/gtest.cc", | 113 "../third_party/googletest/googletest/src/gtest.cc", |
| 104 ] | 114 ] |
| 105 | 115 |
| 106 if (gtest_include_multiprocess) { | 116 if (gtest_include_multiprocess) { |
| 107 sources += [ | 117 sources += [ |
| 108 "../multiprocess_func_list.cc", | 118 "../multiprocess_func_list.cc", |
| 109 "../multiprocess_func_list.h", | 119 "../multiprocess_func_list.h", |
| 110 ] | 120 ] |
| 111 } | 121 } |
| 112 | 122 |
| 113 if (gtest_include_platform_test) { | 123 if (gtest_include_platform_test) { |
| (...skipping 14 matching lines...) Expand all Loading... |
| 128 set_sources_assignment_filter(sources_assignment_filter) | 138 set_sources_assignment_filter(sources_assignment_filter) |
| 129 } | 139 } |
| 130 | 140 |
| 131 if (is_ios && gtest_include_ios_coverage) { | 141 if (is_ios && gtest_include_ios_coverage) { |
| 132 sources += [ | 142 sources += [ |
| 133 "../coverage_util_ios.cc", | 143 "../coverage_util_ios.cc", |
| 134 "../coverage_util_ios.h", | 144 "../coverage_util_ios.h", |
| 135 ] | 145 ] |
| 136 } | 146 } |
| 137 | 147 |
| 138 include_dirs = [ "." ] | 148 include_dirs = [ "../third_party/googletest/googletest" ] |
| 139 | 149 |
| 140 all_dependent_configs = [ ":gtest_config" ] | 150 all_dependent_configs = [ ":gtest_config" ] |
| 141 public_configs = [ ":gtest_direct_config" ] | 151 public_configs = [ ":gtest_direct_config" ] |
| 142 | 152 |
| 143 configs -= [ "//build/config/compiler:chromium_code" ] | 153 configs -= [ "//build/config/compiler:chromium_code" ] |
| 144 configs += [ | 154 configs += [ "//build/config/compiler:no_chromium_code" ] |
| 145 "//build/config/compiler:no_chromium_code", | |
| 146 | |
| 147 # Must be after no_chromium_code for warning flags to be ordered correctly. | |
| 148 ":gtest_warnings", | |
| 149 ] | |
| 150 } | 155 } |
| 151 | 156 |
| 152 source_set("gtest_main") { | 157 source_set("gtest_main") { |
| 153 testonly = true | 158 testonly = true |
| 154 sources = [ | 159 sources = [ |
| 155 "src/gtest_main.cc", | 160 "../third_party/googletest/googletest/src/gtest_main.cc", |
| 156 ] | 161 ] |
| 157 deps = [ | 162 deps = [ |
| 158 ":gtest", | 163 ":gtest", |
| 159 ] | 164 ] |
| 160 } | 165 } |
| OLD | NEW |