Skip to content

Commit 0bdce1c

Browse files
agrubbaCompute-Runtime-Automation
authored andcommitted
test: Mock filesystem in ults 12/n
Related-To: NEO-15069 Signed-off-by: Arek G <arkadiusz.grubba@intel.com>
1 parent 198f1ea commit 0bdce1c

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

‎opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_4_tests.cpp‎

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,14 @@
66
*/
77

88
#include "shared/source/command_stream/wait_status.h"
9+
#include "shared/source/helpers/compiler_product_helper.h"
910
#include "shared/source/helpers/file_io.h"
1011
#include "shared/source/helpers/timestamp_packet.h"
1112
#include "shared/source/utilities/wait_util.h"
1213
#include "shared/test/common/libult/ult_command_stream_receiver.h"
1314
#include "shared/test/common/mocks/mock_command_stream_receiver.h"
1415
#include "shared/test/common/mocks/mock_timestamp_container.h"
16+
#include "shared/test/common/mocks/mock_zebin_wrapper.h"
1517
#include "shared/test/common/mocks/ult_device_factory.h"
1618
#include "shared/test/common/test_macros/hw_test.h"
1719

@@ -32,7 +34,7 @@ using namespace NEO;
3234
using MultiRootDeviceCommandStreamReceiverBufferTests = MultiRootDeviceFixture;
3335

3436
HWTEST_F(MultiRootDeviceCommandStreamReceiverBufferTests, givenMultipleEventInMultiRootDeviceEnvironmentWhenTheyArePassedToEnqueueWithSubmissionThenCsIsWaitingForEventsFromPreviousDevices) {
35-
USE_REAL_FILE_SYSTEM();
37+
FORBID_REAL_FILE_SYSTEM_CALLS();
3638

3739
using MI_SEMAPHORE_WAIT = typename FamilyType::MI_SEMAPHORE_WAIT;
3840
cl_int retVal = 0;
@@ -42,9 +44,14 @@ HWTEST_F(MultiRootDeviceCommandStreamReceiverBufferTests, givenMultipleEventInMu
4244
auto pCmdQ1 = context->getSpecialQueue(1u);
4345
auto pCmdQ2 = context->getSpecialQueue(2u);
4446

45-
std::unique_ptr<MockProgram> program(Program::createBuiltInFromSource<MockProgram>("FillBufferBytes", context.get(), context->getDevices(), &retVal));
47+
MockZebinWrapper<>::Descriptor desc{};
48+
desc.isStateless = NEO::CompilerProductHelper::create(defaultHwInfo->platform.eProductFamily)->isForceToStatelessRequired();
49+
MockZebinWrapper mockZebin{*defaultHwInfo, desc};
50+
mockZebin.setAsMockCompilerReturnedBinary();
51+
52+
std::unique_ptr<MockProgram> program(Program::createBuiltInFromSource<MockProgram>(mockZebin.kernelName, context.get(), context->getDevices(), &retVal));
4653
program->build(program->getDevices(), nullptr);
47-
std::unique_ptr<MockKernel> kernel(Kernel::create<MockKernel>(program.get(), program->getKernelInfoForKernel("FillBufferBytes"), *context->getDevice(0), retVal));
54+
std::unique_ptr<MockKernel> kernel(Kernel::create<MockKernel>(program.get(), program->getKernelInfoForKernel(mockZebin.kernelName), *context->getDevice(0), retVal));
4855
ASSERT_EQ(CL_SUCCESS, retVal);
4956

5057
size_t svmSize = 4096;

0 commit comments

Comments
 (0)