diff --git a/XClib/CMakeLists.txt b/XClib/CMakeLists.txt index 1b62c9c40..b095cc2bf 100644 --- a/XClib/CMakeLists.txt +++ b/XClib/CMakeLists.txt @@ -63,5 +63,15 @@ if(QE_ENABLE_TEST) qe_mpi_fortran qe_external_libxc qe_xclib) - #add_test(NAME test_qe_xclib COMMAND $) + + find_program(BASH_PROGRAM bash) + + file(GLOB test_input_file_names + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/test_input_files + test_input_files/*.in) + + foreach(test_input_file IN LISTS test_input_file_names) + string(REGEX REPLACE ".in$" "" test_input_file_name_no_extension ${test_input_file}) + add_test(NAME test_qe_xclib_${test_input_file_name_no_extension} COMMAND ${BASH_PROGRAM} -c "$ < ${CMAKE_CURRENT_SOURCE_DIR}/test_input_files/${test_input_file}") + endforeach() endif(QE_ENABLE_TEST) diff --git a/XClib/test_input_files/dft-comparison.in b/XClib/test_input_files/dft-comparison.in new file mode 100644 index 000000000..3d7f8dda7 --- /dev/null +++ b/XClib/test_input_files/dft-comparison.in @@ -0,0 +1,8 @@ +&INPUT_NAMELIST + test='dft-comparison', + nspin=2, + family='LDA', + DF_OK=.FALSE., + dft1='sla pz', + dft2='lda_x lda_c_pz' +/ diff --git a/XClib/test_input_files/dft-info.in b/XClib/test_input_files/dft-info.in new file mode 100644 index 000000000..9fed3dd12 --- /dev/null +++ b/XClib/test_input_files/dft-info.in @@ -0,0 +1,4 @@ +&INPUT_NAMELIST + test='dft-info' + dft1='mgga_x_scan mgga_c_scan' +/