Skip to content

Commit

Permalink
Add zeDriverGetLastErrorDescription CTS
Browse files Browse the repository at this point in the history
Added CTS for testing basic feature of
zeDriverGetLastErrorDescription.

Related-To: LOCI-4654

Signed-off-by: Zhang, Winston <winston.zhang@intel.com>
  • Loading branch information
winstonzhang-intel authored and nrspruit committed Aug 8, 2023
1 parent 8e0a0dc commit c199e9e
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 1 deletion.
10 changes: 10 additions & 0 deletions conformance_tests/core/test_driver/src/test_driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,14 @@ TEST(zeDriverGetIPCPropertiesTests,
}
}

TEST(zeDriverGetLastErrorDescription,
GivenValidDriverWhenRetreivingErrorDescriptionThenValidStringIsReturned) {
lzt::ze_init();

auto drivers = lzt::get_all_driver_handles();
for (auto driver : drivers) {
lzt::get_last_error_description(driver);
}
}

} // namespace
1 change: 1 addition & 0 deletions scripts/level_zero_report_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ def assign_test_feature_tag(test_feature: str, test_name: str, test_section: str
(re.search('L0_CTS_zeIpcMemHandleCloseTests_GivenValidPointerToDeviceMemoryAllocationBiasCachedWhenClosingIpcHandleThenSuccessIsReturned', test_name, re.IGNORECASE)) or \
(re.search('L0_CTS_zeDriverMemFreeTests_GivenValidSharedMemAllocationWhenFreeingSharedMemoryThenSuccessIsReturned', test_name, re.IGNORECASE)) or \
(re.search('L0_CTS_zeDriverMemFreeTests_GivenValidHostMemAllocationWhenFreeingHostMemoryThenSuccessIsReturned', test_name, re.IGNORECASE)) or \
(re.search('L0_CTS_zeDriverGetLastErrorDescription_GivenValidDriverWhenRetreivingErrorDescriptionThenValidStringIsReturned', test_name, re.IGNORECASE)) or \
(re.search('L0_CTS_zeDriverAllocSharedMemTestVarySizeAndAlignment_zeDriverAllocSharedMemAlignmentTests_GivenSizeAndAlignmentWhenAllocatingDeviceMemoryThenPointerIsAligned', test_name, re.IGNORECASE)) or \
(re.search('L0_CTS_zeDriverAllocHostMemTestVarySizeAndAlignment_zeDriverAllocHostMemAlignmentTests_GivenSizeAndAlignmentWhenAllocatingHostMemoryThenPointerIsAligned', test_name, re.IGNORECASE)) or \
(re.search('L0_CTS_zeDriverAllocDeviceMemTestVarySizeAndAlignment_zeDriverAllocDeviceMemAlignmentTests_GivenSizeAndAlignmentWhenAllocatingDeviceMemoryThenPointerIsAligned', test_name, re.IGNORECASE)) or \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ std::vector<ze_driver_extension_properties_t>
get_extension_properties(ze_driver_handle_t driver);
bool check_if_extension_supported(ze_driver_handle_t driver,
const char *check_extension_name);

const char *get_last_error_description(ze_driver_handle_t driver);
}; // namespace level_zero_tests

#endif
7 changes: 7 additions & 0 deletions utils/test_harness/src/test_harness_driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,4 +94,11 @@ bool check_if_extension_supported(ze_driver_handle_t driver,
return false;
}

const char *get_last_error_description(ze_driver_handle_t driver) {
const char *pStr = nullptr;
EXPECT_EQ(ZE_RESULT_SUCCESS, zeDriverGetLastErrorDescription(driver, &pStr));
EXPECT_NE(nullptr, pStr);
return pStr;
}

}; // namespace level_zero_tests

0 comments on commit c199e9e

Please sign in to comment.