Load TestSuite.xml configuration file relative to POCO_BASE and not

relative to the path of the testsuite executable.

Signed-off-by: FrancisANDRE <zosrothko@orange.fr>
This commit is contained in:
FrancisANDRE 2015-12-07 15:16:33 +01:00
parent 95f1a7c30d
commit 627f76232c

View File

@ -14,6 +14,7 @@
#include "CppUnit/TestRunner.h"
#include "NetSSLTestSuite.h"
#include "Poco/Path.h"
#include "Poco/Util/Application.h"
#include "Poco/Net/HTTPStreamFactory.h"
#include "Poco/Net/HTTPSStreamFactory.h"
@ -52,7 +53,17 @@ public:
protected:
void initialize(Poco::Util::Application& self)
{
loadConfiguration(); // load default configuration files, if present
std::string pocoBase(Poco::Environment::get("POCO_BASE"));
if (pocoBase.empty())
throw Poco::LogicException("POCO_BASE should be defined");
Poco::Path configPath(pocoBase);
configPath.makeDirectory();
configPath.pushDirectory("NetSSL_OpenSSL");
configPath.pushDirectory("testsuite");
configPath.setFileName("TestSuite.xml");
loadConfiguration(configPath.toString());
Poco::Util::Application::initialize(self);
}