mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 06:49:52 +08:00
test: refactor compiler interface tests
- prevent loading igc in tests with igc unavailable Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
c96ad9dcbf
commit
b5c8220ccc
@@ -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<char> sipBinary;
|
||||
std::vector<char> 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<char>{}, sci);
|
||||
EXPECT_EQ(TranslationOutput::ErrorCode::compilerNotAvailable, err);
|
||||
|
||||
Reference in New Issue
Block a user