Add TBX mode support to L0 AubTests

Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
This commit is contained in:
Mateusz Hoppe
2021-11-09 21:57:16 +00:00
committed by Compute-Runtime-Automation
parent 5223ece08b
commit c8ba0391e5
3 changed files with 32 additions and 1 deletions

View File

@@ -7,13 +7,16 @@
#include "level_zero/core/test/aub_tests/fixtures/aub_fixture.h"
#include "shared/source/command_stream/tbx_command_stream_receiver_hw.h"
#include "shared/source/helpers/api_specific_config.h"
#include "shared/test/common/mocks/mock_device.h"
#include "shared/test/unit_test/tests_configuration.h"
#include "level_zero/core/test/unit_tests/mocks/mock_cmdlist.h"
#include "level_zero/core/test/unit_tests/mocks/mock_driver_handle.h"
#include "gtest/gtest.h"
#include "test_mode.h"
namespace L0 {
AUBFixtureL0::AUBFixtureL0() = default;
@@ -50,7 +53,12 @@ void AUBFixtureL0::SetUp(const NEO::HardwareInfo *hardwareInfo) {
neoDevice = NEO::MockDevice::createWithExecutionEnvironment<NEO::MockDevice>(&hwInfo, executionEnvironment, 0u);
this->csr = NEO::AUBCommandStreamReceiver::create(strfilename.str(), true, *executionEnvironment, 0, neoDevice->getDeviceBitfield());
if (NEO::testMode == NEO::TestMode::AubTestsWithTbx) {
this->csr = NEO::TbxCommandStreamReceiver::create(strfilename.str(), true, *executionEnvironment, 0, neoDevice->getDeviceBitfield());
} else {
this->csr = NEO::AUBCommandStreamReceiver::create(strfilename.str(), true, *executionEnvironment, 0, neoDevice->getDeviceBitfield());
}
neoDevice->resetCommandStreamReceiver(this->csr);
prepareCopyEngines(*neoDevice, strfilename.str());

View File

@@ -148,6 +148,24 @@ void handle_SIGALRM(int signal) {
}
#endif
bool checkAubTestsExecutionPathValidity() {
bool valid = true;
if ((testMode == TestMode::AubTests || testMode == TestMode::AubTestsWithTbx)) {
std::ofstream testFile;
std::string aubPath = folderAUB;
aubPath += fSeparator;
aubPath += "testAubFolder";
testFile.open(aubPath, std::ofstream::app);
if (testFile.is_open()) {
testFile.close();
} else {
valid = false;
std::cout << "ERROR: Aub tests must be run in directory containing \" " << folderAUB << "\" folder!\n";
}
}
return valid;
}
int main(int argc, char **argv) {
bool useDefaultListener = false;
bool enableAlarm = true;
@@ -347,6 +365,10 @@ int main(int argc, char **argv) {
}
#endif
if (!checkAubTestsExecutionPathValidity()) {
return -1;
}
if (useMockGmm) {
NEO::GmmHelper::createGmmContextWrapperFunc = NEO::GmmClientContext::create<MockGmmClientContext>;
} else {

View File

@@ -125,6 +125,7 @@ void AUBCommandStreamReceiverHw<GfxFamily>::initFile(const std::string &fileName
if (aubManager) {
if (!aubManager->isOpen()) {
aubManager->open(fileName);
// This UNRECOVERABLE_IF most probably means you are not executing aub tests with correct current directory (containing aub_out folder)
UNRECOVERABLE_IF(!aubManager->isOpen());
std::ostringstream str;