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
e9b05a4d
Unverified
Commit
e9b05a4d
authored
Aug 07, 2018
by
tisi1988
Committed by
GitHub
Aug 07, 2018
Browse files
Merge branch 'master' into master
parents
25e1436b
28b71e44
Changes
69
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
444 additions
and
133 deletions
+444
-133
googletest/test/googletest-output-test-golden-lin.txt
googletest/test/googletest-output-test-golden-lin.txt
+102
-102
googletest/test/googletest-output-test.py
googletest/test/googletest-output-test.py
+10
-10
googletest/test/googletest-output-test_.cc
googletest/test/googletest-output-test_.cc
+1
-1
googletest/test/googletest-param-test-invalid-name1-test.py
googletest/test/googletest-param-test-invalid-name1-test.py
+72
-0
googletest/test/googletest-param-test-invalid-name1-test_.cc
googletest/test/googletest-param-test-invalid-name1-test_.cc
+51
-0
googletest/test/googletest-param-test-invalid-name2-test.py
googletest/test/googletest-param-test-invalid-name2-test.py
+71
-0
googletest/test/googletest-param-test-invalid-name2-test_.cc
googletest/test/googletest-param-test-invalid-name2-test_.cc
+56
-0
googletest/test/googletest-param-test-test.cc
googletest/test/googletest-param-test-test.cc
+1
-1
googletest/test/googletest-param-test-test.h
googletest/test/googletest-param-test-test.h
+0
-0
googletest/test/googletest-param-test2-test.cc
googletest/test/googletest-param-test2-test.cc
+4
-4
googletest/test/googletest-port-test.cc
googletest/test/googletest-port-test.cc
+3
-3
googletest/test/googletest-printers-test.cc
googletest/test/googletest-printers-test.cc
+2
-2
googletest/test/googletest-shuffle-test.py
googletest/test/googletest-shuffle-test.py
+3
-3
googletest/test/googletest-shuffle-test_.cc
googletest/test/googletest-shuffle-test_.cc
+0
-0
googletest/test/googletest-test-part-test.cc
googletest/test/googletest-test-part-test.cc
+0
-0
googletest/test/googletest-test2_test.cc
googletest/test/googletest-test2_test.cc
+61
-0
googletest/test/googletest-throw-on-failure-test.py
googletest/test/googletest-throw-on-failure-test.py
+5
-5
googletest/test/googletest-throw-on-failure-test_.cc
googletest/test/googletest-throw-on-failure-test_.cc
+1
-1
googletest/test/googletest-tuple-test.cc
googletest/test/googletest-tuple-test.cc
+0
-0
googletest/test/googletest-uninitialized-test.py
googletest/test/googletest-uninitialized-test.py
+1
-1
No files found.
googletest/test/gtest
_
output
_
test
_
golden
_
lin.txt
→
googletest/test/g
oogle
test
-
output
-
test
-
golden
-
lin.txt
View file @
e9b05a4d
This diff is collapsed.
Click to expand it.
googletest/test/gtest
_
output
_
test.py
→
googletest/test/g
oogle
test
-
output
-
test.py
View file @
e9b05a4d
...
@@ -33,10 +33,10 @@
...
@@ -33,10 +33,10 @@
SYNOPSIS
SYNOPSIS
gtest_output_test.py --build_dir=BUILD/DIR --gengolden
g
oogle
test_output_test.py --build_dir=BUILD/DIR --gengolden
# where BUILD/DIR contains the built gtest
_
output
_
test_ file.
# where BUILD/DIR contains the built g
oogle
test
-
output
-
test_ file.
gtest_output_test.py --gengolden
g
oogle
test_output_test.py --gengolden
gtest_output_test.py
g
oogle
test_output_test.py
"""
"""
__author__
=
'wan@google.com (Zhanyong Wan)'
__author__
=
'wan@google.com (Zhanyong Wan)'
...
@@ -59,9 +59,9 @@ IS_LINUX = os.name == 'posix' and os.uname()[0] == 'Linux'
...
@@ -59,9 +59,9 @@ IS_LINUX = os.name == 'posix' and os.uname()[0] == 'Linux'
IS_WINDOWS
=
os
.
name
==
'nt'
IS_WINDOWS
=
os
.
name
==
'nt'
# TODO(vladl@google.com): remove the _lin suffix.
# TODO(vladl@google.com): remove the _lin suffix.
GOLDEN_NAME
=
'gtest
_
output
_
test
_
golden
_
lin.txt'
GOLDEN_NAME
=
'g
oogle
test
-
output
-
test
-
golden
-
lin.txt'
PROGRAM_PATH
=
gtest_test_utils
.
GetTestExecutablePath
(
'gtest
_
output
_
test_'
)
PROGRAM_PATH
=
gtest_test_utils
.
GetTestExecutablePath
(
'g
oogle
test
-
output
-
test_'
)
# At least one command we exercise must not have the
# At least one command we exercise must not have the
# 'internal_skip_environment_and_ad_hoc_tests' argument.
# 'internal_skip_environment_and_ad_hoc_tests' argument.
...
@@ -104,7 +104,7 @@ def RemoveLocations(test_output):
...
@@ -104,7 +104,7 @@ def RemoveLocations(test_output):
'FILE_NAME:#: '.
'FILE_NAME:#: '.
"""
"""
return
re
.
sub
(
r
'.*[/\\]((gtest
_
output
_
test_|gtest).cc)(\:\d+|\(\d+\))\: '
,
return
re
.
sub
(
r
'.*[/\\]((g
oogle
test
-
output
-
test_|gtest).cc)(\:\d+|\(\d+\))\: '
,
r
'\1:#: '
,
test_output
)
r
'\1:#: '
,
test_output
)
...
@@ -195,7 +195,7 @@ def RemoveMatchingTests(test_output, pattern):
...
@@ -195,7 +195,7 @@ def RemoveMatchingTests(test_output, pattern):
def
NormalizeOutput
(
output
):
def
NormalizeOutput
(
output
):
"""Normalizes output (the output of gtest
_
output
_
test_.exe)."""
"""Normalizes output (the output of g
oogle
test
-
output
-
test_.exe)."""
output
=
ToUnixLineEnding
(
output
)
output
=
ToUnixLineEnding
(
output
)
output
=
RemoveLocations
(
output
)
output
=
RemoveLocations
(
output
)
...
@@ -316,11 +316,11 @@ class GTestOutputTest(gtest_test_utils.TestCase):
...
@@ -316,11 +316,11 @@ class GTestOutputTest(gtest_test_utils.TestCase):
if
os
.
getenv
(
'DEBUG_GTEST_OUTPUT_TEST'
):
if
os
.
getenv
(
'DEBUG_GTEST_OUTPUT_TEST'
):
open
(
os
.
path
.
join
(
open
(
os
.
path
.
join
(
gtest_test_utils
.
GetSourceDir
(),
gtest_test_utils
.
GetSourceDir
(),
'_gtest
_
output
_
test_normalized_actual.txt'
),
'wb'
).
write
(
'_g
oogle
test
-
output
-
test_normalized_actual.txt'
),
'wb'
).
write
(
normalized_actual
)
normalized_actual
)
open
(
os
.
path
.
join
(
open
(
os
.
path
.
join
(
gtest_test_utils
.
GetSourceDir
(),
gtest_test_utils
.
GetSourceDir
(),
'_gtest
_
output
_
test_normalized_golden.txt'
),
'wb'
).
write
(
'_g
oogle
test
-
output
-
test_normalized_golden.txt'
),
'wb'
).
write
(
normalized_golden
)
normalized_golden
)
self
.
assertEqual
(
normalized_golden
,
normalized_actual
)
self
.
assertEqual
(
normalized_golden
,
normalized_actual
)
...
...
googletest/test/gtest
_
output
_
test_.cc
→
googletest/test/g
oogle
test
-
output
-
test_.cc
View file @
e9b05a4d
...
@@ -29,7 +29,7 @@
...
@@ -29,7 +29,7 @@
//
//
// The purpose of this file is to generate Google Test output under
// The purpose of this file is to generate Google Test output under
// various conditions. The output will then be verified by
// various conditions. The output will then be verified by
// gtest
_
output
_
test.py to ensure that Google Test generates the
// g
oogle
test
-
output
-
test.py to ensure that Google Test generates the
// desired messages. Therefore, most tests in this file are MEANT TO
// desired messages. Therefore, most tests in this file are MEANT TO
// FAIL.
// FAIL.
//
//
...
...
googletest/test/googletest-param-test-invalid-name1-test.py
0 → 100644
View file @
e9b05a4d
#!/usr/bin/env python
#
# Copyright 2015 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.
"""Verifies that Google Test warns the user when not initialized properly."""
__author__
=
'jmadill@google.com (Jamie Madill)'
import
os
IS_LINUX
=
os
.
name
==
'posix'
and
os
.
uname
()[
0
]
==
'Linux'
if
IS_LINUX
:
import
gtest_test_utils
else
:
import
gtest_test_utils
binary_name
=
'googletest-param-test-invalid-name1-test_'
COMMAND
=
gtest_test_utils
.
GetTestExecutablePath
(
binary_name
)
def
Assert
(
condition
):
if
not
condition
:
raise
AssertionError
def
TestExitCodeAndOutput
(
command
):
"""Runs the given command and verifies its exit code and output."""
err
=
(
'Parameterized test name
\'
"InvalidWithQuotes"
\'
is invalid'
)
p
=
gtest_test_utils
.
Subprocess
(
command
)
Assert
(
p
.
terminated_by_signal
)
# Verify the output message contains appropriate output
Assert
(
err
in
p
.
output
)
class
GTestParamTestInvalidName1Test
(
gtest_test_utils
.
TestCase
):
def
testExitCodeAndOutput
(
self
):
TestExitCodeAndOutput
(
COMMAND
)
if
__name__
==
'__main__'
:
gtest_test_utils
.
Main
()
googletest/test/googletest-param-test-invalid-name1-test_.cc
0 → 100644
View file @
e9b05a4d
// Copyright 2015, 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.
//
// Author: jmadill@google.com (Jamie Madill)
#include "gtest/gtest.h"
namespace
{
class
DummyTest
:
public
::
testing
::
TestWithParam
<
const
char
*>
{};
TEST_P
(
DummyTest
,
Dummy
)
{
}
INSTANTIATE_TEST_CASE_P
(
InvalidTestName
,
DummyTest
,
::
testing
::
Values
(
"InvalidWithQuotes"
),
::
testing
::
PrintToStringParamName
());
}
// namespace
int
main
(
int
argc
,
char
*
argv
[])
{
testing
::
InitGoogleTest
(
&
argc
,
argv
);
return
RUN_ALL_TESTS
();
}
googletest/test/googletest-param-test-invalid-name2-test.py
0 → 100644
View file @
e9b05a4d
#!/usr/bin/env python
#
# Copyright 2015 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.
"""Verifies that Google Test warns the user when not initialized properly."""
__author__
=
'jmadill@google.com (Jamie Madill)'
import
os
IS_LINUX
=
os
.
name
==
'posix'
and
os
.
uname
()[
0
]
==
'Linux'
if
IS_LINUX
:
import
gtest_test_utils
else
:
import
gtest_test_utils
binary_name
=
'googletest-param-test-invalid-name2-test_'
COMMAND
=
gtest_test_utils
.
GetTestExecutablePath
(
binary_name
)
def
Assert
(
condition
):
if
not
condition
:
raise
AssertionError
def
TestExitCodeAndOutput
(
command
):
"""Runs the given command and verifies its exit code and output."""
err
=
(
'Duplicate parameterized test name
\'
a
\'
'
)
p
=
gtest_test_utils
.
Subprocess
(
command
)
Assert
(
p
.
terminated_by_signal
)
# Check for appropriate output
Assert
(
err
in
p
.
output
)
class
GTestParamTestInvalidName2Test
(
gtest_test_utils
.
TestCase
):
def
testExitCodeAndOutput
(
self
):
TestExitCodeAndOutput
(
COMMAND
)
if
__name__
==
'__main__'
:
gtest_test_utils
.
Main
()
googletest/test/googletest-param-test-invalid-name2-test_.cc
0 → 100644
View file @
e9b05a4d
// Copyright 2015, 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.
//
// Author: jmadill@google.com (Jamie Madill)
#include "gtest/gtest.h"
namespace
{
class
DummyTest
:
public
::
testing
::
TestWithParam
<
const
char
*>
{};
std
::
string
StringParamTestSuffix
(
const
testing
::
TestParamInfo
<
const
char
*>&
info
)
{
return
std
::
string
(
info
.
param
);
}
TEST_P
(
DummyTest
,
Dummy
)
{
}
INSTANTIATE_TEST_CASE_P
(
DuplicateTestNames
,
DummyTest
,
::
testing
::
Values
(
"a"
,
"b"
,
"a"
,
"c"
),
StringParamTestSuffix
);
}
// namespace
int
main
(
int
argc
,
char
*
argv
[])
{
testing
::
InitGoogleTest
(
&
argc
,
argv
);
return
RUN_ALL_TESTS
();
}
googletest/test/gtest-param-test
_
test.cc
→
googletest/test/g
oogle
test-param-test
-
test.cc
View file @
e9b05a4d
...
@@ -43,7 +43,7 @@
...
@@ -43,7 +43,7 @@
# include <vector>
# include <vector>
# include "src/gtest-internal-inl.h" // for UnitTestOptions
# include "src/gtest-internal-inl.h" // for UnitTestOptions
# include "test/gtest-param-test
_
test.h"
# include "test/g
oogle
test-param-test
-
test.h"
using
::
std
::
vector
;
using
::
std
::
vector
;
using
::
std
::
sort
;
using
::
std
::
sort
;
...
...
googletest/test/gtest-param-test
_
test.h
→
googletest/test/g
oogle
test-param-test
-
test.h
View file @
e9b05a4d
File moved
googletest/test/gtest-param-test2
_
test.cc
→
googletest/test/g
oogle
test-param-test2
-
test.cc
View file @
e9b05a4d
...
@@ -33,18 +33,18 @@
...
@@ -33,18 +33,18 @@
// Google Test work.
// Google Test work.
#include "gtest/gtest.h"
#include "gtest/gtest.h"
#include "gtest-param-test
_
test.h"
#include "g
oogle
test-param-test
-
test.h"
using
::
testing
::
Values
;
using
::
testing
::
Values
;
using
::
testing
::
internal
::
ParamGenerator
;
using
::
testing
::
internal
::
ParamGenerator
;
// Tests that generators defined in a different translation unit
// Tests that generators defined in a different translation unit
// are functional. The test using extern_gen is defined
// are functional. The test using extern_gen is defined
// in gtest-param-test
_
test.cc.
// in g
oogle
test-param-test
-
test.cc.
ParamGenerator
<
int
>
extern_gen
=
Values
(
33
);
ParamGenerator
<
int
>
extern_gen
=
Values
(
33
);
// Tests that a parameterized test case can be defined in one translation unit
// Tests that a parameterized test case can be defined in one translation unit
// and instantiated in another. The test is defined in gtest-param-test
_
test.cc
// and instantiated in another. The test is defined in g
oogle
test-param-test
-
test.cc
// and ExternalInstantiationTest fixture class is defined in
// and ExternalInstantiationTest fixture class is defined in
// gtest-param-test_test.h.
// gtest-param-test_test.h.
INSTANTIATE_TEST_CASE_P
(
MultiplesOf33
,
INSTANTIATE_TEST_CASE_P
(
MultiplesOf33
,
...
@@ -53,7 +53,7 @@ INSTANTIATE_TEST_CASE_P(MultiplesOf33,
...
@@ -53,7 +53,7 @@ INSTANTIATE_TEST_CASE_P(MultiplesOf33,
// Tests that a parameterized test case can be instantiated
// Tests that a parameterized test case can be instantiated
// in multiple translation units. Another instantiation is defined
// in multiple translation units. Another instantiation is defined
// in gtest-param-test
_
test.cc and InstantiationInMultipleTranslaionUnitsTest
// in g
oogle
test-param-test
-
test.cc and InstantiationInMultipleTranslaionUnitsTest
// fixture is defined in gtest-param-test_test.h
// fixture is defined in gtest-param-test_test.h
INSTANTIATE_TEST_CASE_P
(
Sequence2
,
INSTANTIATE_TEST_CASE_P
(
Sequence2
,
InstantiationInMultipleTranslaionUnitsTest
,
InstantiationInMultipleTranslaionUnitsTest
,
...
...
googletest/test/gtest-port
_
test.cc
→
googletest/test/g
oogle
test-port
-
test.cc
View file @
e9b05a4d
...
@@ -346,11 +346,11 @@ TEST(GtestCheckDeathTest, DiesWithCorrectOutputOnFailure) {
...
@@ -346,11 +346,11 @@ TEST(GtestCheckDeathTest, DiesWithCorrectOutputOnFailure) {
const
bool
a_false_condition
=
false
;
const
bool
a_false_condition
=
false
;
const
char
regex
[]
=
const
char
regex
[]
=
#ifdef _MSC_VER
#ifdef _MSC_VER
"gtest-port
_
test
\\
.cc
\\
(
\\
d+
\\
):"
"g
oogle
test-port
-
test
\\
.cc
\\
(
\\
d+
\\
):"
#elif GTEST_USES_POSIX_RE
#elif GTEST_USES_POSIX_RE
"gtest-port
_
test
\\
.cc:[0-9]+"
"g
oogle
test-port
-
test
\\
.cc:[0-9]+"
#else
#else
"gtest-port
_
test
\\
.cc:
\\
d+"
"g
oogle
test-port
-
test
\\
.cc:
\\
d+"
#endif // _MSC_VER
#endif // _MSC_VER
".*a_false_condition.*Extra info.*"
;
".*a_false_condition.*Extra info.*"
;
...
...
googletest/test/gtest-printers
_
test.cc
→
googletest/test/g
oogle
test-printers
-
test.cc
View file @
e9b05a4d
...
@@ -572,7 +572,7 @@ struct Foo {
...
@@ -572,7 +572,7 @@ struct Foo {
TEST
(
PrintPointerTest
,
MemberVariablePointer
)
{
TEST
(
PrintPointerTest
,
MemberVariablePointer
)
{
EXPECT_TRUE
(
HasPrefix
(
Print
(
&
Foo
::
value
),
EXPECT_TRUE
(
HasPrefix
(
Print
(
&
Foo
::
value
),
Print
(
sizeof
(
&
Foo
::
value
))
+
"-byte object "
));
Print
(
sizeof
(
&
Foo
::
value
))
+
"-byte object "
));
int
(
Foo
::*
p
)
=
NULL
;
// NOLINT
int
Foo
::*
p
=
NULL
;
// NOLINT
EXPECT_TRUE
(
HasPrefix
(
Print
(
p
),
EXPECT_TRUE
(
HasPrefix
(
Print
(
p
),
Print
(
sizeof
(
p
))
+
"-byte object "
));
Print
(
sizeof
(
p
))
+
"-byte object "
));
}
}
...
@@ -1250,7 +1250,7 @@ TEST(PrintReferenceTest, HandlesMemberFunctionPointer) {
...
@@ -1250,7 +1250,7 @@ TEST(PrintReferenceTest, HandlesMemberFunctionPointer) {
// Tests that the universal printer prints a member variable pointer
// Tests that the universal printer prints a member variable pointer
// passed by reference.
// passed by reference.
TEST
(
PrintReferenceTest
,
HandlesMemberVariablePointer
)
{
TEST
(
PrintReferenceTest
,
HandlesMemberVariablePointer
)
{
int
(
Foo
::*
p
)
=
&
Foo
::
value
;
// NOLINT
int
Foo
::*
p
=
&
Foo
::
value
;
// NOLINT
EXPECT_TRUE
(
HasPrefix
(
EXPECT_TRUE
(
HasPrefix
(
PrintByRef
(
p
),
PrintByRef
(
p
),
"@"
+
PrintPointer
(
&
p
)
+
" "
+
Print
(
sizeof
(
p
))
+
"-byte object "
));
"@"
+
PrintPointer
(
&
p
)
+
" "
+
Print
(
sizeof
(
p
))
+
"-byte object "
));
...
...
googletest/test/gtest
_
shuffle
_
test.py
→
googletest/test/g
oogle
test
-
shuffle
-
test.py
View file @
e9b05a4d
...
@@ -35,8 +35,8 @@ __author__ = 'wan@google.com (Zhanyong Wan)'
...
@@ -35,8 +35,8 @@ __author__ = 'wan@google.com (Zhanyong Wan)'
import
os
import
os
import
gtest_test_utils
import
gtest_test_utils
# Command to run the gtest
_
shuffle
_
test_ program.
# Command to run the g
oogle
test
-
shuffle
-
test_ program.
COMMAND
=
gtest_test_utils
.
GetTestExecutablePath
(
'gtest
_
shuffle
_
test_'
)
COMMAND
=
gtest_test_utils
.
GetTestExecutablePath
(
'g
oogle
test
-
shuffle
-
test_'
)
# The environment variables for test sharding.
# The environment variables for test sharding.
TOTAL_SHARDS_ENV_VAR
=
'GTEST_TOTAL_SHARDS'
TOTAL_SHARDS_ENV_VAR
=
'GTEST_TOTAL_SHARDS'
...
@@ -89,7 +89,7 @@ def GetTestsForAllIterations(extra_env, args):
...
@@ -89,7 +89,7 @@ def GetTestsForAllIterations(extra_env, args):
Args:
Args:
extra_env: a map from environment variables to their values
extra_env: a map from environment variables to their values
args: command line flags to pass to gtest
_
shuffle
_
test_
args: command line flags to pass to g
oogle
test
-
shuffle
-
test_
Returns:
Returns:
A list where the i-th element is the list of tests run in the i-th
A list where the i-th element is the list of tests run in the i-th
...
...
googletest/test/gtest
_
shuffle
_
test_.cc
→
googletest/test/g
oogle
test
-
shuffle
-
test_.cc
View file @
e9b05a4d
File moved
googletest/test/gtest-test-part
_
test.cc
→
googletest/test/g
oogle
test-test-part
-
test.cc
View file @
e9b05a4d
File moved
googletest/test/googletest-test2_test.cc
0 → 100644
View file @
e9b05a4d
// Copyright 2008, 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.
//
// Author: vladl@google.com (Vlad Losev)
//
// Tests for Google Test itself. This verifies that the basic constructs of
// Google Test work.
#include "gtest/gtest.h"
#include "googletest-param-test-test.h"
using
::
testing
::
Values
;
using
::
testing
::
internal
::
ParamGenerator
;
// Tests that generators defined in a different translation unit
// are functional. The test using extern_gen_2 is defined
// in googletest-param-test-test.cc.
ParamGenerator
<
int
>
extern_gen_2
=
Values
(
33
);
// Tests that a parameterized test case can be defined in one translation unit
// and instantiated in another. The test is defined in googletest-param-test-test.cc
// and ExternalInstantiationTest fixture class is defined in
// gtest-param-test_test.h.
INSTANTIATE_TEST_CASE_P
(
MultiplesOf33
,
ExternalInstantiationTest
,
Values
(
33
,
66
));
// Tests that a parameterized test case can be instantiated
// in multiple translation units. Another instantiation is defined
// in googletest-param-test-test.cc and InstantiationInMultipleTranslaionUnitsTest
// fixture is defined in gtest-param-test_test.h
INSTANTIATE_TEST_CASE_P
(
Sequence2
,
InstantiationInMultipleTranslaionUnitsTest
,
Values
(
42
*
3
,
42
*
4
,
42
*
5
));
googletest/test/gtest
_
throw
_
on
_
failure
_
test.py
→
googletest/test/g
oogle
test
-
throw
-
on
-
failure
-
test.py
View file @
e9b05a4d
...
@@ -31,7 +31,7 @@
...
@@ -31,7 +31,7 @@
"""Tests Google Test's throw-on-failure mode with exceptions disabled.
"""Tests Google Test's throw-on-failure mode with exceptions disabled.
This script invokes gtest
_
throw
_
on
_
failure
_
test_ (a program written with
This script invokes g
oogle
test
-
throw
-
on
-
failure
-
test_ (a program written with
Google Test) with different environments and command line flags.
Google Test) with different environments and command line flags.
"""
"""
...
@@ -46,10 +46,10 @@ import gtest_test_utils
...
@@ -46,10 +46,10 @@ import gtest_test_utils
# The command line flag for enabling/disabling the throw-on-failure mode.
# The command line flag for enabling/disabling the throw-on-failure mode.
THROW_ON_FAILURE
=
'gtest_throw_on_failure'
THROW_ON_FAILURE
=
'gtest_throw_on_failure'
# Path to the gtest
_
throw
_
on
_
failure
_
test_ program, compiled with
# Path to the g
oogle
test
-
throw
-
on
-
failure
-
test_ program, compiled with
# exceptions disabled.
# exceptions disabled.
EXE_PATH
=
gtest_test_utils
.
GetTestExecutablePath
(
EXE_PATH
=
gtest_test_utils
.
GetTestExecutablePath
(
'gtest
_
throw
_
on
_
failure
_
test_'
)
'g
oogle
test
-
throw
-
on
-
failure
-
test_'
)
# Utilities.
# Utilities.
...
@@ -76,12 +76,12 @@ def Run(command):
...
@@ -76,12 +76,12 @@ def Run(command):
# The tests. TODO(wan@google.com): refactor the class to share common
# The tests. TODO(wan@google.com): refactor the class to share common
# logic with code in gtest
_
break
_
on
_
failure
_
unittest.py.
# logic with code in g
oogle
test
-
break
-
on
-
failure
-
unittest.py.
class
ThrowOnFailureTest
(
gtest_test_utils
.
TestCase
):
class
ThrowOnFailureTest
(
gtest_test_utils
.
TestCase
):
"""Tests the throw-on-failure mode."""
"""Tests the throw-on-failure mode."""
def
RunAndVerify
(
self
,
env_var_value
,
flag_value
,
should_fail
):
def
RunAndVerify
(
self
,
env_var_value
,
flag_value
,
should_fail
):
"""Runs gtest
_
throw
_
on
_
failure
_
test_ and verifies that it does
"""Runs g
oogle
test
-
throw
-
on
-
failure
-
test_ and verifies that it does
(or does not) exit with a non-zero code.
(or does not) exit with a non-zero code.
Args:
Args:
...
...
googletest/test/gtest
_
throw
_
on
_
failure
_
test_.cc
→
googletest/test/g
oogle
test
-
throw
-
on
-
failure
-
test_.cc
View file @
e9b05a4d
...
@@ -32,7 +32,7 @@
...
@@ -32,7 +32,7 @@
// Tests Google Test's throw-on-failure mode with exceptions disabled.
// Tests Google Test's throw-on-failure mode with exceptions disabled.
//
//
// This program must be compiled with exceptions disabled. It will be
// This program must be compiled with exceptions disabled. It will be
// invoked by gtest
_
throw
_
on
_
failure
_
test.py, and is expected to exit
// invoked by g
oogle
test
-
throw
-
on
-
failure
-
test.py, and is expected to exit
// with non-zero in the throw-on-failure mode or 0 otherwise.
// with non-zero in the throw-on-failure mode or 0 otherwise.
#include "gtest/gtest.h"
#include "gtest/gtest.h"
...
...
googletest/test/gtest-tuple
_
test.cc
→
googletest/test/g
oogle
test-tuple
-
test.cc
View file @
e9b05a4d
File moved
googletest/test/gtest
_
uninitialized
_
test.py
→
googletest/test/g
oogle
test
-
uninitialized
-
test.py
View file @
e9b05a4d
...
@@ -35,7 +35,7 @@ __author__ = 'wan@google.com (Zhanyong Wan)'
...
@@ -35,7 +35,7 @@ __author__ = 'wan@google.com (Zhanyong Wan)'
import
gtest_test_utils
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
):
def
Assert
(
condition
):
...
...
Prev
1
2
3
4
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