From b5c8220ccc0c5c93f9d29df46f998201a0afa457 Mon Sep 17 00:00:00 2001 From: Mateusz Hoppe Date: Thu, 19 Dec 2024 17:29:44 +0000 Subject: [PATCH] test: refactor compiler interface tests - prevent loading igc in tests with igc unavailable Signed-off-by: Mateusz Hoppe --- .../compiler_interface/compiler_interface_tests.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/shared/test/unit_test/compiler_interface/compiler_interface_tests.cpp b/shared/test/unit_test/compiler_interface/compiler_interface_tests.cpp index 10a837f049..356774301d 100644 --- a/shared/test/unit_test/compiler_interface/compiler_interface_tests.cpp +++ b/shared/test/unit_test/compiler_interface/compiler_interface_tests.cpp @@ -171,6 +171,8 @@ TEST_F(CompilerInterfaceTest, WhenPreferredIntermediateRepresentationSpecifiedTh TEST_F(CompilerInterfaceTest, whenCompilerIsNotAvailableThenBuildFailsGracefully) { pCompilerInterface->defaultIgc.entryPoint.reset(nullptr); + pCompilerInterface->failLoadIgc = true; + TranslationOutput translationOutput = {}; auto err = pCompilerInterface->build(*pDevice, inputArgs, translationOutput); EXPECT_EQ(TranslationOutput::ErrorCode::compilerNotAvailable, err); @@ -259,6 +261,7 @@ TEST_F(CompilerInterfaceTest, whenCompilerIsNotAvailableThenCompileFailsGraceful gEnvironment->fclPushDebugVars(fclDebugVars); pCompilerInterface->defaultIgc.entryPoint->Release(); pCompilerInterface->setIgcMain(nullptr); + pCompilerInterface->failLoadIgc = true; TranslationOutput translationOutput = {}; auto err = pCompilerInterface->compile(*pDevice, inputArgs, translationOutput); EXPECT_EQ(TranslationOutput::ErrorCode::compilerNotAvailable, err); @@ -324,6 +327,7 @@ TEST_F(CompilerInterfaceTest, whenCompilerIsNotAvailableThenLinkFailsGracefully) gEnvironment->igcPushDebugVars(igcDebugVars); pCompilerInterface->defaultIgc.entryPoint->Release(); pCompilerInterface->setIgcMain(nullptr); + pCompilerInterface->failLoadIgc = true; TranslationOutput translationOutput = {}; auto err = pCompilerInterface->link(*pDevice, inputArgs, translationOutput); EXPECT_EQ(TranslationOutput::ErrorCode::compilerNotAvailable, err); @@ -390,6 +394,8 @@ TEST_F(CompilerInterfaceTest, whenCompilerIsNotAvailableThenCreateLibraryFailsGr gEnvironment->igcPushDebugVars(igcDebugVars); pCompilerInterface->defaultIgc.entryPoint->Release(); pCompilerInterface->setIgcMain(nullptr); + pCompilerInterface->failLoadIgc = true; + TranslationOutput translationOutput = {}; auto err = pCompilerInterface->createLibrary(*pDevice, inputArgs, translationOutput); EXPECT_EQ(TranslationOutput::ErrorCode::compilerNotAvailable, err); @@ -1058,6 +1064,8 @@ TEST_F(CompilerInterfaceTest, GivenCompilerWhenGettingCompilerAvailabilityThenCo TEST_F(CompilerInterfaceTest, whenCompilerIsNotAvailableThenGetSipKernelBinaryFailsGracefully) { pCompilerInterface->defaultIgc.entryPoint.reset(); + pCompilerInterface->failLoadIgc = true; + std::vector sipBinary; std::vector stateAreaHeader; auto err = pCompilerInterface->getSipKernelBinary(*this->pDevice, SipKernelType::csr, sipBinary, stateAreaHeader); @@ -1171,6 +1179,8 @@ TEST_F(CompilerInterfaceTest, whenRequestingInvalidSipKernelBinaryThenErrorIsRet TEST_F(CompilerInterfaceTest, whenCompilerIsNotAvailableThenGetSpecializationConstantsFails) { pCompilerInterface->defaultIgc.entryPoint.reset(); + pCompilerInterface->failLoadIgc = true; + NEO::SpecConstantInfo sci; auto err = pCompilerInterface->getSpecConstantsInfo(*pDevice, ArrayRef{}, sci); EXPECT_EQ(TranslationOutput::ErrorCode::compilerNotAvailable, err);