3
0
mirror of https://github.com/triqs/dft_tools synced 2024-11-09 07:33:47 +01:00
dft_tools/test/python/CMakeLists.txt
Alexander Hampel f27399758e Merge branch 'unstable' into py3
merged unstable into py3

* include the major changes of a94f8ed942
  of blockstructure.py
* adapted all code to python 3
* fixed all tests
2020-06-23 10:53:52 +02:00

20 lines
1.0 KiB
CMake

# Copy h5 files to binary dir
file(GLOB_RECURSE all_h5_ref_files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.h5)
foreach(file ${all_h5_ref_files})
configure_file(${file} ${file} COPYONLY)
endforeach()
# Copy other files
FILE(COPY SrVO3.pmat SrVO3.struct SrVO3.outputs SrVO3.oubwin SrVO3.ctqmcout SrVO3.symqmc SrVO3.sympar SrVO3.parproj hk_convert_hamiltonian.hk LaVO3-Pnma_hr.dat LaVO3-Pnma.inp LaVO3-Pnma_ef_hr.dat LaVO3-Pnma_ef.inp DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
# List of all tests
file(GLOB all_tests RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.py)
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_EXECUTABLE} ${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=${PROJECT_BINARY_DIR}/python:$ENV{PYTHONPATH} ${SANITIZER_RT_PRELOAD})
endforeach()