test: added tests for gradle utility functions (#892)

This commit is contained in:
Malte Langkabel
2020-01-13 19:26:17 +01:00
committed by GitHub
parent d3b9e46cd9
commit c8dcb193ff
11 changed files with 405 additions and 0 deletions
+14
View File
@@ -5,6 +5,8 @@
// because it interferes with the jni interface that emits such a signal on purpose
#include "ApplicationSettings.h"
#include "language_packages.h"
#include "utilityPathDetection.h"
struct EventListener: Catch::TestEventListenerBase
{
@@ -32,6 +34,18 @@ struct EventListener: Catch::TestEventListenerBase
#else
ApplicationSettings::getInstance()->load(FilePath(L"data/TestSettings.xml"));
#endif
#if BUILD_JAVA_LANGUAGE_PACKAGE
if (ApplicationSettings::getInstance()->getJavaPath().empty())
{
std::shared_ptr<PathDetector> pathDetector = utility::getJavaRuntimePathDetector();
const std::vector<FilePath> paths = pathDetector->getPaths();
if (!paths.empty())
{
ApplicationSettings::getInstance()->setJavaPath(paths.front());
}
}
#endif
}
};