Commit 83ffd1a6 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen
Browse files

tests: Add a -v parameter to samples tests

parent 63c4c1b8
#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() );
}
......
......@@ -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();
}
......
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