summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-10-09 20:19:48 +0300
committerAndrei Karas <akaras@inbox.ru>2017-10-09 20:19:48 +0300
commitcd6b02aed24b4f9e2899bb9b58ff84a2afe0896d (patch)
tree3f8f5b88ffa1ff6f01bafa5149364d4eb9f8fa59 /src
parent30ba0c39fa249a3f5588e1299e5618f5f168097a (diff)
downloadplus-cd6b02aed24b4f9e2899bb9b58ff84a2afe0896d.tar.gz
plus-cd6b02aed24b4f9e2899bb9b58ff84a2afe0896d.tar.bz2
plus-cd6b02aed24b4f9e2899bb9b58ff84a2afe0896d.tar.xz
plus-cd6b02aed24b4f9e2899bb9b58ff84a2afe0896d.zip
Add support for configure parameter for override home dir for unit tests.
New configure parameter: --with-unittestsdir=path
Diffstat (limited to 'src')
-rw-r--r--src/fs/paths.cpp7
1 files changed, 7 insertions, 0 deletions
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