mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-21 09:14:47 +08:00
Improve NonDefault flag dumping.
- Do not require PrintDebugMessages to have information messages. Change-Id: I5fcf8dee73ca193f40ac33d2f68190a22ff60e97 Signed-off-by: Mrozek, Michal <michal.mrozek@intel.com>
This commit is contained in:
@@ -170,7 +170,7 @@ template <typename DataType>
|
||||
void DebugSettingsManager<DebugLevel>::dumpNonDefaultFlag(const char *variableName, const DataType &variableValue, const DataType &defaultValue) {
|
||||
if (variableValue != defaultValue) {
|
||||
const auto variableStringValue = std::to_string(variableValue);
|
||||
printDebugString(DebugManager.flags.PrintDebugMessages.get(), stdout, "Non-default value of debug variable: %s = %s\n", variableName, variableStringValue.c_str());
|
||||
printDebugString(true, stdout, "Non-default value of debug variable: %s = %s\n", variableName, variableStringValue.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -866,6 +866,7 @@ TEST(DebugSettingsManager, givenReaderImplInDebugManagerWhenSettingDifferentRead
|
||||
}
|
||||
|
||||
TEST(DebugSettingsManager, givenPrintDebugSettingsEnabledWhenCallingDumpFlagsThenFlagsAreWrittenToDumpFile) {
|
||||
testing::internal::CaptureStdout();
|
||||
FullyEnabledTestDebugManager debugManager;
|
||||
debugManager.flags.PrintDebugSettings.set(true);
|
||||
debugManager.flags.LoopAtPlatformInitialize.set(true);
|
||||
@@ -884,6 +885,13 @@ TEST(DebugSettingsManager, givenPrintDebugSettingsEnabledWhenCallingDumpFlagsThe
|
||||
#include "debug_variables.inl"
|
||||
#undef DECLARE_DEBUG_VARIABLE
|
||||
std::remove(FullyEnabledTestDebugManager::settingsDumpFileName);
|
||||
std::string output = testing::internal::GetCapturedStdout();
|
||||
ASSERT_NE(0u, output.size());
|
||||
|
||||
EXPECT_NE(std::string::npos, output.find("Non-default value of debug variable: TbxServer = 192.168.0.1"));
|
||||
EXPECT_NE(std::string::npos, output.find("Non-default value of debug variable: LoopAtPlatformInitialize = 1"));
|
||||
EXPECT_NE(std::string::npos, output.find("Non-default value of debug variable: PrintDebugSettings = 1"));
|
||||
EXPECT_NE(std::string::npos, output.find("Non-default value of debug variable: Enable64kbpages = 1"));
|
||||
}
|
||||
|
||||
struct AllocationTypeTestCase {
|
||||
|
||||
Reference in New Issue
Block a user