Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dlib
Commits
76a65c77
Commit
76a65c77
authored
Mar 18, 2019
by
Davis King
Browse files
Added option to give --no_ to exclude a unit test from --runall.
parent
eb686ec7
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
4 deletions
+9
-4
dlib/test/main.cpp
dlib/test/main.cpp
+9
-4
No files found.
dlib/test/main.cpp
View file @
76a65c77
...
...
@@ -39,6 +39,8 @@ int main (int argc, char** argv)
{
tester
&
test
=
*
testers
().
element
().
value
();
parser
.
add_option
(
test
.
cmd_line_switch
(),
test
.
description
(),
test
.
num_of_args
());
if
(
test
.
num_of_args
()
==
0
)
parser
.
add_option
(
"no_"
+
test
.
cmd_line_switch
(),
"Don't run this option when using --runall."
);
}
parser
.
parse
(
argc
,
argv
);
...
...
@@ -117,10 +119,13 @@ int main (int argc, char** argv)
// run the test for this option as many times as the user has requested.
for
(
unsigned
long
j
=
0
;
j
<
parser
.
option
(
"runall"
).
count
()
+
opt
.
count
();
++
j
)
{
// quit this loop if this option has arguments and this round through the loop is
// from the runall option being present.
if
(
test
.
num_of_args
()
>
0
&&
j
==
opt
.
count
())
// If this round through the loop is from the runall option being present.
if
(
j
==
opt
.
count
())
{
// Don't run options that take arguments or have had --no_ applied to them.
if
(
test
.
num_of_args
()
>
0
||
parser
.
option
(
"no_"
+
test
.
cmd_line_switch
()))
break
;
}
if
(
be_verbose
)
cout
<<
"Running "
<<
test
.
cmd_line_switch
()
<<
" "
<<
flush
;
...
...
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