test: fix error message in opencl ULTs

- opencl ults do not require changing directory
- fix base execution directory for all aub test modes

Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
This commit is contained in:
Mateusz Hoppe
2025-02-17 13:48:27 +00:00
committed by Compute-Runtime-Automation
parent 051f7928f1
commit 9c962cdbc8
4 changed files with 30 additions and 14 deletions

View File

@@ -49,12 +49,16 @@ void setupTestFiles(std::string testBinaryFiles, int32_t revId) {
} }
std::string getBaseExecutionDir() { std::string getBaseExecutionDir() {
if (testMode != TestMode::aubTests) { if (!isAubTestMode(testMode)) {
return "level_zero/"; return "level_zero/";
} }
return ""; return "";
} }
bool isChangeDirectoryRequired() {
return true;
}
void addUltListener(::testing::TestEventListeners &listeners) { void addUltListener(::testing::TestEventListeners &listeners) {
listeners.Append(new L0::UltConfigListenerL0); listeners.Append(new L0::UltConfigListenerL0);
} }

View File

@@ -38,12 +38,16 @@ void setupTestFiles(std::string testBinaryFiles, int32_t revId) {
} }
std::string getBaseExecutionDir() { std::string getBaseExecutionDir() {
if (testMode != TestMode::aubTests) { if (!isAubTestMode(testMode)) {
return "opencl/"; return "opencl/";
} }
return ""; return "";
} }
bool isChangeDirectoryRequired() {
return testMode == TestMode::aubTests;
}
void addUltListener(::testing::TestEventListeners &listeners) { void addUltListener(::testing::TestEventListeners &listeners) {
listeners.Append(new UltConfigListener); listeners.Append(new UltConfigListener);
} }

View File

@@ -80,6 +80,8 @@ extern GFXCORE_FAMILY renderCoreFamily;
void applyWorkarounds(); void applyWorkarounds();
void setupTestFiles(std::string testBinaryFiles, int32_t revId); void setupTestFiles(std::string testBinaryFiles, int32_t revId);
std::string getBaseExecutionDir(); std::string getBaseExecutionDir();
bool isChangeDirectoryRequired();
void addUltListener(::testing::TestEventListeners &listener); void addUltListener(::testing::TestEventListeners &listener);
void cleanTestHelpers(); void cleanTestHelpers();
@@ -351,23 +353,25 @@ int main(int argc, char **argv) {
setupTestFiles(getRunPath(argv[0]), testRevId); setupTestFiles(getRunPath(argv[0]), testRevId);
auto executionDirectory = getBaseExecutionDir(); if (isChangeDirectoryRequired()) {
executionDirectory += hardwarePrefix[productFamily]; auto executionDirectory = getBaseExecutionDir();
executionDirectory += NEO::executionDirectorySuffix; // _aub for aub_tests, empty otherwise executionDirectory += hardwarePrefix[productFamily];
executionDirectory += "/"; executionDirectory += NEO::executionDirectorySuffix; // _aub for aub_tests, empty otherwise
executionDirectory += std::to_string(testRevId); executionDirectory += "/";
executionDirectory += std::to_string(testRevId);
#ifdef WIN32 #ifdef WIN32
#include <direct.h> #include <direct.h>
if (_chdir(executionDirectory.c_str())) { if (_chdir(executionDirectory.c_str())) {
std::cout << "chdir into " << executionDirectory << " directory failed.\nThis might cause test failures." << std::endl; std::cout << "chdir into " << executionDirectory << " directory failed.\nThis might cause test failures." << std::endl;
} }
#elif defined(__linux__) #elif defined(__linux__)
#include <unistd.h> #include <unistd.h>
if (chdir(executionDirectory.c_str()) != 0) { if (chdir(executionDirectory.c_str()) != 0) {
std::cout << "chdir into " << executionDirectory << " directory failed.\nThis might cause test failures." << std::endl; std::cout << "chdir into " << executionDirectory << " directory failed.\nThis might cause test failures." << std::endl;
} }
#endif #endif
}
if (!checkAubTestsExecutionPathValidity()) { if (!checkAubTestsExecutionPathValidity()) {
return -1; return -1;

View File

@@ -78,12 +78,16 @@ void setupTestFiles(std::string testBinaryFiles, int32_t revId) {
} }
std::string getBaseExecutionDir() { std::string getBaseExecutionDir() {
if (testMode != TestMode::aubTests) { if (!isAubTestMode(testMode)) {
return "shared/"; return "shared/";
} }
return ""; return "";
} }
bool isChangeDirectoryRequired() {
return true;
}
void addUltListener(::testing::TestEventListeners &listeners) { void addUltListener(::testing::TestEventListeners &listeners) {
listeners.Append(new BaseUltConfigListener); listeners.Append(new BaseUltConfigListener);
} }