openmw/apps/components_tests/main.cpp

34 lines
1,015 B
C++
Raw Permalink Normal View History

2024-06-15 13:53:13 +02:00
#include <components/debug/debugging.hpp>
#include <components/misc/strings/conversion.hpp>
#include <components/settings/parser.hpp>
#include <components/settings/values.hpp>
#include <components/testing/util.hpp>
2024-06-15 13:53:13 +02:00
#include <gtest/gtest.h>
2023-06-15 21:59:06 +02:00
#include <filesystem>
2022-09-22 21:26:05 +03:00
int main(int argc, char** argv)
{
2024-06-15 13:53:13 +02:00
Log::sMinDebugLevel = Debug::getDebugLevel();
2023-06-15 21:59:06 +02:00
const std::filesystem::path settingsDefaultPath = std::filesystem::path{ OPENMW_PROJECT_SOURCE_DIR } / "files"
/ Misc::StringUtils::stringToU8String("settings-default.cfg");
Settings::SettingsFileParser parser;
parser.loadSettingsFile(settingsDefaultPath, Settings::Manager::mDefaultSettings);
Settings::StaticValues::initDefaults();
Settings::Manager::mUserSettings = Settings::Manager::mDefaultSettings;
Settings::StaticValues::init();
testing::InitGoogleTest(&argc, argv);
const int result = RUN_ALL_TESTS();
if (result == 0)
std::filesystem::remove_all(TestingOpenMW::outputDir());
return result;
}