Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
VideoLAN
medialibrary
Commits
83ffd1a6
Commit
83ffd1a6
authored
Nov 12, 2015
by
Hugo Beauzée-Luyssen
Browse files
tests: Add a -v parameter to samples tests
parent
63c4c1b8
Changes
2
Hide whitespace changes
Inline
Side-by-side
test/samples/Tester.cpp
View file @
83ffd1a6
#include
"Tester.h"
extern
bool
Verbose
;
MockCallback
::
MockCallback
()
{
// Start locked. The locked will be released when waiting for parsing to be completed
...
...
@@ -31,7 +33,8 @@ void Tests::SetUp()
unlink
(
"test.db"
);
m_cb
.
reset
(
new
MockCallback
);
m_ml
.
reset
(
new
MediaLibrary
);
m_ml
->
setVerbosity
(
LogLevel
::
Error
);
if
(
Verbose
==
true
)
m_ml
->
setVerbosity
(
LogLevel
::
Debug
);
m_ml
->
initialize
(
"test.db"
,
"/tmp"
,
m_cb
.
get
()
);
}
...
...
test/samples/main.cpp
View file @
83ffd1a6
...
...
@@ -2,6 +2,7 @@
static
std
::
string
SamplesDirectory
=
"."
;
static
std
::
string
TestCaseDirectory
=
SRC_DIR
"/test/samples/testcases"
;
bool
Verbose
=
false
;
static
const
char
*
testCases
[]
=
{
"featuring"
,
...
...
@@ -85,12 +86,15 @@ int main(int ac, char** av)
::
testing
::
InitGoogleTest
(
&
ac
,
av
);
const
std
::
string
samplesArg
=
"--samples-directory="
;
const
std
::
string
testCasesArg
=
"--testcases-directory="
;
const
std
::
string
verboseArg
=
"-v"
;
for
(
auto
i
=
1
;
i
<
ac
;
++
i
)
{
if
(
strncmp
(
samplesArg
.
c_str
(),
av
[
i
],
samplesArg
.
length
()
)
==
0
)
SamplesDirectory
=
av
[
i
]
+
samplesArg
.
size
();
else
if
(
strncmp
(
testCasesArg
.
c_str
(),
av
[
i
],
testCasesArg
.
length
()
)
==
0
)
TestCaseDirectory
=
av
[
i
]
+
testCasesArg
.
size
();
else
if
(
av
[
i
]
==
verboseArg
)
Verbose
=
true
;
}
return
RUN_ALL_TESTS
();
}
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment