Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
googletest
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
googletest
Commits
921972cb
Commit
921972cb
authored
Feb 18, 2020
by
NINI1988
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add correct line number to TEST_P test cases for gtest_output.
parent
23b2a3b1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
6 deletions
+8
-6
gtest-param-test.h
googletest/include/gtest/gtest-param-test.h
+1
-1
gtest-param-util.h
googletest/include/gtest/internal/gtest-param-util.h
+7
-5
No files found.
googletest/include/gtest/gtest-param-test.h
View file @
921972cb
...
...
@@ -428,7 +428,7 @@ internal::CartesianProductHolder<Generator...> Combine(const Generator&... g) {
->AddTestPattern( \
GTEST_STRINGIFY_(test_suite_name), GTEST_STRINGIFY_(test_name), \
new ::testing::internal::TestMetaFactory<GTEST_TEST_CLASS_NAME_( \
test_suite_name, test_name)>()
);
\
test_suite_name, test_name)>()
, __LINE__);
\
return 0; \
} \
static int gtest_registering_dummy_ GTEST_ATTRIBUTE_UNUSED_; \
...
...
googletest/include/gtest/internal/gtest-param-util.h
View file @
921972cb
...
...
@@ -520,9 +520,9 @@ class ParameterizedTestSuiteInfo : public ParameterizedTestSuiteInfoBase {
// parameter index. For the test SequenceA/FooTest.DoBar/1 FooTest is
// test suite base name and DoBar is test base name.
void
AddTestPattern
(
const
char
*
test_suite_name
,
const
char
*
test_base_name
,
TestMetaFactoryBase
<
ParamType
>*
meta_factory
)
{
TestMetaFactoryBase
<
ParamType
>*
meta_factory
,
int
line
)
{
tests_
.
push_back
(
std
::
shared_ptr
<
TestInfo
>
(
new
TestInfo
(
test_suite_name
,
test_base_name
,
meta_factory
)));
new
TestInfo
(
test_suite_name
,
test_base_name
,
meta_factory
,
line
)));
}
// INSTANTIATE_TEST_SUITE_P macro uses AddGenerator() to record information
// about a generator.
...
...
@@ -589,7 +589,7 @@ class ParameterizedTestSuiteInfo : public ParameterizedTestSuiteInfoBase {
MakeAndRegisterTestInfo
(
test_suite_name
.
c_str
(),
test_name_stream
.
GetString
().
c_str
(),
nullptr
,
// No type parameter.
PrintToString
(
*
param_it
).
c_str
(),
code_location_
,
PrintToString
(
*
param_it
).
c_str
(),
CodeLocation
(
code_location_
.
file
,
test_info
->
line
)
,
GetTestSuiteTypeId
(),
SuiteApiResolver
<
TestSuite
>::
GetSetUpCaseOrSuite
(
file
,
line
),
SuiteApiResolver
<
TestSuite
>::
GetTearDownCaseOrSuite
(
file
,
line
),
...
...
@@ -610,14 +610,16 @@ class ParameterizedTestSuiteInfo : public ParameterizedTestSuiteInfoBase {
// with TEST_P macro.
struct
TestInfo
{
TestInfo
(
const
char
*
a_test_suite_base_name
,
const
char
*
a_test_base_name
,
TestMetaFactoryBase
<
ParamType
>*
a_test_meta_factory
)
TestMetaFactoryBase
<
ParamType
>*
a_test_meta_factory
,
int
line
)
:
test_suite_base_name
(
a_test_suite_base_name
),
test_base_name
(
a_test_base_name
),
test_meta_factory
(
a_test_meta_factory
)
{}
test_meta_factory
(
a_test_meta_factory
),
line
(
line
)
{}
const
std
::
string
test_suite_base_name
;
const
std
::
string
test_base_name
;
const
std
::
unique_ptr
<
TestMetaFactoryBase
<
ParamType
>
>
test_meta_factory
;
const
int
line
;
};
using
TestInfoContainer
=
::
std
::
vector
<
std
::
shared_ptr
<
TestInfo
>
>
;
// Records data received from INSTANTIATE_TEST_SUITE_P macros:
...
...
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