mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00
Debug flag support to override revisionId in ocloc
Signed-off-by: Bartosz Dunajski <bartosz.dunajski@intel.com>
This commit is contained in:

committed by
Compute-Runtime-Automation

parent
f02bd9f58c
commit
537200dac5
@ -1440,6 +1440,28 @@ TEST(OfflineCompilerTest, givenHexadecimalRevisionIdWhenCompilerIsInitializedThe
|
||||
EXPECT_EQ(mockOfflineCompiler->hwInfo.platform.usRevId, 17);
|
||||
}
|
||||
|
||||
TEST(OfflineCompilerTest, givenDebugVariableSetWhenInitializingThenOverrideRevision) {
|
||||
DebugManagerStateRestore stateRestore;
|
||||
DebugManager.flags.OverrideRevision.set(123);
|
||||
|
||||
auto mockOfflineCompiler = std::unique_ptr<MockOfflineCompiler>(new MockOfflineCompiler());
|
||||
ASSERT_NE(nullptr, mockOfflineCompiler);
|
||||
|
||||
std::vector<std::string> argv = {
|
||||
"ocloc",
|
||||
"-q",
|
||||
"-file",
|
||||
"test_files/copybuffer.cl",
|
||||
"-device",
|
||||
gEnvironment->devicePrefix.c_str(),
|
||||
"-revision_id",
|
||||
"0x11"};
|
||||
|
||||
int retVal = mockOfflineCompiler->initialize(argv.size(), argv);
|
||||
EXPECT_EQ(OfflineCompiler::ErrorCode::SUCCESS, retVal);
|
||||
EXPECT_EQ(mockOfflineCompiler->hwInfo.platform.usRevId, 123);
|
||||
}
|
||||
|
||||
TEST(OfflineCompilerTest, givenDecimalRevisionIdWhenCompilerIsInitializedThenPassItToHwInfo) {
|
||||
auto mockOfflineCompiler = std::unique_ptr<MockOfflineCompiler>(new MockOfflineCompiler());
|
||||
ASSERT_NE(nullptr, mockOfflineCompiler);
|
||||
|
Reference in New Issue
Block a user