openrw/tests/test_Globals.cpp

12 lines
360 B
C++
Raw Normal View History

#include "test_Globals.hpp"
#include <RWConfig.hpp>
std::string Global::getGamePath() {
2019-01-03 13:59:57 +02:00
std::filesystem::path configPath = RWConfigParser::getDefaultConfigPath() / "openrw.ini";
RWConfigParser cfgParser;
auto [cfgLayer, parseResult] = cfgParser.loadFile(configPath);
BOOST_REQUIRE(parseResult.isValid());
return *cfgLayer.gamedataPath;
}