Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
yangql
googletest
Commits
1dad4cf5
Unverified
Commit
1dad4cf5
authored
Aug 16, 2018
by
Gennadiy Civil
Committed by
GitHub
Aug 16, 2018
Browse files
Merge branch 'master' into fix_death_test_child_mingw_wer_issue1116
parents
10f05a62
490554aa
Changes
215
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
130 additions
and
67 deletions
+130
-67
googletest/test/googletest-uninitialized-test.py
googletest/test/googletest-uninitialized-test.py
+1
-3
googletest/test/googletest-uninitialized-test_.cc
googletest/test/googletest-uninitialized-test_.cc
+1
-2
googletest/test/gtest-typed-test2_test.cc
googletest/test/gtest-typed-test2_test.cc
+2
-3
googletest/test/gtest-typed-test_test.cc
googletest/test/gtest-typed-test_test.cc
+2
-3
googletest/test/gtest-typed-test_test.h
googletest/test/gtest-typed-test_test.h
+1
-2
googletest/test/gtest-unittest-api_test.cc
googletest/test/gtest-unittest-api_test.cc
+2
-3
googletest/test/gtest_all_test.cc
googletest/test/gtest_all_test.cc
+14
-15
googletest/test/gtest_assert_by_exception_test.cc
googletest/test/gtest_assert_by_exception_test.cc
+2
-3
googletest/test/gtest_environment_test.cc
googletest/test/gtest_environment_test.cc
+1
-2
googletest/test/gtest_help_test.py
googletest/test/gtest_help_test.py
+1
-3
googletest/test/gtest_help_test_.cc
googletest/test/gtest_help_test_.cc
+1
-2
googletest/test/gtest_main_unittest.cc
googletest/test/gtest_main_unittest.cc
+1
-2
googletest/test/gtest_no_test_unittest.cc
googletest/test/gtest_no_test_unittest.cc
+0
-2
googletest/test/gtest_premature_exit_test.cc
googletest/test/gtest_premature_exit_test.cc
+1
-2
googletest/test/gtest_prod_test.cc
googletest/test/gtest_prod_test.cc
+2
-3
googletest/test/gtest_repeat_test.cc
googletest/test/gtest_repeat_test.cc
+2
-4
googletest/test/gtest_sole_header_test.cc
googletest/test/gtest_sole_header_test.cc
+1
-2
googletest/test/gtest_stress_test.cc
googletest/test/gtest_stress_test.cc
+1
-2
googletest/test/gtest_test_macro_stack_footprint_test.cc
googletest/test/gtest_test_macro_stack_footprint_test.cc
+89
-0
googletest/test/gtest_test_utils.py
googletest/test/gtest_test_utils.py
+5
-9
No files found.
googletest/test/gtest
_
uninitialized
_
test.py
→
googletest/test/g
oogle
test
-
uninitialized
-
test.py
View file @
1dad4cf5
...
...
@@ -31,11 +31,9 @@
"""Verifies that Google Test warns the user when not initialized properly."""
__author__
=
'wan@google.com (Zhanyong Wan)'
import
gtest_test_utils
COMMAND
=
gtest_test_utils
.
GetTestExecutablePath
(
'gtest
_
uninitialized
_
test_'
)
COMMAND
=
gtest_test_utils
.
GetTestExecutablePath
(
'g
oogle
test
-
uninitialized
-
test_'
)
def
Assert
(
condition
):
...
...
googletest/test/gtest
_
uninitialized
_
test_.cc
→
googletest/test/g
oogle
test
-
uninitialized
-
test_.cc
View file @
1dad4cf5
...
...
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// Author: wan@google.com (Zhanyong Wan)
#include "gtest/gtest.h"
...
...
googletest/test/gtest-typed-test2_test.cc
View file @
1dad4cf5
...
...
@@ -26,12 +26,11 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// Author: wan@google.com (Zhanyong Wan)
#include <vector>
#include "gtest-typed-test_test.h"
#include "
test/
gtest-typed-test_test.h"
#include "gtest/gtest.h"
#if GTEST_HAS_TYPED_TEST_P
...
...
googletest/test/gtest-typed-test_test.cc
View file @
1dad4cf5
...
...
@@ -26,10 +26,9 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// Author: wan@google.com (Zhanyong Wan)
#include "gtest-typed-test_test.h"
#include "test/gtest-typed-test_test.h"
#include <set>
#include <vector>
...
...
googletest/test/gtest-typed-test_test.h
View file @
1dad4cf5
...
...
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// Author: wan@google.com (Zhanyong Wan)
#ifndef GTEST_TEST_GTEST_TYPED_TEST_TEST_H_
#define GTEST_TEST_GTEST_TYPED_TEST_TEST_H_
...
...
googletest/test/gtest-unittest-api_test.cc
View file @
1dad4cf5
...
...
@@ -25,10 +25,9 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// Author: vladl@google.com (Vlad Losev)
//
// The Google C++ Testing Framework (Google Test)
// The Google C++ Testing and Mocking Framework (Google Test)
//
// This file contains tests verifying correctness of data provided via
// UnitTest's public methods.
...
...
googletest/test/gtest_all_test.cc
View file @
1dad4cf5
...
...
@@ -26,22 +26,21 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// Author: wan@google.com (Zhanyong Wan)
//
// Tests for Google C++ Testing Framework (Google Test)
// Tests for Google C++ Testing and Mocking Framework (Google Test)
//
// Sometimes it's desirable to build most of Google Test's own tests
// by compiling a single file. This file serves this purpose.
#include "
g
test-filepath
_
test.cc"
#include "
g
test-linked
_
ptr
_
test.cc"
#include "
g
test-message
_
test.cc"
#include "
g
test-options
_
test.cc"
#include "
g
test-port
_
test.cc"
#include "gtest_pred_impl_unittest.cc"
#include "gtest_prod_test.cc"
#include "
g
test-test-part
_
test.cc"
#include "gtest-typed-test_test.cc"
#include "gtest-typed-test2_test.cc"
#include "gtest_unittest.cc"
#include "production.cc"
#include "
test/google
test-filepath
-
test.cc"
#include "
test/google
test-linked
-
ptr
-
test.cc"
#include "
test/google
test-message
-
test.cc"
#include "
test/google
test-options
-
test.cc"
#include "
test/google
test-port
-
test.cc"
#include "
test/
gtest_pred_impl_unittest.cc"
#include "
test/
gtest_prod_test.cc"
#include "
test/google
test-test-part
-
test.cc"
#include "
test/
gtest-typed-test_test.cc"
#include "
test/
gtest-typed-test2_test.cc"
#include "
test/
gtest_unittest.cc"
#include "
test/
production.cc"
googletest/test/gtest_assert_by_exception_test.cc
View file @
1dad4cf5
...
...
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// Author: wan@google.com (Zhanyong Wan)
// Tests Google Test's assert-by-exception mode with exceptions enabled.
...
...
@@ -98,7 +97,7 @@ TEST(Test, Test) {
int
kTestForContinuingTest
=
0
;
TEST
(
Test
,
Test2
)
{
// FIXME
(sokolov)
: how to force Test2 to be after Test?
// FIXME: how to force Test2 to be after Test?
kTestForContinuingTest
=
1
;
}
...
...
googletest/test/gtest_environment_test.cc
View file @
1dad4cf5
...
...
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// Author: wan@google.com (Zhanyong Wan)
//
// Tests using global test environments.
...
...
googletest/test/gtest_help_test.py
View file @
1dad4cf5
...
...
@@ -29,7 +29,7 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
"""Tests the --help flag of Google C++ Testing Framework.
"""Tests the --help flag of Google C++ Testing
and Mocking
Framework.
SYNOPSIS
gtest_help_test.py --build_dir=BUILD/DIR
...
...
@@ -37,8 +37,6 @@ SYNOPSIS
gtest_help_test.py
"""
__author__
=
'wan@google.com (Zhanyong Wan)'
import
os
import
re
import
gtest_test_utils
...
...
googletest/test/gtest_help_test_.cc
View file @
1dad4cf5
...
...
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// Author: wan@google.com (Zhanyong Wan)
// This program is meant to be run by gtest_help_test.py. Do not run
// it directly.
...
...
googletest/test/gtest_main_unittest.cc
View file @
1dad4cf5
...
...
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// Author: wan@google.com (Zhanyong Wan)
#include "gtest/gtest.h"
...
...
googletest/test/gtest_no_test_unittest.cc
View file @
1dad4cf5
...
...
@@ -29,8 +29,6 @@
// Tests that a Google Test program that has no test defined can run
// successfully.
//
// Author: wan@google.com (Zhanyong Wan)
#include "gtest/gtest.h"
...
...
googletest/test/gtest_premature_exit_test.cc
View file @
1dad4cf5
...
...
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// Author: wan@google.com (Zhanyong Wan)
//
// Tests that Google Test manipulates the premature-exit-detection
// file correctly.
...
...
googletest/test/gtest_prod_test.cc
View file @
1dad4cf5
...
...
@@ -26,10 +26,9 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// Author: wan@google.com (Zhanyong Wan)
//
// Unit test for gtest/gtest_prod.h.
// Unit test for gtest_prod.h.
#include "production.h"
#include "gtest/gtest.h"
...
...
googletest/test/gtest_repeat_test.cc
View file @
1dad4cf5
...
...
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// Author: wan@google.com (Zhanyong Wan)
// Tests the --gtest_repeat=number flag.
...
...
@@ -118,8 +117,7 @@ const int kNumberOfParamTests = 10;
class
MyParamTest
:
public
testing
::
TestWithParam
<
int
>
{};
TEST_P
(
MyParamTest
,
ShouldPass
)
{
// TODO(vladl@google.com): Make parameter value checking robust
// WRT order of tests.
// FIXME: Make parameter value checking robust WRT order of tests.
GTEST_CHECK_INT_EQ_
(
g_param_test_count
%
kNumberOfParamTests
,
GetParam
());
g_param_test_count
++
;
}
...
...
googletest/test/gtest_sole_header_test.cc
View file @
1dad4cf5
...
...
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// Author: mheule@google.com (Markus Heule)
//
// This test verifies that it's possible to use Google Test by including
// the gtest.h header file alone.
...
...
googletest/test/gtest_stress_test.cc
View file @
1dad4cf5
...
...
@@ -26,8 +26,7 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// Author: wan@google.com (Zhanyong Wan)
// Tests that SCOPED_TRACE() and various Google Test assertions can be
// used in a large number of threads concurrently.
...
...
googletest/test/gtest_test_macro_stack_footprint_test.cc
0 → 100644
View file @
1dad4cf5
// Copyright 2013, Google Inc.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
// Each TEST() expands to some static registration logic. GCC puts all
// such static initialization logic for a translation unit in a common,
// internal function. Since Google's build system restricts how much
// stack space a function can use, there's a limit on how many TEST()s
// one can put in a single C++ test file. This test ensures that a large
// number of TEST()s can be defined in the same translation unit.
#include "gtest/gtest.h"
// This macro defines 10 dummy tests.
#define TEN_TESTS_(test_case_name) \
TEST(test_case_name, T0) {} \
TEST(test_case_name, T1) {} \
TEST(test_case_name, T2) {} \
TEST(test_case_name, T3) {} \
TEST(test_case_name, T4) {} \
TEST(test_case_name, T5) {} \
TEST(test_case_name, T6) {} \
TEST(test_case_name, T7) {} \
TEST(test_case_name, T8) {} \
TEST(test_case_name, T9) {}
// This macro defines 100 dummy tests.
#define HUNDRED_TESTS_(test_case_name_prefix) \
TEN_TESTS_(test_case_name_prefix ## 0) \
TEN_TESTS_(test_case_name_prefix ## 1) \
TEN_TESTS_(test_case_name_prefix ## 2) \
TEN_TESTS_(test_case_name_prefix ## 3) \
TEN_TESTS_(test_case_name_prefix ## 4) \
TEN_TESTS_(test_case_name_prefix ## 5) \
TEN_TESTS_(test_case_name_prefix ## 6) \
TEN_TESTS_(test_case_name_prefix ## 7) \
TEN_TESTS_(test_case_name_prefix ## 8) \
TEN_TESTS_(test_case_name_prefix ## 9)
// This macro defines 1000 dummy tests.
#define THOUSAND_TESTS_(test_case_name_prefix) \
HUNDRED_TESTS_(test_case_name_prefix ## 0) \
HUNDRED_TESTS_(test_case_name_prefix ## 1) \
HUNDRED_TESTS_(test_case_name_prefix ## 2) \
HUNDRED_TESTS_(test_case_name_prefix ## 3) \
HUNDRED_TESTS_(test_case_name_prefix ## 4) \
HUNDRED_TESTS_(test_case_name_prefix ## 5) \
HUNDRED_TESTS_(test_case_name_prefix ## 6) \
HUNDRED_TESTS_(test_case_name_prefix ## 7) \
HUNDRED_TESTS_(test_case_name_prefix ## 8) \
HUNDRED_TESTS_(test_case_name_prefix ## 9)
// Ensures that we can define 1000 TEST()s in the same translation
// unit.
THOUSAND_TESTS_
(
T
)
int
main
(
int
argc
,
char
**
argv
)
{
testing
::
InitGoogleTest
(
&
argc
,
argv
);
// We don't actually need to run the dummy tests - the purpose is to
// ensure that they compile.
return
0
;
}
googletest/test/gtest_test_utils.py
View file @
1dad4cf5
...
...
@@ -27,24 +27,20 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
"""Unit test utilities for Google C++ Testing Framework."""
"""Unit test utilities for Google C++ Testing
and Mocking
Framework."""
# Suppresses the 'Import not at the top of the file' lint complaint.
# pylint: disable-msg=C6204
__author__
=
'wan@google.com (Zhanyong Wan)'
import
os
import
sys
IS_LINUX
=
os
.
name
==
'posix'
and
os
.
uname
()[
0
]
==
'Linux'
IS_WINDOWS
=
os
.
name
==
'nt'
IS_CYGWIN
=
os
.
name
==
'posix'
and
'CYGWIN'
in
os
.
uname
()[
0
]
import
atexit
import
shutil
import
tempfile
import
unittest
_test_module
=
unittest
import
unittest
as
_test_module
try
:
import
subprocess
...
...
@@ -74,7 +70,7 @@ def SetEnvVar(env_var, value):
# Here we expose a class from a particular module, depending on the
# environment. The comment suppresses the 'Invalid variable name' lint
# complaint.
TestCase
=
_test_module
.
TestCase
# pylint: disable
-msg
=C6409
TestCase
=
_test_module
.
TestCase
# pylint: disable=C6409
# Initially maps a flag to its default value. After
# _ParseAndStripGTestFlags() is called, maps a flag to its actual value.
...
...
@@ -88,7 +84,7 @@ def _ParseAndStripGTestFlags(argv):
# Suppresses the lint complaint about a global variable since we need it
# here to maintain module-wide state.
global
_gtest_flags_are_parsed
# pylint: disable
-msg
=W0603
global
_gtest_flags_are_parsed
# pylint: disable=W0603
if
_gtest_flags_are_parsed
:
return
...
...
@@ -310,7 +306,7 @@ def Main():
_ParseAndStripGTestFlags
(
sys
.
argv
)
# The tested binaries should not be writing XML output files unless the
# script explicitly instructs them to.
#
TODO(vladl@google.com)
: Move this into Subprocess when we implement
#
FIXME
: Move this into Subprocess when we implement
# passing environment into it as a parameter.
if
GTEST_OUTPUT_VAR_NAME
in
os
.
environ
:
del
os
.
environ
[
GTEST_OUTPUT_VAR_NAME
]
...
...
Prev
1
…
6
7
8
9
10
11
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment