fix: Fail device init if kernel debugging is misconfigured

Also print error to stderr

Related-to: GSD-10780

Signed-off-by: Brandon Yates <brandon.yates@intel.com>
This commit is contained in:
Brandon Yates
2025-03-07 13:45:49 +00:00
committed by Compute-Runtime-Automation
parent 80168b194f
commit b0c92ea425
7 changed files with 44 additions and 10 deletions

View File

@@ -1983,7 +1983,7 @@ TEST_F(DeviceTests, GivenDebuggingEnabledWhenDeviceIsInitializedThenL0DebuggerIs
EXPECT_NE(nullptr, device->getL0Debugger());
}
TEST_F(DeviceTests, givenDebuggerRequestedByUserAndNotAvailableWhenDeviceIsInitializedThenErrorIsPrintedButNotReturned) {
TEST_F(DeviceTests, givenDebuggerRequestedByUserAndNotAvailableWhenDeviceIsInitializedThenDeviceIsNullAndErrorIsPrinted) {
extern bool forceCreateNullptrDebugger;
VariableBackup backupForceCreateNullptrDebugger{&forceCreateNullptrDebugger, true};
@@ -1998,7 +1998,7 @@ TEST_F(DeviceTests, givenDebuggerRequestedByUserAndNotAvailableWhenDeviceIsIniti
auto output = testing::internal::GetCapturedStderr();
EXPECT_EQ(std::string("Debug mode is not enabled in the system.\n"), output);
EXPECT_EQ(nullptr, device->getL0Debugger());
EXPECT_EQ(nullptr, device);
}
TEST_F(DeviceTests, givenDebuggerRequestedByUserWhenDeviceWithSubDevicesCreatedThenInitializeDebuggerOncePerRootDevice) {