Commit 8fd509cf authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen
Browse files

tests: samples: Add an extra verbose mode

parent 0a4f882a
#include "Tester.h"
extern bool Verbose;
extern bool ExtraVerbose;
MockCallback::MockCallback()
{
......@@ -42,8 +43,11 @@ void Tests::SetUp()
unlink("test.db");
m_cb.reset( new MockCallback );
m_ml.reset( new MediaLibrary );
if ( Verbose == true )
if ( ExtraVerbose == true )
m_ml->setVerbosity( LogLevel::Debug );
else if ( Verbose == true )
m_ml->setVerbosity( LogLevel::Info );
m_ml->initialize( "test.db", "/tmp", m_cb.get() );
}
......
......@@ -3,6 +3,7 @@
static std::string SamplesDirectory = ".";
static std::string TestCaseDirectory = SRC_DIR "/test/samples/testcases";
bool Verbose = false;
bool ExtraVerbose = false;
static const char* testCases[] = {
"featuring",
......@@ -87,6 +88,7 @@ int main(int ac, char** av)
const std::string samplesArg = "--samples-directory=";
const std::string testCasesArg = "--testcases-directory=";
const std::string verboseArg = "-v";
const std::string extraVerboseArg = "-vv";
for ( auto i = 1; i < ac; ++i )
{
if ( strncmp( samplesArg.c_str(), av[i], samplesArg.length() ) == 0 )
......@@ -95,6 +97,8 @@ int main(int ac, char** av)
TestCaseDirectory = av[i] + testCasesArg.size();
else if ( av[i] == verboseArg )
Verbose = true;
else if ( av[i] == extraVerboseArg )
ExtraVerbose = true;
}
return RUN_ALL_TESTS();
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment