3
0
mirror of https://github.com/triqs/dft_tools synced 2024-07-11 13:53:47 +02:00
dft_tools/test/python/CMakeLists.txt
Nils Wentzell 28d600f149 [app4triqs] Rename files and Python module from toto to app4triqs
-Automatically detect any wrap generator files
-rename tests to basic/Py_Basic
2019-09-04 17:37:50 -04:00

16 lines
717 B
CMake

# Copy h5 files to binary dir
file(GLOB_RECURSE all_h5_ref_files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.ref.h5)
foreach(file ${all_h5_ref_files})
configure_file(${file} ${file} COPYONLY)
endforeach()
# List of all tests
set(all_tests Basic)
foreach(test ${all_tests})
get_filename_component(test_name ${test} NAME_WE)
get_filename_component(test_dir ${test} DIRECTORY)
add_test(NAME Py_${test_name} COMMAND ${TRIQS_PYTHON_INTERPRETER} ${CMAKE_CURRENT_SOURCE_DIR}/${test_dir}/${test_name}.py WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${test_dir})
set_property(TEST Py_${test_name} APPEND PROPERTY ENVIRONMENT PYTHONPATH=${CMAKE_BINARY_DIR}/python:$ENV{PYTHONPATH} ${SANITIZER_RT_PRELOAD})
endforeach()