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
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
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
Mattias Ellert
CMake
Commits
2eb9d09e
Commit
2eb9d09e
authored
23 years ago
by
Amitha Perera
Browse files
Options
Downloads
Patches
Plain Diff
BUG: ADD_TEST now only does stuff if ENABLE_TESTING has been run.
parent
538ff79e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Source/cmAddTestCommand.cxx
+22
-18
22 additions, 18 deletions
Source/cmAddTestCommand.cxx
Source/cmAddTestCommand.h
+3
-1
3 additions, 1 deletion
Source/cmAddTestCommand.h
with
25 additions
and
19 deletions
Source/cmAddTestCommand.cxx
+
22
−
18
View file @
2eb9d09e
...
...
@@ -78,28 +78,32 @@ void cmAddTestCommand::FinalPass()
fname
+=
"/"
;
fname
+=
"DartTestfile.txt"
;
// Open the output Testfile
std
::
ofstream
fout
(
fname
.
c_str
(),
std
::
ios
::
app
);
if
(
!
fout
)
// If the file doesn't exist, then ENABLE_TESTING hasn't been run
if
(
cmSystemTools
::
FileExists
(
fname
.
c_str
())
)
{
cmSystemTools
::
Error
(
"Error Writing "
,
fname
.
c_str
());
return
;
}
// Open the output Testfile
std
::
ofstream
fout
(
fname
.
c_str
(),
std
::
ios
::
app
);
if
(
!
fout
)
{
cmSystemTools
::
Error
(
"Error Writing "
,
fname
.
c_str
());
return
;
}
std
::
vector
<
std
::
string
>::
iterator
it
;
std
::
vector
<
std
::
string
>::
iterator
it
;
// for each arg in the test
fout
<<
"ADD_TEST("
;
it
=
m_Args
.
begin
();
fout
<<
(
*
it
).
c_str
();
++
it
;
for
(;
it
!=
m_Args
.
end
();
++
it
)
{
fout
<<
" "
<<
(
*
it
).
c_str
();
}
fout
<<
")"
<<
std
::
endl
;
fout
.
close
();
fout
<<
"ADD_TEST("
;
it
=
m_Args
.
begin
();
fout
<<
(
*
it
).
c_str
();
++
it
;
for
(;
it
!=
m_Args
.
end
();
++
it
)
{
fout
<<
" "
<<
(
*
it
).
c_str
();
}
fout
<<
")"
<<
std
::
endl
;
fout
.
close
();
}
return
;
}
This diff is collapsed.
Click to expand it.
Source/cmAddTestCommand.h
+
3
−
1
View file @
2eb9d09e
...
...
@@ -92,7 +92,9 @@ public:
{
return
"ADD_TEST(testname exename arg1 arg2 arg3 ...)
\n
"
"This command adds a test target to the current directory. "
"If the ENABLE_TESTING command has been run, this command adds a"
"test target to the current directory. If ENABLE_TESTING has not"
"been run, this command does nothing.
\n
"
"The tests are run by the testing subsystem by executing exename "
"with the specified arguments. exename can be either an executable "
"built by built by this project or an arbitrary executable on the "
...
...
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