From cd6b02aed24b4f9e2899bb9b58ff84a2afe0896d Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 9 Oct 2017 20:19:48 +0300 Subject: Add support for configure parameter for override home dir for unit tests. New configure parameter: --with-unittestsdir=path --- src/fs/paths.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/fs') diff --git a/src/fs/paths.cpp b/src/fs/paths.cpp index 4eaf6ac60..5698ffa7d 100644 --- a/src/fs/paths.cpp +++ b/src/fs/paths.cpp @@ -231,6 +231,12 @@ std::string getPicturesDir() std::string getHomePath() { +#if defined(UNITTESTS) && defined(UNITESTSDIR) + std::string dir = UNITESTSDIR; + if (findLast(dir, std::string(dirSeparator)) == false) + dir += dirSeparator; + return dir; +#else // defined(UNITTESTS) && defined(UNITESTSDIR) #ifdef WIN32 return getSpecialFolderLocation(CSIDL_LOCAL_APPDATA); #else @@ -252,6 +258,7 @@ std::string getHomePath() dir += dirSeparator; return dir; #endif // WIN32 +#endif // defined(UNITTESTS) && defined(UNITESTSDIR) } #ifdef ANDROID -- cgit v1.2.3-70-g09d2