diff --git a/runtime/CMakeLists.txt b/runtime/CMakeLists.txt index 390529c415..1cad8bf196 100644 --- a/runtime/CMakeLists.txt +++ b/runtime/CMakeLists.txt @@ -1655,6 +1655,7 @@ if(BUILD_TESTING) endif() if(WIN32 AND TARGET dstorage_test) add_test(NAME dstorage COMMAND dstorage_test) + set_tests_properties(dstorage PROPERTIES TIMEOUT 120) endif() if(WIN32 AND TARGET xgameruntime_test) add_test(NAME xgameruntime COMMAND xgameruntime_test) @@ -3556,7 +3557,7 @@ if(TARGET Vulkan::Headers) target_compile_definitions(dxgi_host_parity_test PRIVATE WIN32_LEAN_AND_MEAN NOMINMAX) target_compile_options(dxgi_host_parity_test PRIVATE /W4 /permissive- /utf-8) add_test(NAME dxgi_host_parity COMMAND dxgi_host_parity_test) - set_tests_properties(dxgi_host_parity PROPERTIES SKIP_RETURN_CODE 77) + set_tests_properties(dxgi_host_parity PROPERTIES SKIP_RETURN_CODE 77 TIMEOUT 120) # Host-parity test for DXGI waitable swap chain frame-latency semaphore behavior. add_executable(dxgi_waitable_latency_test test/dxgi_waitable_latency_test.cpp) @@ -3565,7 +3566,7 @@ if(TARGET Vulkan::Headers) target_compile_options(dxgi_waitable_latency_test PRIVATE /W4 /permissive- /utf-8) add_test(NAME dxgi_waitable_latency COMMAND dxgi_waitable_latency_test) set_tests_properties(dxgi_waitable_latency PROPERTIES - SKIP_RETURN_CODE 77 + SKIP_RETURN_CODE 77 TIMEOUT 120 FAIL_REGULAR_EXPRESSION "Validation Error;VUID-") # Synthetic (no GPU): VulkanSwapchain's DXGI BufferCount contract when Vulkan returns more images than the diff --git a/tests/test_ctest_registration.py b/tests/test_ctest_registration.py index fc88e8081a..a264d58b50 100644 --- a/tests/test_ctest_registration.py +++ b/tests/test_ctest_registration.py @@ -84,6 +84,15 @@ def test_a_named_skip_code_counts_by_its_value(self): src.write_text('std::printf("SKIP: none\\n");\nreturn kUnknown;\n', encoding="utf-8", newline="\n") self.assertEqual(whole_test_skips_not_77(cmake, Path(tmp)), [("test/a_test.cpp:2", "kUnknown")]) + def test_host_parity_and_storage_tests_have_timeouts(self): + for test_name in ("dstorage", "dxgi_host_parity", "dxgi_waitable_latency"): + m = re.search( + r"set_tests_properties\(\s*" + test_name + r"\b[^)]*TIMEOUT\s+[1-9]\d*", + self.cmake, + re.S, + ) + self.assertIsNotNone(m, f"{test_name} must have an explicit TIMEOUT property") + def whole_test_skips_not_77(cmake_text, runtime_dir): """[(source:line, code)] for a SKIP print directly followed by `return N;` (N != 77) in the sources of a test