Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7dc1c5d

Browse files
committed
Add ULTs to validate the scenarios of zelCheckIsLoaderInTearDown
Signed-off-by: Neil R. Spruit <[email protected]>
1 parent 85e97d4 commit 7dc1c5d

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

test/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,9 @@ else()
8787
set_property(TEST tests_multi_driver_zeandzesdriverget_sort APPEND PROPERTY ENVIRONMENT "ZE_ENABLE_LOADER_DEBUG_TRACE=1;ZE_ENABLE_ALT_DRIVERS=${CMAKE_BINARY_DIR}/lib/libze_null_test1.so,${CMAKE_BINARY_DIR}/lib/libze_null_test2.so")
8888
endif()
8989

90+
add_test(NAME tests_loader_teardown_check COMMAND tests --gtest_filter=*GivenLoaderNotInDestructionStateWhenCallingzelCheckIsLoaderInTearDownThenFalseIsReturned)
91+
set_property(TEST tests_loader_teardown_check PROPERTY ENVIRONMENT "ZE_ENABLE_LOADER_DEBUG_TRACE=1;ZE_ENABLE_NULL_DRIVER=1")
92+
9093
# These tests are currently not supported on Windows. The reason is that the std::cerr is not being redirected to a pipe in Windows to be then checked against the expected output.
9194
if(NOT MSVC)
9295
add_test(NAME tests_event_deadlock COMMAND tests --gtest_filter=*GivenLevelZeroLoaderPresentWhenCallingzeCommandListAppendMemoryCopyWithCircularDependencyOnEventsThenValidationLayerPrintsWarningOfDeadlock*)

test/loader_api.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,4 +344,11 @@ TEST(
344344
EXPECT_GT(pDriverGetCount, 0);
345345
}
346346

347+
TEST(
348+
LoaderTearDown,
349+
GivenLoaderNotInDestructionStateWhenCallingzelCheckIsLoaderInTearDownThenFalseIsReturned) {
350+
351+
EXPECT_FALSE(zelCheckIsLoaderInTearDown());
352+
}
353+
347354
} // namespace

0 commit comments

Comments
 (0)