Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
K
KWSys
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor 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
Rolf Eike Beer
KWSys
Commits
d5363c6a
Commit
d5363c6a
authored
19 years ago
by
Brad King
Browse files
Options
Downloads
Patches
Plain Diff
ENH: Added special test 0 to just run a given command line.
parent
646c2011
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
testProcess.c
+20
-11
20 additions, 11 deletions
testProcess.c
with
20 additions
and
11 deletions
testProcess.c
+
20
−
11
View file @
d5363c6a
...
...
@@ -330,18 +330,14 @@ int main(int argc, const char* argv[])
{
n
=
atoi
(
argv
[
1
]);
}
else
if
(
argc
==
3
)
else
if
(
argc
==
3
&&
strcmp
(
argv
[
1
],
"run"
)
==
0
)
{
n
=
atoi
(
argv
[
2
]);
}
/* Check arguments. */
if
(
n
<
1
||
n
>
7
||
(
argc
==
3
&&
strcmp
(
argv
[
1
],
"run"
)
!=
0
))
{
fprintf
(
stdout
,
"Usage: %s <test number>
\n
"
,
argv
[
0
]);
return
1
;
}
if
(
argc
==
3
)
if
(
n
>=
1
&&
n
<=
7
&&
argc
==
3
)
{
/* This is the child process for a requested test number. */
switch
(
n
)
{
case
1
:
return
test1
(
argc
,
argv
);
...
...
@@ -355,9 +351,9 @@ int main(int argc, const char* argv[])
fprintf
(
stderr
,
"Invalid test number %d.
\n
"
,
n
);
return
1
;
}
if
(
n
>=
0
&&
n
<=
7
)
else
if
(
n
>=
1
&&
n
<=
7
)
{
/* This is the parent process for a requested test number. */
int
states
[
7
]
=
{
kwsysProcess_State_Exited
,
...
...
@@ -427,9 +423,22 @@ int main(int argc, const char* argv[])
#endif
return
r
;
}
else
if
(
argc
>
2
&&
strcmp
(
argv
[
1
],
"0"
)
==
0
)
{
/* This is the special debugging test to run a given command
line. */
const
char
**
cmd
=
argv
+
2
;
int
state
=
kwsysProcess_State_Exited
;
int
exception
=
kwsysProcess_Exception_None
;
int
value
=
0
;
double
timeout
=
0
;
int
r
=
runChild
(
cmd
,
state
,
exception
,
value
,
0
,
1
,
0
,
timeout
,
0
,
1
);
return
r
;
}
else
{
fprintf
(
stderr
,
"Test number out of range
\n
"
);
/* Improper usage. */
fprintf
(
stdout
,
"Usage: %s <test number>
\n
"
,
argv
[
0
]);
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