Skip to content

Commit

Permalink
Add first set of Fortran tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolasbock committed Jul 26, 2017
1 parent b124eda commit 7ee60f4
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 45 deletions.
26 changes: 25 additions & 1 deletion tests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
include_directories(${CMAKE_SOURCE_DIR}/src/C-interface)
include_directories(
${CMAKE_SOURCE_DIR}/src/C-interface
${CMAKE_BINARY_DIR}/src/Fortran-interface)

set(SOURCES_TYPED
add_matrix_typed.c
Expand Down Expand Up @@ -76,6 +78,27 @@ if(MPI_C_FOUND AND MPI_C_COMPILE_FLAGS)
LINK_FLAGS ${MPI_C_LINK_FLAGS})
endif()

add_executable(bml-test-fortran
test_m.F90
allocate_matrix.F90
bml_test.F90)
target_link_libraries(bml-test-fortran bml ${LINK_LIBRARIES})
set_target_properties(bml-test-fortran
PROPERTIES
LINK_FLAGS "--coverage")
if(OPENMP_FOUND)
set_target_properties(bml-test-fortran
PROPERTIES
COMPILE_FLAGS ${OpenMP_Fortran_FLAGS}
LINK_FLAGS ${OpenMP_Fortran_FLAGS})
endif()
if(MPI_Fortran_FOUND AND MPI_Fortran_COMPILE_FLAGS)
set_target_properties(bml-test-fortran
PROPERTIES
COMPILE_FLAGS ${MPI_Fortran_COMPILE_FLAGS}
LINK_FLAGS ${MPI_Fortran_LINK_FLAGS})
endif()

foreach(N add adjacency adjungate_triangle allocate convert copy diagonalize
get_element get_sparsity inverse multiply norm normalize scale set_diagonal set_row
submatrix threshold trace transpose)
Expand All @@ -85,6 +108,7 @@ foreach(N add adjacency adjungate_triangle allocate convert copy diagonalize
#add_test(${N}-${T}-${P} mpirun -np 1 bml-test -n ${N} -t ${T} -p ${P})
#else()
add_test(${N}-${T}-${P} bml-test -n ${N} -t ${T} -p ${P})
add_test(${N}-${T}-${P}-Fortran bml-test-fortran ${N} ${T} ${P})
#endif()
if(NOT BML_MPI AND NOT BML_OPENMP AND VALGRIND)
add_test(${N}-${T}-${P}-valgrind ${VALGRIND} --error-exitcode=1
Expand Down
13 changes: 13 additions & 0 deletions tests/bml_test.F90
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
function print_usage()

print *, "Usage"

end function print_usage

program bml_test

use bml_init_m

call bml_initF()

end program bml_test
20 changes: 0 additions & 20 deletions tests/test_driver.F90

This file was deleted.

24 changes: 0 additions & 24 deletions tests/test_driver.c

This file was deleted.

0 comments on commit 7ee60f4

Please sign in to comment.