Skip to content

Commit

Permalink
#5430: Add getter to return the base resource path
Browse files Browse the repository at this point in the history
  • Loading branch information
codereader committed Nov 23, 2020
1 parent 117beb6 commit fd2fdce
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions test/TestContext.h
Expand Up @@ -43,21 +43,25 @@ class TestContext :
}
}

// Returns the path to the test/resources/tdm/ folder shipped with the DR sources
virtual std::string getTestProjectPath() const
// Returns the path to the test/resources/tdm/ folder shipped with the DR sources
virtual std::string getTestProjectPath() const
{
return getTestResourcePath() + "tdm/";
}

virtual std::string getTestResourcePath() const
{
#if defined(POSIX)
#if defined(TESTRESOURCEDIR) && !defined(ENABLE_RELOCATION)
fs::path testResourcePath(TESTRESOURCEDIR);
testResourcePath /= "tdm/";
#else
// make check will compile the test binary to $top_builddir/test/.libs/
fs::path testResourcePath = getApplicationPath();
testResourcePath /= "../../test/resources/tdm/";
testResourcePath /= "../../test/resources/";
#endif
#else
fs::path testResourcePath = getApplicationPath();
testResourcePath /= "../test/resources/tdm/";
testResourcePath /= "../test/resources/";
#endif
return os::standardPathWithSlash(testResourcePath.string());
}
Expand Down

0 comments on commit fd2fdce

Please sign in to comment.