131c75014Sopenharmony_ci# Copyright (c) 2020-2021 Huawei Device Co., Ltd. 231c75014Sopenharmony_ci# Licensed under the Apache License, Version 2.0 (the "License"); 331c75014Sopenharmony_ci# you may not use this file except in compliance with the License. 431c75014Sopenharmony_ci# You may obtain a copy of the License at 531c75014Sopenharmony_ci# 631c75014Sopenharmony_ci# http://www.apache.org/licenses/LICENSE-2.0 731c75014Sopenharmony_ci# 831c75014Sopenharmony_ci# Unless required by applicable law or agreed to in writing, software 931c75014Sopenharmony_ci# distributed under the License is distributed on an "AS IS" BASIS, 1031c75014Sopenharmony_ci# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1131c75014Sopenharmony_ci# See the License for the specific language governing permissions and 1231c75014Sopenharmony_ci# limitations under the License. 1331c75014Sopenharmony_ci 1431c75014Sopenharmony_ciconfig("hcpptest_private_config") { 1531c75014Sopenharmony_ci visibility = [ ":*" ] 1631c75014Sopenharmony_ci include_dirs = [ "//third_party/googletest/googletest" ] 1731c75014Sopenharmony_ci ldflags = [ "-lstdc++" ] 1831c75014Sopenharmony_ci cflags_cc = [ "-std=c++17" ] 1931c75014Sopenharmony_ci cflags = [ "-std=c++17" ] 2031c75014Sopenharmony_ci} 2131c75014Sopenharmony_ci 2231c75014Sopenharmony_ciconfig("hcpptest_config") { 2331c75014Sopenharmony_ci include_dirs = [ "//third_party/googletest/googletest/include" ] 2431c75014Sopenharmony_ci cflags_cc = [ "-std=c++17" ] 2531c75014Sopenharmony_ci cflags = [ "-std=c++17" ] 2631c75014Sopenharmony_ci ldflags = [ 2731c75014Sopenharmony_ci "-lstdc++", 2831c75014Sopenharmony_ci "-Wl,-rpath=./lib", 2931c75014Sopenharmony_ci "-lm", 3031c75014Sopenharmony_ci ] 3131c75014Sopenharmony_ci} 3231c75014Sopenharmony_ci 3331c75014Sopenharmony_cistatic_library("hcpptest") { 3431c75014Sopenharmony_ci public = [ 3531c75014Sopenharmony_ci "//third_party/googletest/googletest/include/gtest/gtest-spi.h", 3631c75014Sopenharmony_ci "//third_party/googletest/googletest/include/gtest/gtest.h", 3731c75014Sopenharmony_ci ] 3831c75014Sopenharmony_ci sources = [ 3931c75014Sopenharmony_ci "//third_party/googletest/googletest/include/gtest/gtest-death-test.h", 4031c75014Sopenharmony_ci "//third_party/googletest/googletest/include/gtest/gtest-message.h", 4131c75014Sopenharmony_ci "//third_party/googletest/googletest/include/gtest/gtest-param-test.h", 4231c75014Sopenharmony_ci "//third_party/googletest/googletest/include/gtest/gtest-printers.h", 4331c75014Sopenharmony_ci "//third_party/googletest/googletest/include/gtest/gtest-test-part.h", 4431c75014Sopenharmony_ci "//third_party/googletest/googletest/include/gtest/gtest-typed-test.h", 4531c75014Sopenharmony_ci "//third_party/googletest/googletest/include/gtest/gtest_pred_impl.h", 4631c75014Sopenharmony_ci "//third_party/googletest/googletest/include/gtest/gtest_prod.h", 4731c75014Sopenharmony_ci "//third_party/googletest/googletest/include/gtest/hwext/gtest-ext.h", 4831c75014Sopenharmony_ci "//third_party/googletest/googletest/include/gtest/hwext/gtest-filter.h", 4931c75014Sopenharmony_ci "//third_party/googletest/googletest/include/gtest/hwext/gtest-tag.h", 5031c75014Sopenharmony_ci "//third_party/googletest/googletest/include/gtest/hwext/utils.h", 5131c75014Sopenharmony_ci "//third_party/googletest/googletest/include/gtest/internal/custom/gtest-port.h", 5231c75014Sopenharmony_ci "//third_party/googletest/googletest/include/gtest/internal/custom/gtest-printers.h", 5331c75014Sopenharmony_ci "//third_party/googletest/googletest/include/gtest/internal/custom/gtest.h", 5431c75014Sopenharmony_ci "//third_party/googletest/googletest/include/gtest/internal/gtest-death-test-internal.h", 5531c75014Sopenharmony_ci "//third_party/googletest/googletest/include/gtest/internal/gtest-filepath.h", 5631c75014Sopenharmony_ci "//third_party/googletest/googletest/include/gtest/internal/gtest-internal.h", 5731c75014Sopenharmony_ci "//third_party/googletest/googletest/include/gtest/internal/gtest-linked_ptr.h", 5831c75014Sopenharmony_ci "//third_party/googletest/googletest/include/gtest/internal/gtest-param-util-generated.h", 5931c75014Sopenharmony_ci "//third_party/googletest/googletest/include/gtest/internal/gtest-param-util.h", 6031c75014Sopenharmony_ci "//third_party/googletest/googletest/include/gtest/internal/gtest-port-arch.h", 6131c75014Sopenharmony_ci "//third_party/googletest/googletest/include/gtest/internal/gtest-port.h", 6231c75014Sopenharmony_ci "//third_party/googletest/googletest/include/gtest/internal/gtest-string.h", 6331c75014Sopenharmony_ci "//third_party/googletest/googletest/include/gtest/internal/gtest-tuple.h", 6431c75014Sopenharmony_ci "//third_party/googletest/googletest/include/gtest/internal/gtest-type-util.h", 6531c75014Sopenharmony_ci "//third_party/googletest/googletest/src/gtest-assertion-result.cc", 6631c75014Sopenharmony_ci "//third_party/googletest/googletest/src/gtest-death-test.cc", 6731c75014Sopenharmony_ci "//third_party/googletest/googletest/src/gtest-filepath.cc", 6831c75014Sopenharmony_ci "//third_party/googletest/googletest/src/gtest-internal-inl.h", 6931c75014Sopenharmony_ci "//third_party/googletest/googletest/src/gtest-port.cc", 7031c75014Sopenharmony_ci "//third_party/googletest/googletest/src/gtest-printers.cc", 7131c75014Sopenharmony_ci "//third_party/googletest/googletest/src/gtest-test-part.cc", 7231c75014Sopenharmony_ci "//third_party/googletest/googletest/src/gtest-typed-test.cc", 7331c75014Sopenharmony_ci "//third_party/googletest/googletest/src/gtest.cc", 7431c75014Sopenharmony_ci "//third_party/googletest/googletest/src/hwext/gtest-ext.cc", 7531c75014Sopenharmony_ci "//third_party/googletest/googletest/src/hwext/gtest-filter.cc", 7631c75014Sopenharmony_ci "//third_party/googletest/googletest/src/hwext/gtest-tag.cc", 7731c75014Sopenharmony_ci "//third_party/googletest/googletest/src/hwext/gtest-utils.cc", 7831c75014Sopenharmony_ci ] 7931c75014Sopenharmony_ci public_configs = [ ":hcpptest_config" ] 8031c75014Sopenharmony_ci configs += [ ":hcpptest_private_config" ] 8131c75014Sopenharmony_ci defines = [ "GTEST_HAS_CLONE=0" ] 8231c75014Sopenharmony_ci} 8331c75014Sopenharmony_ci 8431c75014Sopenharmony_cistatic_library("hcpptest_main") { 8531c75014Sopenharmony_ci sources = [ "//third_party/googletest/googletest/src/gtest_main.cc" ] 8631c75014Sopenharmony_ci public_deps = [ ":hcpptest" ] 8731c75014Sopenharmony_ci} 8831c75014Sopenharmony_ci 8931c75014Sopenharmony_ciconfig("gmock_private_config") { 9031c75014Sopenharmony_ci visibility = [ ":*" ] 9131c75014Sopenharmony_ci include_dirs = [ "//third_party/googletest/googlemock" ] 9231c75014Sopenharmony_ci} 9331c75014Sopenharmony_ci 9431c75014Sopenharmony_ciconfig("gmock_config") { 9531c75014Sopenharmony_ci include_dirs = [ "//third_party/googletest/googlemock/include" ] 9631c75014Sopenharmony_ci 9731c75014Sopenharmony_ci cflags_cc = [ 9831c75014Sopenharmony_ci # The MOCK_METHODn() macros do not specify "override", which triggers this 9931c75014Sopenharmony_ci # warning in users: "error: 'Method' overrides a member function but is not 10031c75014Sopenharmony_ci # marked 'override' [-Werror,-Winconsistent-missing-override]". Suppress 10131c75014Sopenharmony_ci # these warnings until https://github.com/google/googletest/issues/533 is 10231c75014Sopenharmony_ci # fixed. 10331c75014Sopenharmony_ci "-Wno-inconsistent-missing-override", 10431c75014Sopenharmony_ci ] 10531c75014Sopenharmony_ci} 10631c75014Sopenharmony_ci 10731c75014Sopenharmony_cistatic_library("gmock") { 10831c75014Sopenharmony_ci public = [ "//third_party/googletest/googlemock/include/gmock/gmock.h" ] 10931c75014Sopenharmony_ci sources = [ 11031c75014Sopenharmony_ci "//third_party/googletest/googlemock/include/gmock/gmock-actions.h", 11131c75014Sopenharmony_ci "//third_party/googletest/googlemock/include/gmock/gmock-cardinalities.h", 11231c75014Sopenharmony_ci "//third_party/googletest/googlemock/include/gmock/gmock-generated-actions.h", 11331c75014Sopenharmony_ci "//third_party/googletest/googlemock/include/gmock/gmock-generated-function-mockers.h", 11431c75014Sopenharmony_ci "//third_party/googletest/googlemock/include/gmock/gmock-generated-matchers.h", 11531c75014Sopenharmony_ci "//third_party/googletest/googlemock/include/gmock/gmock-generated-nice-strict.h", 11631c75014Sopenharmony_ci "//third_party/googletest/googlemock/include/gmock/gmock-matchers.h", 11731c75014Sopenharmony_ci "//third_party/googletest/googlemock/include/gmock/gmock-more-actions.h", 11831c75014Sopenharmony_ci "//third_party/googletest/googlemock/include/gmock/gmock-more-matchers.h", 11931c75014Sopenharmony_ci "//third_party/googletest/googlemock/include/gmock/gmock-spec-builders.h", 12031c75014Sopenharmony_ci "//third_party/googletest/googlemock/include/gmock/internal/custom/gmock-generated-actions.h", 12131c75014Sopenharmony_ci "//third_party/googletest/googlemock/include/gmock/internal/custom/gmock-matchers.h", 12231c75014Sopenharmony_ci "//third_party/googletest/googlemock/include/gmock/internal/custom/gmock-port.h", 12331c75014Sopenharmony_ci "//third_party/googletest/googlemock/include/gmock/internal/gmock-generated-internal-utils.h", 12431c75014Sopenharmony_ci "//third_party/googletest/googlemock/include/gmock/internal/gmock-internal-utils.h", 12531c75014Sopenharmony_ci "//third_party/googletest/googlemock/include/gmock/internal/gmock-port.h", 12631c75014Sopenharmony_ci "//third_party/googletest/googlemock/src/gmock-cardinalities.cc", 12731c75014Sopenharmony_ci "//third_party/googletest/googlemock/src/gmock-internal-utils.cc", 12831c75014Sopenharmony_ci "//third_party/googletest/googlemock/src/gmock-matchers.cc", 12931c75014Sopenharmony_ci "//third_party/googletest/googlemock/src/gmock-spec-builders.cc", 13031c75014Sopenharmony_ci "//third_party/googletest/googlemock/src/gmock.cc", 13131c75014Sopenharmony_ci ] 13231c75014Sopenharmony_ci public_configs = [ ":gmock_config" ] 13331c75014Sopenharmony_ci configs += [ ":gmock_private_config" ] 13431c75014Sopenharmony_ci deps = [ ":hcpptest" ] 13531c75014Sopenharmony_ci} 13631c75014Sopenharmony_ci 13731c75014Sopenharmony_cistatic_library("gmock_main") { 13831c75014Sopenharmony_ci sources = [ "//third_party/googletest/googlemock/src/gmock_main.cc" ] 13931c75014Sopenharmony_ci public_deps = [ 14031c75014Sopenharmony_ci ":gmock", 14131c75014Sopenharmony_ci ":hcpptest", 14231c75014Sopenharmony_ci ] 14331c75014Sopenharmony_ci} 144