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
6e87b780
Commit
6e87b780
authored
Nov 17, 2014
by
kosak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update gmock_doctor to accept static_assert output.
parent
cd99eb0b
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
0 deletions
+9
-0
gmock_doctor.py
scripts/gmock_doctor.py
+9
-0
No files found.
scripts/gmock_doctor.py
View file @
6e87b780
...
@@ -175,11 +175,15 @@ def _NeedToReturnReferenceDiagnoser(msg):
...
@@ -175,11 +175,15 @@ def _NeedToReturnReferenceDiagnoser(msg):
r'note: in instantiation of function template specialization '
r'note: in instantiation of function template specialization '
r'\'testing::internal::ReturnAction<(?P<type>.*)>'
r'\'testing::internal::ReturnAction<(?P<type>.*)>'
r'::operator Action<.*>\' requested here'
)
r'::operator Action<.*>\' requested here'
)
clang11_re
=
(
r'use_ReturnRef_instead_of_Return_to_return_a_reference.*'
r'(.*\n)*?'
+
_CLANG_NON_GMOCK_FILE_LINE_RE
)
diagnosis
=
"""
diagnosis
=
"""
You are using a Return() action in a function that returns a reference to
You are using a Return() action in a function that returns a reference to
%(type)
s. Please use ReturnRef() instead."""
%(type)
s. Please use ReturnRef() instead."""
return
_GenericDiagnoser
(
'NRR'
,
'Need to Return Reference'
,
return
_GenericDiagnoser
(
'NRR'
,
'Need to Return Reference'
,
[(
clang_regex
,
diagnosis
),
[(
clang_regex
,
diagnosis
),
(
clang11_re
,
diagnosis
%
{
'type'
:
'a type'
}),
(
gcc_regex
,
diagnosis
%
{
'type'
:
'a type'
})],
(
gcc_regex
,
diagnosis
%
{
'type'
:
'a type'
})],
msg
)
msg
)
...
@@ -517,12 +521,17 @@ def _WrongMockMethodMacroDiagnoser(msg):
...
@@ -517,12 +521,17 @@ def _WrongMockMethodMacroDiagnoser(msg):
r'(?P=file):(?P=line):(?P=column): error: too few arguments '
r'(?P=file):(?P=line):(?P=column): error: too few arguments '
r'to function call, expected (?P<args>\d+), '
r'to function call, expected (?P<args>\d+), '
r'have (?P<wrong_args>\d+)'
)
r'have (?P<wrong_args>\d+)'
)
clang11_re
=
(
_CLANG_NON_GMOCK_FILE_LINE_RE
+
r'.*this_method_does_not_take_'
r'(?P<wrong_args>\d+)_argument.*'
)
diagnosis
=
"""
diagnosis
=
"""
You are using MOCK_METHOD
%(wrong_args)
s to define a mock method that has
You are using MOCK_METHOD
%(wrong_args)
s to define a mock method that has
%(args)
s arguments. Use MOCK_METHOD
%(args)
s (or MOCK_CONST_METHOD
%(args)
s,
%(args)
s arguments. Use MOCK_METHOD
%(args)
s (or MOCK_CONST_METHOD
%(args)
s,
MOCK_METHOD
%(args)
s_T, MOCK_CONST_METHOD
%(args)
s_T as appropriate) instead."""
MOCK_METHOD
%(args)
s_T, MOCK_CONST_METHOD
%(args)
s_T as appropriate) instead."""
return
_GenericDiagnoser
(
'WMM'
,
'Wrong MOCK_METHODn Macro'
,
return
_GenericDiagnoser
(
'WMM'
,
'Wrong MOCK_METHODn Macro'
,
[(
gcc_regex
,
diagnosis
),
[(
gcc_regex
,
diagnosis
),
(
clang11_re
,
diagnosis
%
{
'wrong_args'
:
'm'
,
'args'
:
'n'
}),
(
clang_regex
,
diagnosis
)],
(
clang_regex
,
diagnosis
)],
msg
)
msg
)
...
...
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