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
21cf8360
Unverified
Commit
21cf8360
authored
Jan 24, 2018
by
Gennadiy Civil
Committed by
GitHub
Jan 24, 2018
Browse files
Merge pull request #1418 from gennadiycivil/master
Many code merge/upstream changes
parents
ab9c44cc
06c3cce8
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
47 additions
and
32 deletions
+47
-32
googletest/src/gtest_main.cc
googletest/src/gtest_main.cc
+1
-1
googletest/test/gtest-param-test2_test.cc
googletest/test/gtest-param-test2_test.cc
+1
-1
googletest/test/gtest-printers_test.cc
googletest/test/gtest-printers_test.cc
+4
-4
googletest/test/gtest-typed-test2_test.cc
googletest/test/gtest-typed-test2_test.cc
+1
-1
googletest/test/gtest-typed-test_test.cc
googletest/test/gtest-typed-test_test.cc
+1
-1
googletest/test/gtest_break_on_failure_unittest.py
googletest/test/gtest_break_on_failure_unittest.py
+1
-3
googletest/test/gtest_catch_exceptions_test.py
googletest/test/gtest_catch_exceptions_test.py
+0
-2
googletest/test/gtest_color_test.py
googletest/test/gtest_color_test.py
+1
-1
googletest/test/gtest_env_var_test.py
googletest/test/gtest_env_var_test.py
+2
-2
googletest/test/gtest_list_tests_unittest.py
googletest/test/gtest_list_tests_unittest.py
+2
-2
googletest/test/gtest_output_test_.cc
googletest/test/gtest_output_test_.cc
+10
-0
googletest/test/gtest_output_test_golden_lin.txt
googletest/test/gtest_output_test_golden_lin.txt
+19
-8
googletest/test/gtest_pred_impl_unittest.cc
googletest/test/gtest_pred_impl_unittest.cc
+1
-1
googletest/test/gtest_prod_test.cc
googletest/test/gtest_prod_test.cc
+2
-2
googletest/test/gtest_xml_test_utils.py
googletest/test/gtest_xml_test_utils.py
+1
-3
No files found.
googletest/src/gtest_main.cc
View file @
21cf8360
...
@@ -26,9 +26,9 @@
...
@@ -26,9 +26,9 @@
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
#include <stdio.h>
#include <stdio.h>
#include "gtest/gtest.h"
#include "gtest/gtest.h"
GTEST_API_
int
main
(
int
argc
,
char
**
argv
)
{
GTEST_API_
int
main
(
int
argc
,
char
**
argv
)
{
...
...
googletest/test/gtest-param-test2_test.cc
View file @
21cf8360
...
@@ -33,7 +33,7 @@
...
@@ -33,7 +33,7 @@
// Google Test work.
// Google Test work.
#include "gtest/gtest.h"
#include "gtest/gtest.h"
#include "
test/
gtest-param-test_test.h"
#include "gtest-param-test_test.h"
using
::
testing
::
Values
;
using
::
testing
::
Values
;
using
::
testing
::
internal
::
ParamGenerator
;
using
::
testing
::
internal
::
ParamGenerator
;
...
...
googletest/test/gtest-printers_test.cc
View file @
21cf8360
...
@@ -275,11 +275,11 @@ using hash_multiset = ::std::unordered_multiset<Key>;
...
@@ -275,11 +275,11 @@ using hash_multiset = ::std::unordered_multiset<Key>;
#elif GTEST_HAS_HASH_SET_
#elif GTEST_HAS_HASH_SET_
#ifdef _STLP_HASH_MAP // We got <hash_map> from STLport.
#ifdef _STLP_HASH_MAP // We got <hash_map> from STLport.
using
::
std
::
hash_
set
;
using
::
std
::
hash_
map
;
using
::
std
::
hash_multi
set
;
using
::
std
::
hash_multi
map
;
#elif _MSC_VER
#elif _MSC_VER
using
::
stdext
::
hash_
set
;
using
::
stdext
::
hash_
map
;
using
::
stdext
::
hash_multi
set
;
using
::
stdext
::
hash_multi
map
;
#endif
#endif
#endif
#endif
...
...
googletest/test/gtest-typed-test2_test.cc
View file @
21cf8360
...
@@ -31,7 +31,7 @@
...
@@ -31,7 +31,7 @@
#include <vector>
#include <vector>
#include "
test/
gtest-typed-test_test.h"
#include "gtest-typed-test_test.h"
#include "gtest/gtest.h"
#include "gtest/gtest.h"
#if GTEST_HAS_TYPED_TEST_P
#if GTEST_HAS_TYPED_TEST_P
...
...
googletest/test/gtest-typed-test_test.cc
View file @
21cf8360
...
@@ -29,7 +29,7 @@
...
@@ -29,7 +29,7 @@
//
//
// Author: wan@google.com (Zhanyong Wan)
// Author: wan@google.com (Zhanyong Wan)
#include "
test/
gtest-typed-test_test.h"
#include "gtest-typed-test_test.h"
#include <set>
#include <set>
#include <vector>
#include <vector>
...
...
googletest/test/gtest_break_on_failure_unittest.py
View file @
21cf8360
...
@@ -40,10 +40,8 @@ Google Test) with different environments and command line flags.
...
@@ -40,10 +40,8 @@ Google Test) with different environments and command line flags.
__author__
=
'wan@google.com (Zhanyong Wan)'
__author__
=
'wan@google.com (Zhanyong Wan)'
import
gtest_test_utils
import
os
import
os
import
sys
import
gtest_test_utils
# Constants.
# Constants.
...
...
googletest/test/gtest_catch_exceptions_test.py
View file @
21cf8360
...
@@ -37,8 +37,6 @@ Google Test) and verifies their output.
...
@@ -37,8 +37,6 @@ Google Test) and verifies their output.
__author__
=
'vladl@google.com (Vlad Losev)'
__author__
=
'vladl@google.com (Vlad Losev)'
import
os
import
gtest_test_utils
import
gtest_test_utils
# Constants.
# Constants.
...
...
googletest/test/gtest_color_test.py
View file @
21cf8360
...
@@ -36,7 +36,7 @@ __author__ = 'wan@google.com (Zhanyong Wan)'
...
@@ -36,7 +36,7 @@ __author__ = 'wan@google.com (Zhanyong Wan)'
import
os
import
os
import
gtest_test_utils
import
gtest_test_utils
IS_WINDOWS
=
os
.
name
=
'nt'
IS_WINDOWS
=
os
.
name
=
=
'nt'
COLOR_ENV_VAR
=
'GTEST_COLOR'
COLOR_ENV_VAR
=
'GTEST_COLOR'
COLOR_FLAG
=
'gtest_color'
COLOR_FLAG
=
'gtest_color'
...
...
googletest/test/gtest_env_var_test.py
View file @
21cf8360
...
@@ -47,8 +47,8 @@ environ = os.environ.copy()
...
@@ -47,8 +47,8 @@ environ = os.environ.copy()
def
AssertEq
(
expected
,
actual
):
def
AssertEq
(
expected
,
actual
):
if
expected
!=
actual
:
if
expected
!=
actual
:
print
(
'Expected: %s'
%
(
expected
,)
)
print
'Expected: %s'
%
(
expected
,)
print
(
' Actual: %s'
%
(
actual
,)
)
print
' Actual: %s'
%
(
actual
,)
raise
AssertionError
raise
AssertionError
...
...
googletest/test/gtest_list_tests_unittest.py
View file @
21cf8360
...
@@ -39,9 +39,8 @@ Google Test) the command line flags.
...
@@ -39,9 +39,8 @@ Google Test) the command line flags.
__author__
=
'phanna@google.com (Patrick Hanna)'
__author__
=
'phanna@google.com (Patrick Hanna)'
import
gtest_test_utils
import
re
import
re
import
gtest_test_utils
# Constants.
# Constants.
...
@@ -123,6 +122,7 @@ def Run(args):
...
@@ -123,6 +122,7 @@ def Run(args):
# The unit test.
# The unit test.
class
GTestListTestsUnitTest
(
gtest_test_utils
.
TestCase
):
class
GTestListTestsUnitTest
(
gtest_test_utils
.
TestCase
):
"""Tests using the --gtest_list_tests flag to list all tests."""
"""Tests using the --gtest_list_tests flag to list all tests."""
...
...
googletest/test/gtest_output_test_.cc
View file @
21cf8360
...
@@ -168,6 +168,16 @@ void SubWithTrace(int n) {
...
@@ -168,6 +168,16 @@ void SubWithTrace(int n) {
SubWithoutTrace
(
n
);
SubWithoutTrace
(
n
);
}
}
TEST
(
SCOPED_TRACETest
,
AcceptedValues
)
{
SCOPED_TRACE
(
"literal string"
);
SCOPED_TRACE
(
std
::
string
(
"std::string"
));
SCOPED_TRACE
(
1337
);
// streamable type
const
char
*
null_value
=
NULL
;
SCOPED_TRACE
(
null_value
);
ADD_FAILURE
()
<<
"Just checking that all these values work fine."
;
}
// Tests that SCOPED_TRACE() obeys lexical scopes.
// Tests that SCOPED_TRACE() obeys lexical scopes.
TEST
(
SCOPED_TRACETest
,
ObeysScopes
)
{
TEST
(
SCOPED_TRACETest
,
ObeysScopes
)
{
printf
(
"(expected to fail)
\n
"
);
printf
(
"(expected to fail)
\n
"
);
...
...
googletest/test/gtest_output_test_golden_lin.txt
View file @
21cf8360
...
@@ -8,7 +8,7 @@ gtest_output_test_.cc:#: Failure
...
@@ -8,7 +8,7 @@ gtest_output_test_.cc:#: Failure
Expected equality of these values:
Expected equality of these values:
2
2
3
3
[0;32m[==========] [mRunning 6
7
tests from 30 test cases.
[0;32m[==========] [mRunning 6
8
tests from 30 test cases.
[0;32m[----------] [mGlobal test environment set-up.
[0;32m[----------] [mGlobal test environment set-up.
FooEnvironment::SetUp() called.
FooEnvironment::SetUp() called.
BarEnvironment::SetUp() called.
BarEnvironment::SetUp() called.
...
@@ -95,7 +95,17 @@ i == 3
...
@@ -95,7 +95,17 @@ i == 3
gtest_output_test_.cc:#: Failure
gtest_output_test_.cc:#: Failure
Expected: (3) >= (a[i]), actual: 3 vs 6
Expected: (3) >= (a[i]), actual: 3 vs 6
[0;31m[ FAILED ] [mLoggingTest.InterleavingLoggingAndAssertions
[0;31m[ FAILED ] [mLoggingTest.InterleavingLoggingAndAssertions
[0;32m[----------] [m6 tests from SCOPED_TRACETest
[0;32m[----------] [m7 tests from SCOPED_TRACETest
[0;32m[ RUN ] [mSCOPED_TRACETest.AcceptedValues
gtest_output_test_.cc:#: Failure
Failed
Just checking that all these values work fine.
Google Test trace:
gtest_output_test_.cc:#: (null)
gtest_output_test_.cc:#: 1337
gtest_output_test_.cc:#: std::string
gtest_output_test_.cc:#: literal string
[0;31m[ FAILED ] [mSCOPED_TRACETest.AcceptedValues
[0;32m[ RUN ] [mSCOPED_TRACETest.ObeysScopes
[0;32m[ RUN ] [mSCOPED_TRACETest.ObeysScopes
(expected to fail)
(expected to fail)
gtest_output_test_.cc:#: Failure
gtest_output_test_.cc:#: Failure
...
@@ -474,7 +484,7 @@ Expected equality of these values:
...
@@ -474,7 +484,7 @@ Expected equality of these values:
Which is: '\0'
Which is: '\0'
Expected failure
Expected failure
[0;31m[ FAILED ] [mUnsigned/TypedTestP/0.Failure, where TypeParam = unsigned char
[0;31m[ FAILED ] [mUnsigned/TypedTestP/0.Failure, where TypeParam = unsigned char
[0;32m[----------] [m2 tests from Unsigned/TypedTestP/1, where TypeParam = unsigned
int
[0;32m[----------] [m2 tests from Unsigned/TypedTestP/1, where TypeParam = unsigned
[0;32m[ RUN ] [mUnsigned/TypedTestP/1.Success
[0;32m[ RUN ] [mUnsigned/TypedTestP/1.Success
[0;32m[ OK ] [mUnsigned/TypedTestP/1.Success
[0;32m[ OK ] [mUnsigned/TypedTestP/1.Success
[0;32m[ RUN ] [mUnsigned/TypedTestP/1.Failure
[0;32m[ RUN ] [mUnsigned/TypedTestP/1.Failure
...
@@ -485,7 +495,7 @@ Expected equality of these values:
...
@@ -485,7 +495,7 @@ Expected equality of these values:
TypeParam()
TypeParam()
Which is: 0
Which is: 0
Expected failure
Expected failure
[0;31m[ FAILED ] [mUnsigned/TypedTestP/1.Failure, where TypeParam = unsigned
int
[0;31m[ FAILED ] [mUnsigned/TypedTestP/1.Failure, where TypeParam = unsigned
[0;32m[----------] [m4 tests from ExpectFailureTest
[0;32m[----------] [m4 tests from ExpectFailureTest
[0;32m[ RUN ] [mExpectFailureTest.ExpectFatalFailure
[0;32m[ RUN ] [mExpectFailureTest.ExpectFatalFailure
(expecting 1 failure)
(expecting 1 failure)
...
@@ -644,15 +654,16 @@ FooEnvironment::TearDown() called.
...
@@ -644,15 +654,16 @@ FooEnvironment::TearDown() called.
gtest_output_test_.cc:#: Failure
gtest_output_test_.cc:#: Failure
Failed
Failed
Expected fatal failure.
Expected fatal failure.
[0;32m[==========] [m6
7
tests from 30 test cases ran.
[0;32m[==========] [m6
8
tests from 30 test cases ran.
[0;32m[ PASSED ] [m22 tests.
[0;32m[ PASSED ] [m22 tests.
[0;31m[ FAILED ] [m4
5
tests, listed below:
[0;31m[ FAILED ] [m4
6
tests, listed below:
[0;31m[ FAILED ] [mNonfatalFailureTest.EscapesStringOperands
[0;31m[ FAILED ] [mNonfatalFailureTest.EscapesStringOperands
[0;31m[ FAILED ] [mNonfatalFailureTest.DiffForLongStrings
[0;31m[ FAILED ] [mNonfatalFailureTest.DiffForLongStrings
[0;31m[ FAILED ] [mFatalFailureTest.FatalFailureInSubroutine
[0;31m[ FAILED ] [mFatalFailureTest.FatalFailureInSubroutine
[0;31m[ FAILED ] [mFatalFailureTest.FatalFailureInNestedSubroutine
[0;31m[ FAILED ] [mFatalFailureTest.FatalFailureInNestedSubroutine
[0;31m[ FAILED ] [mFatalFailureTest.NonfatalFailureInSubroutine
[0;31m[ FAILED ] [mFatalFailureTest.NonfatalFailureInSubroutine
[0;31m[ FAILED ] [mLoggingTest.InterleavingLoggingAndAssertions
[0;31m[ FAILED ] [mLoggingTest.InterleavingLoggingAndAssertions
[0;31m[ FAILED ] [mSCOPED_TRACETest.AcceptedValues
[0;31m[ FAILED ] [mSCOPED_TRACETest.ObeysScopes
[0;31m[ FAILED ] [mSCOPED_TRACETest.ObeysScopes
[0;31m[ FAILED ] [mSCOPED_TRACETest.WorksInLoop
[0;31m[ FAILED ] [mSCOPED_TRACETest.WorksInLoop
[0;31m[ FAILED ] [mSCOPED_TRACETest.WorksInSubroutine
[0;31m[ FAILED ] [mSCOPED_TRACETest.WorksInSubroutine
...
@@ -682,7 +693,7 @@ Expected fatal failure.
...
@@ -682,7 +693,7 @@ Expected fatal failure.
[0;31m[ FAILED ] [mExpectFatalFailureTest.FailsWhenStatementThrows
[0;31m[ FAILED ] [mExpectFatalFailureTest.FailsWhenStatementThrows
[0;31m[ FAILED ] [mTypedTest/0.Failure, where TypeParam = int
[0;31m[ FAILED ] [mTypedTest/0.Failure, where TypeParam = int
[0;31m[ FAILED ] [mUnsigned/TypedTestP/0.Failure, where TypeParam = unsigned char
[0;31m[ FAILED ] [mUnsigned/TypedTestP/0.Failure, where TypeParam = unsigned char
[0;31m[ FAILED ] [mUnsigned/TypedTestP/1.Failure, where TypeParam = unsigned
int
[0;31m[ FAILED ] [mUnsigned/TypedTestP/1.Failure, where TypeParam = unsigned
[0;31m[ FAILED ] [mExpectFailureTest.ExpectFatalFailure
[0;31m[ FAILED ] [mExpectFailureTest.ExpectFatalFailure
[0;31m[ FAILED ] [mExpectFailureTest.ExpectNonFatalFailure
[0;31m[ FAILED ] [mExpectFailureTest.ExpectNonFatalFailure
[0;31m[ FAILED ] [mExpectFailureTest.ExpectFatalFailureOnAllThreads
[0;31m[ FAILED ] [mExpectFailureTest.ExpectFatalFailureOnAllThreads
...
@@ -693,7 +704,7 @@ Expected fatal failure.
...
@@ -693,7 +704,7 @@ Expected fatal failure.
[0;31m[ FAILED ] [mPrintingFailingParams/FailingParamTest.Fails/0, where GetParam() = 2
[0;31m[ FAILED ] [mPrintingFailingParams/FailingParamTest.Fails/0, where GetParam() = 2
[0;31m[ FAILED ] [mPrintingStrings/ParamTest.Failure/a, where GetParam() = "a"
[0;31m[ FAILED ] [mPrintingStrings/ParamTest.Failure/a, where GetParam() = "a"
4
5
FAILED TESTS
4
6
FAILED TESTS
[0;33m YOU HAVE 1 DISABLED TEST
[0;33m YOU HAVE 1 DISABLED TEST
[mNote: Google Test filter = FatalFailureTest.*:LoggingTest.*
[mNote: Google Test filter = FatalFailureTest.*:LoggingTest.*
...
...
googletest/test/gtest_pred_impl_unittest.cc
View file @
21cf8360
...
@@ -27,7 +27,7 @@
...
@@ -27,7 +27,7 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// This file is AUTOMATICALLY GENERATED on
10/31
/201
1
by command
// This file is AUTOMATICALLY GENERATED on
01/02
/201
8
by command
// 'gen_gtest_pred_impl.py 5'. DO NOT EDIT BY HAND!
// 'gen_gtest_pred_impl.py 5'. DO NOT EDIT BY HAND!
// Regression test for gtest_pred_impl.h
// Regression test for gtest_pred_impl.h
...
...
googletest/test/gtest_prod_test.cc
View file @
21cf8360
...
@@ -29,10 +29,10 @@
...
@@ -29,10 +29,10 @@
//
//
// Author: wan@google.com (Zhanyong Wan)
// Author: wan@google.com (Zhanyong Wan)
//
//
// Unit test for
include/
gtest/gtest_prod.h.
// Unit test for gtest/gtest_prod.h.
#include "production.h"
#include "gtest/gtest.h"
#include "gtest/gtest.h"
#include "test/production.h"
// Tests that private members can be accessed from a TEST declared as
// Tests that private members can be accessed from a TEST declared as
// a friend of the class.
// a friend of the class.
...
...
googletest/test/gtest_xml_test_utils.py
View file @
21cf8360
...
@@ -29,11 +29,9 @@
...
@@ -29,11 +29,9 @@
"""Unit test utilities for gtest_xml_output"""
"""Unit test utilities for gtest_xml_output"""
import
os
import
re
import
re
import
gtest_test_utils
from
xml.dom
import
minidom
,
Node
from
xml.dom
import
minidom
,
Node
import
gtest_test_utils
GTEST_DEFAULT_OUTPUT_FILE
=
'test_detail.xml'
GTEST_DEFAULT_OUTPUT_FILE
=
'test_detail.xml'
...
...
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