Commit 5fccc43c authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

tests: samples: Pass an absolute path to discover

This allows us to pass a unix path that will be converted as a wine
path, without cluttering the actual code.

(cherry picked from commit 7de06348)
Signed-off-by: 's avatarHugo Beauzée-Luyssen <hugo@beauzee.fr>
parent 74a93351
...@@ -25,6 +25,8 @@ ...@@ -25,6 +25,8 @@
#endif #endif
#include "Tester.h" #include "Tester.h"
#include "utils/Filename.h"
#include "utils/Directory.h"
static std::string TestDirectory = SRC_DIR "/test/samples/"; static std::string TestDirectory = SRC_DIR "/test/samples/";
static std::string ForcedTestDirectory; static std::string ForcedTestDirectory;
...@@ -73,11 +75,10 @@ TEST_P( Tests, Parse ) ...@@ -73,11 +75,10 @@ TEST_P( Tests, Parse )
{ {
// Quick and dirty check to ensure we're discovering something that exists // Quick and dirty check to ensure we're discovering something that exists
auto samplesDir = testDir + "samples/" + input[i].GetString(); auto samplesDir = testDir + "samples/" + input[i].GetString();
struct stat s; ASSERT_TRUE( utils::fs::isDirectory( samplesDir ) );
auto res = stat( samplesDir.c_str(), &s ); samplesDir = utils::fs::toAbsolute( samplesDir );
ASSERT_EQ( 0, res );
m_ml->discover( "file://" + samplesDir ); m_ml->discover( utils::file::toMrl( samplesDir ) );
} }
ASSERT_TRUE( m_cb->waitForParsingComplete() ); ASSERT_TRUE( m_cb->waitForParsingComplete() );
...@@ -103,11 +104,10 @@ TEST_P( ResumeTests, Parse ) ...@@ -103,11 +104,10 @@ TEST_P( ResumeTests, Parse )
{ {
// Quick and dirty check to ensure we're discovering something that exists // Quick and dirty check to ensure we're discovering something that exists
auto samplesDir = testDir + "samples/" + input[i].GetString(); auto samplesDir = testDir + "samples/" + input[i].GetString();
struct stat s; ASSERT_TRUE( utils::fs::isDirectory( samplesDir ) );
auto res = stat( samplesDir.c_str(), &s ); samplesDir = utils::fs::toAbsolute( samplesDir );
ASSERT_EQ( 0, res );
m_ml->discover( "file://" + samplesDir ); m_ml->discover( utils::file::toMrl( samplesDir ) );
} }
ASSERT_TRUE( m_cb->waitForDiscoveryComplete() ); ASSERT_TRUE( m_cb->waitForDiscoveryComplete() );
auto testMl = static_cast<MediaLibraryResumeTest*>( m_ml.get() ); auto testMl = static_cast<MediaLibraryResumeTest*>( m_ml.get() );
...@@ -136,11 +136,10 @@ TEST_P( ResumeTests, Rescan ) ...@@ -136,11 +136,10 @@ TEST_P( ResumeTests, Rescan )
{ {
// Quick and dirty check to ensure we're discovering something that exists // Quick and dirty check to ensure we're discovering something that exists
auto samplesDir = testDir + "samples/" + input[i].GetString(); auto samplesDir = testDir + "samples/" + input[i].GetString();
struct stat s; ASSERT_TRUE( utils::fs::isDirectory( samplesDir ) );
auto res = stat( samplesDir.c_str(), &s ); samplesDir = utils::fs::toAbsolute( samplesDir );
ASSERT_EQ( 0, res );
m_ml->discover( "file://" + samplesDir ); m_ml->discover( utils::file::toMrl( samplesDir ) );
} }
ASSERT_TRUE( m_cb->waitForDiscoveryComplete() ); ASSERT_TRUE( m_cb->waitForDiscoveryComplete() );
auto testMl = static_cast<MediaLibraryResumeTest*>( m_ml.get() ); auto testMl = static_cast<MediaLibraryResumeTest*>( m_ml.get() );
......
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