]> git.proxmox.com Git - ceph.git/blame - ceph/src/jaegertracing/opentelemetry-cpp/third_party/googletest/googletest/test/googletest-filter-unittest_.cc
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / jaegertracing / opentelemetry-cpp / third_party / googletest / googletest / test / googletest-filter-unittest_.cc
CommitLineData
31f18b77
FG
1// Copyright 2005, Google Inc.
2// All rights reserved.
3//
4// Redistribution and use in source and binary forms, with or without
5// modification, are permitted provided that the following conditions are
6// met:
7//
8// * Redistributions of source code must retain the above copyright
9// notice, this list of conditions and the following disclaimer.
10// * Redistributions in binary form must reproduce the above
11// copyright notice, this list of conditions and the following disclaimer
12// in the documentation and/or other materials provided with the
13// distribution.
14// * Neither the name of Google Inc. nor the names of its
15// contributors may be used to endorse or promote products derived from
16// this software without specific prior written permission.
17//
18// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1e59de90 29
31f18b77
FG
30
31// Unit test for Google Test test filters.
32//
33// A user can specify which test(s) in a Google Test program to run via
34// either the GTEST_FILTER environment variable or the --gtest_filter
35// flag. This is used for testing such functionality.
36//
37// The program will be invoked from a Python unit test. Don't run it
38// directly.
39
40#include "gtest/gtest.h"
41
42namespace {
43
44// Test case FooTest.
45
46class FooTest : public testing::Test {
47};
48
49TEST_F(FooTest, Abc) {
50}
51
52TEST_F(FooTest, Xyz) {
53 FAIL() << "Expected failure.";
54}
55
56// Test case BarTest.
57
58TEST(BarTest, TestOne) {
59}
60
61TEST(BarTest, TestTwo) {
62}
63
64TEST(BarTest, TestThree) {
65}
66
67TEST(BarTest, DISABLED_TestFour) {
68 FAIL() << "Expected failure.";
69}
70
71TEST(BarTest, DISABLED_TestFive) {
72 FAIL() << "Expected failure.";
73}
74
75// Test case BazTest.
76
77TEST(BazTest, TestOne) {
78 FAIL() << "Expected failure.";
79}
80
81TEST(BazTest, TestA) {
82}
83
84TEST(BazTest, TestB) {
85}
86
87TEST(BazTest, DISABLED_TestC) {
88 FAIL() << "Expected failure.";
89}
90
91// Test case HasDeathTest
92
93TEST(HasDeathTest, Test1) {
94 EXPECT_DEATH_IF_SUPPORTED(exit(1), ".*");
95}
96
97// We need at least two death tests to make sure that the all death tests
98// aren't on the first shard.
99TEST(HasDeathTest, Test2) {
100 EXPECT_DEATH_IF_SUPPORTED(exit(1), ".*");
101}
102
103// Test case FoobarTest
104
105TEST(DISABLED_FoobarTest, Test1) {
106 FAIL() << "Expected failure.";
107}
108
109TEST(DISABLED_FoobarTest, DISABLED_Test2) {
110 FAIL() << "Expected failure.";
111}
112
113// Test case FoobarbazTest
114
115TEST(DISABLED_FoobarbazTest, TestA) {
116 FAIL() << "Expected failure.";
117}
118
31f18b77
FG
119class ParamTest : public testing::TestWithParam<int> {
120};
121
122TEST_P(ParamTest, TestX) {
123}
124
125TEST_P(ParamTest, TestY) {
126}
127
1e59de90
TL
128INSTANTIATE_TEST_SUITE_P(SeqP, ParamTest, testing::Values(1, 2));
129INSTANTIATE_TEST_SUITE_P(SeqQ, ParamTest, testing::Values(5, 6));
31f18b77
FG
130
131} // namespace
132
133int main(int argc, char **argv) {
134 ::testing::InitGoogleTest(&argc, argv);
135
136 return RUN_ALL_TESTS();
137}