Fix unknown Cycles test device silently pass

Prevents situation when requested device is HIPRT (while the expected
spelling is HIP-RT).

Pull Request: https://projects.blender.org/blender/blender/pulls/134332
This commit is contained in:
Sergey Sharybin
2025-02-10 14:13:42 +01:00
committed by Sergey Sharybin
parent 34216a2b7b
commit 5437f22faf
2 changed files with 7 additions and 1 deletions
+6
View File
@@ -613,6 +613,7 @@ if(WITH_CYCLES OR WITH_GPU_RENDER_TESTS)
# Cycles
if(WITH_CYCLES)
set(_cycles_blocklist "")
set(_cycles_known_test_devices CPU CUDA OPTIX HIP HIP-RT METAL METAL-RT ONEAPI ONEAPI-RT)
if((NOT WITH_CYCLES_OSL) OR (WITH_CYCLES_TEST_OSL AND WITH_CYCLES_OSL))
# Disable OSL tests if built without OSL or
# Disable OSL tests during the "normal" test phase to avoid double
@@ -620,6 +621,10 @@ if(WITH_CYCLES OR WITH_GPU_RENDER_TESTS)
set(_cycles_blocklist OSL)
endif()
foreach(_cycles_device ${CYCLES_TEST_DEVICES})
if(NOT ${_cycles_device} IN_LIST _cycles_known_test_devices)
message(FATAL_ERROR "Unknown Cycles test device ${_cycles_device}."
"Supported devices are: ${_cycles_known_test_devices}")
endif()
string(TOLOWER "${_cycles_device}" _cycles_device_lower)
set(_cycles_render_tests bake;${render_tests};osl)
@@ -662,6 +667,7 @@ if(WITH_CYCLES OR WITH_GPU_RENDER_TESTS)
endforeach()
endforeach()
unset(_cycles_blocklist)
unset(_cycles_known_test_devices)
endif()
if(WITH_GPU_RENDER_TESTS)