Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
flatpak-qt-creator
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Marco Bubke
flatpak-qt-creator
Commits
c13f417c
Commit
c13f417c
authored
14 years ago
by
Tobias Hunger
Browse files
Options
Downloads
Patches
Plain Diff
Improve MSVC parser
parent
c6132a05
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/plugins/projectexplorer/msvcparser.cpp
+49
-0
49 additions, 0 deletions
src/plugins/projectexplorer/msvcparser.cpp
src/plugins/projectexplorer/msvcparser.h
+2
-0
2 additions, 0 deletions
src/plugins/projectexplorer/msvcparser.h
with
51 additions
and
0 deletions
src/plugins/projectexplorer/msvcparser.cpp
+
49
−
0
View file @
c13f417c
...
...
@@ -44,6 +44,8 @@ MsvcParser::MsvcParser()
m_additionalInfoRegExp
.
setMinimal
(
true
);
m_linkRegExp
.
setPattern
(
QString
::
fromLatin1
(
"^"
)
+
QLatin1String
(
FILE_POS_PATTERN
)
+
QLatin1String
(
"[^:
\\
d]+(
\\
d+):(.*)$"
));
m_linkRegExp
.
setMinimal
(
true
);
m_nonFileRegExp
.
setPattern
(
QLatin1String
(
"(^LINK|cl) : .*(error|warning) (.*)$"
));
m_nonFileRegExp
.
setMinimal
(
true
);
}
void
MsvcParser
::
stdOutput
(
const
QString
&
line
)
...
...
@@ -84,9 +86,34 @@ void MsvcParser::stdOutput(const QString &line)
Constants
::
TASK_CATEGORY_COMPILE
));
return
;
}
if
(
m_nonFileRegExp
.
indexIn
(
lne
)
>
-
1
)
{
Task
::
TaskType
type
=
Task
::
Unknown
;
if
(
m_nonFileRegExp
.
cap
(
2
)
==
QLatin1String
(
"warning"
))
type
=
Task
::
Warning
;
if
(
m_nonFileRegExp
.
cap
(
2
)
==
QLatin1String
(
"error"
))
type
=
Task
::
Error
;
emit
addTask
(
Task
(
type
,
m_nonFileRegExp
.
cap
(
3
)
/* description */
,
QString
(),
-
1
,
Constants
::
TASK_CATEGORY_COMPILE
));
return
;
}
IOutputParser
::
stdOutput
(
line
);
}
void
MsvcParser
::
stdError
(
const
QString
&
line
)
{
if
(
m_nonFileRegExp
.
indexIn
(
line
)
>
-
1
)
{
Task
::
TaskType
type
=
Task
::
Unknown
;
if
(
m_nonFileRegExp
.
cap
(
2
)
==
QLatin1String
(
"warning"
))
type
=
Task
::
Warning
;
if
(
m_nonFileRegExp
.
cap
(
2
)
==
QLatin1String
(
"error"
))
type
=
Task
::
Error
;
emit
addTask
(
Task
(
type
,
m_nonFileRegExp
.
cap
(
3
)
/* description */
,
QString
(),
-
1
,
Constants
::
TASK_CATEGORY_COMPILE
));
return
;
}
IOutputParser
::
stdError
(
line
);
}
Task
::
TaskType
MsvcParser
::
toType
(
int
number
)
{
// This is unfortunately not true for all possible kinds of errors, but better
...
...
@@ -165,6 +192,28 @@ void ProjectExplorerPlugin::testMsvcOutputParsers_data()
QLatin1String
(
ProjectExplorer
::
Constants
::
TASK_CATEGORY_COMPILE
)))
<<
QString
();
QTest
::
newRow
(
"fatal linker error"
)
<<
QString
::
fromLatin1
(
"LINK : fatal error LNK1146: no argument specified with option '/LIBPATH:'"
)
<<
OutputParserTester
::
STDOUT
<<
QString
()
<<
QString
()
<<
(
QList
<
ProjectExplorer
::
Task
>
()
<<
Task
(
Task
::
Error
,
QLatin1String
(
"LNK1146: no argument specified with option '/LIBPATH:'"
),
QString
(),
-
1
,
QLatin1String
(
ProjectExplorer
::
Constants
::
TASK_CATEGORY_COMPILE
)))
<<
QString
();
// This actually comes through stderr!
QTest
::
newRow
(
"command line warning"
)
<<
QString
::
fromLatin1
(
"cl : Command line warning D9002 : ignoring unknown option '-fopenmp'"
)
<<
OutputParserTester
::
STDERR
<<
QString
()
<<
QString
()
<<
(
QList
<
ProjectExplorer
::
Task
>
()
<<
Task
(
Task
::
Warning
,
QLatin1String
(
"D9002 : ignoring unknown option '-fopenmp'"
),
QString
(),
-
1
,
QLatin1String
(
ProjectExplorer
::
Constants
::
TASK_CATEGORY_COMPILE
)))
<<
QString
();
}
void
ProjectExplorerPlugin
::
testMsvcOutputParsers
()
...
...
This diff is collapsed.
Click to expand it.
src/plugins/projectexplorer/msvcparser.h
+
2
−
0
View file @
c13f417c
...
...
@@ -46,12 +46,14 @@ public:
MsvcParser
();
virtual
void
stdOutput
(
const
QString
&
line
);
virtual
void
stdError
(
const
QString
&
line
);
private:
Task
::
TaskType
toType
(
int
number
);
QRegExp
m_compileRegExp
;
QRegExp
m_additionalInfoRegExp
;
QRegExp
m_linkRegExp
;
QRegExp
m_nonFileRegExp
;
};
}
// namespace ProjectExplorer
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment