Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
CMake
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
Service Desk
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
Alexander Neundorf
CMake
Commits
066cea22
Commit
066cea22
authored
22 years ago
by
Andy Cedilnik
Browse files
Options
Downloads
Patches
Plain Diff
More cleanups, fix prexontext and log number
parent
461a3d20
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Source/ctest.cxx
+24
-34
24 additions, 34 deletions
Source/ctest.cxx
with
24 additions
and
34 deletions
Source/ctest.cxx
+
24
−
34
View file @
066cea22
...
...
@@ -460,11 +460,11 @@ int ctest::BuildDirectory()
{
std
::
cerr
<<
"Error(s) when building project"
<<
std
::
endl
;
}
// To do:
// Add parsing of output for errors and warnings.
cmCTestBuildErrorWarning
cerw
;
int
cc
;
// Parsing of output for errors and warnings.
std
::
vector
<
cmStdString
>
lines
;
cmSystemTools
::
Split
(
output
.
c_str
(),
lines
);
std
::
ofstream
ofs
;
if
(
this
->
OpenFile
(
"Temporary"
,
"LastBuild.log"
,
ofs
)
)
...
...
@@ -472,16 +472,19 @@ int ctest::BuildDirectory()
ofs
<<
output
;
ofs
.
close
();
}
else
{
std
::
cerr
<<
"Cannot create LastBuild.log file"
<<
std
::
endl
;
}
std
::
vector
<
cmStdString
>
lines
;
cmSystemTools
::
Split
(
output
.
c_str
(),
lines
);
// Lines are marked:
// 0 - nothing
// 1 - error
// > 1 - warning
std
::
vector
<
int
>
markedLines
(
lines
.
size
(),
0
);
cmCTestBuildErrorWarning
cerw
;
int
cc
;
// Errors
for
(
cc
=
0
;
cmCTestErrorMatches
[
cc
];
cc
++
)
{
...
...
@@ -508,6 +511,7 @@ int ctest::BuildDirectory()
}
}
}
// Errors exceptions
for
(
cc
=
0
;
cmCTestErrorExceptions
[
cc
];
cc
++
)
{
cmRegularExpression
re
(
cmCTestErrorExceptions
[
cc
]);
...
...
@@ -523,6 +527,7 @@ int ctest::BuildDirectory()
}
}
}
// Warning exceptions
for
(
cc
=
0
;
cmCTestWarningExceptions
[
cc
];
cc
++
)
{
cmRegularExpression
re
(
cmCTestWarningExceptions
[
cc
]);
...
...
@@ -560,13 +565,18 @@ int ctest::BuildDirectory()
}
if
(
found
)
{
errorwarning
.
m_LogLine
=
static_cast
<
int
>
(
kk
);
errorwarning
.
m_LogLine
=
static_cast
<
int
>
(
kk
+
1
);
errorwarning
.
m_Text
=
lines
[
kk
];
errorwarning
.
m_PreContext
=
""
;
errorwarning
.
m_PostContext
=
""
;
std
::
vector
<
int
>::
size_type
jj
;
std
::
vector
<
int
>::
size_type
ll
=
0
;
if
(
kk
>
6
)
{
ll
=
kk
-
6
;
}
for
(
jj
=
kk
;
jj
>
0
&&
jj
>
kk
-
6
/* && markedLines[jj] == 0 */
;
jj
>
0
&&
jj
>
ll
/* && markedLines[jj] == 0 */
;
jj
--
);
for
(;
jj
<
kk
;
jj
++
)
{
...
...
@@ -584,6 +594,7 @@ int ctest::BuildDirectory()
if
(
!
this
->
OpenFile
(
""
,
"Build.xml"
,
ofs
)
)
{
std
::
cerr
<<
"Cannot create build XML file"
<<
std
::
endl
;
return
1
;
}
this
->
GenerateDartBuildOutput
(
ofs
,
errorsWarnings
);
...
...
@@ -621,7 +632,6 @@ bool ctest::OpenFile(const std::string& path,
stream
.
open
(
filename
.
c_str
());
if
(
!
stream
)
{
std
::
cerr
<<
"Cannot create build XML file"
<<
std
::
endl
;
return
false
;
}
return
true
;
...
...
@@ -661,8 +671,8 @@ void ctest::GenerateDartBuildOutput(std::ostream& os,
os
<<
"
\t\t
<SourceLineNumber>"
<<
cm
->
m_LineNumber
<<
"</SourceLineNumber>"
<<
std
::
endl
;
}
os
<<
"
\t\t
<PreContext>"
<<
cm
->
m_PreContext
<<
"
\n
</PreContext>
\n
"
<<
"
\t\t
<PostContext>"
<<
cm
->
m_PostContext
<<
"
\n
</PostContext>
\n
"
os
<<
"
\t\t
<PreContext>"
<<
cm
->
m_PreContext
<<
"</PreContext>
\n
"
<<
"
\t\t
<PostContext>"
<<
cm
->
m_PostContext
<<
"</PostContext>
\n
"
<<
"
\t\t
<RepeatCount>0</RepeatCount>
\n
"
<<
"</"
<<
(
cm
->
m_Error
?
"Error"
:
"Warning"
)
<<
">
\n\n
"
<<
std
::
endl
;
...
...
@@ -884,28 +894,8 @@ int ctest::TestDirectory()
if
(
m_DartMode
)
{
std
::
string
testingDir
=
m_ToplevelPath
+
"/Testing/CDart"
;
if
(
cmSystemTools
::
FileExists
(
testingDir
.
c_str
())
)
{
if
(
!
cmSystemTools
::
FileIsDirectory
(
testingDir
.
c_str
())
)
{
std
::
cerr
<<
"File "
<<
testingDir
<<
" is in the place of the testing directory"
<<
std
::
endl
;
return
1
;
}
}
else
{
if
(
!
cmSystemTools
::
MakeDirectory
(
testingDir
.
c_str
())
)
{
std
::
cerr
<<
"Cannot create directory "
<<
testingDir
<<
std
::
endl
;
return
1
;
}
}
std
::
string
testxml
=
testingDir
+
"/Test.xml"
;
std
::
ofstream
ofs
(
testxml
.
c_str
());
if
(
!
ofs
)
std
::
ofstream
ofs
;
if
(
!
this
->
OpenFile
(
""
,
"Test.xml"
,
ofs
)
)
{
std
::
cerr
<<
"Cannot create testing XML file"
<<
std
::
endl
;
return
1
;
...
...
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