test: Correct default device used in ocloc tests

Use default tested platform as default device instead of hardcoded value.
Remove rev_id parameter and use revision found in hw info.

Signed-off-by: Filip Hazubski <filip.hazubski@intel.com>
This commit is contained in:
Filip Hazubski
2025-09-26 12:32:56 +00:00
committed by Compute-Runtime-Automation
parent 90a490bcc0
commit da92fe6a4b
2 changed files with 8 additions and 9 deletions

View File

@@ -149,12 +149,15 @@ target_include_directories(ocloc_tests PRIVATE
${NEO_SHARED_TEST_DIRECTORY}/common/test_configuration/unit_tests
$<TARGET_PROPERTY:ocloc_lib,INCLUDE_DIRECTORIES>
)
string(TOLOWER ${DEFAULT_TESTED_PLATFORM} CLOC_LIB_DEFAULT_DEVICE)
target_compile_definitions(ocloc_tests PUBLIC
MOCKABLE_VIRTUAL=virtual
$<TARGET_PROPERTY:ocloc_lib,INTERFACE_COMPILE_DEFINITIONS>
${TESTED_CORE_FLAGS_DEFINITONS}
NEO_OCLOC_CURRENT_LIB_NAME="ocloc-current"
NEO_OCLOC_FORMER_LIB_NAME="ocloc-former"
DEFAULT_TEST_PLATFORM_NAME="${CLOC_LIB_DEFAULT_DEVICE}"
)
target_link_libraries(ocloc_tests gmock-gtest)
@@ -173,8 +176,6 @@ set_property(TARGET ocloc_tests PROPERTY FOLDER ${CLOC_LIB_FOLDER})
set_property(TARGET ocloc_tests APPEND_STRING PROPERTY COMPILE_FLAGS ${CLOC_LIB_COMPILE_FLAGS} ${ASAN_FLAGS} ${TSAN_FLAGS})
set_property(TARGET ocloc_tests PROPERTY ENABLE_EXPORTS TRUE)
string(TOLOWER ${DEFAULT_TESTED_PLATFORM} CLOC_LIB_DEFAULT_DEVICE)
add_custom_target(run_ocloc_tests ALL
DEPENDS ocloc_tests
)
@@ -189,7 +190,7 @@ macro(macro_for_each_platform)
parse_revision_config(${REVISION_CONFIG} ${PLATFORM_IT_LOWER} DEVICE_ID REVISION_ID)
add_dependencies(run_ocloc_tests prepare_test_kernels_${PLATFORM_IT_LOWER}_${REVISION_ID})
add_dependencies(unit_tests prepare_test_kernels_${PLATFORM_IT_LOWER}_${REVISION_ID})
set(run_tests_cmd ocloc_tests --device ${PLATFORM_IT_LOWER} --rev_id ${REVISION_ID})
set(run_tests_cmd ocloc_tests --device ${PLATFORM_IT_LOWER})
endif()
endmacro()
macro(macro_for_each_core_type)

View File

@@ -89,8 +89,7 @@ int main(int argc, char **argv) {
bool dumpTestStats = false;
std::string dumpTestStatsFileName = "";
std::string devicePrefix("skl");
std::string revId("0");
std::string devicePrefix(DEFAULT_TEST_PLATFORM_NAME);
std::string productConfig("");
applyWorkarounds();
@@ -126,9 +125,6 @@ int main(int argc, char **argv) {
} else if (strcmp("--device", argv[i]) == 0) {
++i;
devicePrefix = argv[i];
} else if (strcmp("--rev_id", argv[i]) == 0) {
++i;
revId = argv[i];
} else if (!strcmp("--show_test_stats", argv[i])) {
showTestStats = true;
} else if (!strcmp("--dump_test_stats", argv[i])) {
@@ -139,11 +135,13 @@ int main(int argc, char **argv) {
}
}
uint16_t revision = 0;
for (unsigned int productId = 0; productId < IGFX_MAX_PRODUCT; ++productId) {
if (NEO::hardwarePrefix[productId] && (0 == strcmp(devicePrefix.c_str(), NEO::hardwarePrefix[productId]))) {
if (NEO::hardwareInfoTable[productId]) {
renderCoreFamily = NEO::hardwareInfoTable[productId]->platform.eRenderCoreFamily;
productFamily = NEO::hardwareInfoTable[productId]->platform.eProductFamily;
revision = NEO::hardwareInfoTable[productId]->platform.usRevId;
break;
}
}
@@ -166,7 +164,7 @@ int main(int argc, char **argv) {
nTestFiles.append("/");
nTestFiles.append(devicePrefix);
nTestFiles.append("/");
nTestFiles.append(revId);
nTestFiles.append(std::to_string(revision));
nTestFiles.append("/");
nTestFiles.append(testFiles);
testFiles = nTestFiles;