mirror of
https://github.com/OpenMW/openmw.git
synced 2025-01-29 17:15:34 +00:00
Support custom log level in tests
This commit is contained in:
parent
6a67263d6b
commit
a5d9bb08e0
4 changed files with 19 additions and 4 deletions
|
@ -458,10 +458,14 @@ CUSTOM, PLAYER: useInterface.lua
|
|||
callback.call(1.5, 2.5);
|
||||
EXPECT_EQ(internal::GetCapturedStdout(), "1.5\t2.5\n");
|
||||
|
||||
const Debug::Level level = std::exchange(Log::sMinDebugLevel, Debug::All);
|
||||
|
||||
testing::internal::CaptureStdout();
|
||||
callback.mHiddenData[LuaUtil::ScriptsContainer::sScriptIdKey] = sol::nil;
|
||||
callback.call(1.5, 2.5);
|
||||
EXPECT_EQ(internal::GetCapturedStdout(), "Ignored callback to the removed script some_script.lua\n");
|
||||
|
||||
Log::sMinDebugLevel = level;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,13 +1,16 @@
|
|||
#include <gtest/gtest.h>
|
||||
#include <components/debug/debugging.hpp>
|
||||
#include <components/misc/strings/conversion.hpp>
|
||||
#include <components/settings/parser.hpp>
|
||||
#include <components/settings/values.hpp>
|
||||
|
||||
#include "components/misc/strings/conversion.hpp"
|
||||
#include "components/settings/parser.hpp"
|
||||
#include "components/settings/values.hpp"
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
#include <filesystem>
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
Log::sMinDebugLevel = Debug::getDebugLevel();
|
||||
|
||||
const std::filesystem::path settingsDefaultPath = std::filesystem::path{ OPENMW_PROJECT_SOURCE_DIR } / "files"
|
||||
/ Misc::StringUtils::stringToU8String("settings-default.cfg");
|
||||
|
||||
|
|
|
@ -1,7 +1,11 @@
|
|||
#include <components/debug/debugging.hpp>
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
Log::sMinDebugLevel = Debug::getDebugLevel();
|
||||
|
||||
testing::InitGoogleTest(&argc, argv);
|
||||
return RUN_ALL_TESTS();
|
||||
}
|
||||
|
|
|
@ -1,7 +1,11 @@
|
|||
#include <components/debug/debugging.hpp>
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
Log::sMinDebugLevel = Debug::getDebugLevel();
|
||||
|
||||
testing::InitGoogleTest(&argc, argv);
|
||||
return RUN_ALL_TESTS();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue