From a33a824f9429666c7cda448769faddc55854fb1a Mon Sep 17 00:00:00 2001 From: Nicolas Bock Date: Mon, 13 Mar 2017 04:45:06 -0600 Subject: [PATCH] More on the tests --- tests/bml_test.F90 | 34 ++++++++++++++++++++++++++++------ tests/test_m.F90 | 1 + 2 files changed, 29 insertions(+), 6 deletions(-) diff --git a/tests/bml_test.F90 b/tests/bml_test.F90 index 086d37994..522696b3c 100644 --- a/tests/bml_test.F90 +++ b/tests/bml_test.F90 @@ -1,13 +1,35 @@ -function print_usage() +program bml_test - print *, "Usage" + use bml_types_m -end function print_usage + integer :: N = 11 + integer :: M = -1 + character(1000) :: test = "" + character(1000) :: matrix_type = BML_MATRIX_DENSE + character(1000) :: matrix_precision = BML_ELEMENT_REAL -program bml_test + integer :: n_args + + ! Arguments are interpreted as + ! + ! testname + ! matrix_type + ! precision + + n_args = command_argument_count() + if(n_args /= 3) then + print *, "incorrect number of command line arguments" + error stop + end if - use bml_init_m + call get_command_argument(1, test) + call get_command_argument(2, matrix_type) + call get_command_argument(3, matrix_precision) - call bml_initF() + select case(test) + case default + print *, "unknown test name "//trim(test) + error stop + end select end program bml_test diff --git a/tests/test_m.F90 b/tests/test_m.F90 index aa9db2d63..c83c060e8 100644 --- a/tests/test_m.F90 +++ b/tests/test_m.F90 @@ -1,4 +1,5 @@ module test_m + ! All tests need the Fortran kinds corresponding to the C floating types. use, intrinsic :: iso_c_binding, only : C_FLOAT, C_DOUBLE, C_FLOAT_COMPLEX, & & C_DOUBLE_COMPLEX