1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
|
if (Halide_TARGET MATCHES "webgpu")
message(WARNING "Python correctness tests are not supported with WebGPU.")
return()
endif ()
add_library(the_sort_function MODULE the_sort_function.c)
target_link_libraries(the_sort_function PRIVATE Halide::Runtime)
set(tests
addconstant_test.py
atomics.py
autodiff.py
basics.py
bit_test.py
boundary_conditions.py
buffer.py
callable.py
compile_to.py
division.py
extern.py
float_precision_test.py
iroperator.py
memoize.py
multi_method_module_test.py
multipass_constraints.py
pystub.py
rdom.py
realize_warnings.py
serialization.py
target.py
tuple_select.py
type.py
user_context_test.py
var.py
)
set(PY_GENERATORS "${CMAKE_CURRENT_SOURCE_DIR}/../generators")
set(PYPATH_addconstant_test "$<TARGET_FILE_DIR:py_aot_addconstantcpp>")
set(PYPATH_bit_test "$<TARGET_FILE_DIR:py_aot_bitcpp>")
set(PYPATH_callable "$<TARGET_FILE_DIR:py_gen_simplecpp_pystub>;${PY_GENERATORS}")
set(PYPATH_multi_method_module_test "$<TARGET_FILE_DIR:pyext_multi_method_module>")
set(PYPATH_pystub "$<TARGET_FILE_DIR:py_gen_bitcpp_pystub>;${PY_GENERATORS}")
set(PYPATH_user_context_test "$<TARGET_FILE_DIR:py_aot_user_context>;${PY_GENERATORS}")
foreach (test IN LISTS tests)
cmake_path(GET test STEM test_name)
add_python_test(
FILE "${test}"
LABEL python_correctness
# Ensure that everything in generators/ is built before us.
# This is dramatic overkill but simplifies our build setup considerably.
DEPENDS PythonCorrectnessGenerators
PYTHONPATH "${PYPATH_${test_name}}"
)
endforeach ()
|