From 71a5bbd250dfc16c599e8a58965a9659c1c891fd Mon Sep 17 00:00:00 2001 From: JorgeGV Date: Tue, 14 Oct 2025 22:24:08 +1100 Subject: [PATCH 1/2] fix lfortran compiler, fails 4 tests. CMake does not work --- test/main.f90 | 2 ++ test/test_check.F90 | 3 ++- test/test_select.F90 | 4 ++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/test/main.f90 b/test/main.f90 index 34d6b48..805535d 100644 --- a/test/main.f90 +++ b/test/main.f90 @@ -14,6 +14,7 @@ !> Driver for unit testing program tester use, intrinsic :: iso_fortran_env, only : error_unit + use, intrinsic :: ieee_arithmetic use testdrive, only : run_testsuite, new_testsuite, testsuite_type, & & select_suite, run_selected, get_argument, junit_output, junit_header, & & init_color_output @@ -29,6 +30,7 @@ program tester stat = 0 call junit_header(junit, "testdrive") + allocate(testsuites(2)) testsuites = [ & new_testsuite("check", collect_check), & new_testsuite("select", collect_select) & diff --git a/test/test_check.F90 b/test/test_check.F90 index fcf8245..47efdb7 100644 --- a/test/test_check.F90 +++ b/test/test_check.F90 @@ -22,7 +22,7 @@ #endif module test_check - use, intrinsic :: ieee_arithmetic, only : ieee_value, ieee_quiet_nan + use, intrinsic :: ieee_arithmetic, only : ieee_value, ieee_quiet_nan use testdrive, only : new_unittest, unittest_type, error_type, check, skip_test, to_string implicit none private @@ -67,6 +67,7 @@ subroutine collect_check(testsuite) !> Collection of tests type(unittest_type), allocatable, intent(out) :: testsuite(:) + allocate(testsuite(95)) testsuite = [ & new_unittest("success", test_success), & new_unittest("failure", test_failure, should_fail=.true.), & diff --git a/test/test_select.F90 b/test/test_select.F90 index c6c5377..6f20d2a 100644 --- a/test/test_select.F90 +++ b/test/test_select.F90 @@ -29,6 +29,7 @@ subroutine collect_select(testsuite) !> Collection of tests type(unittest_type), allocatable, intent(out) :: testsuite(:) + allocate(testsuite(6)) testsuite = [ & new_unittest("always-pass", always_pass), & @@ -68,6 +69,8 @@ subroutine stub_collect(testsuite) !> Collection of tests type(unittest_type), allocatable, intent(out) :: testsuite(:) + allocate(testsuite(2)) + testsuite = [ & new_unittest("always-pass", always_pass), & new_unittest("always-fail", always_fail, should_fail=.true.) & @@ -81,6 +84,7 @@ subroutine stub_collect_bad(testsuite) !> Collection of tests type(unittest_type), allocatable, intent(out) :: testsuite(:) + allocate(testsuite(2)) testsuite = [ & new_unittest("always-pass", always_pass, should_fail=.true.), & From c82dbf4e34a48d732ac37db39141b0d240fb75f6 Mon Sep 17 00:00:00 2001 From: JorgeGV Date: Tue, 14 Oct 2025 22:27:38 +1100 Subject: [PATCH 2/2] just quiet nan --- test/main.f90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/main.f90 b/test/main.f90 index 805535d..8bde31a 100644 --- a/test/main.f90 +++ b/test/main.f90 @@ -14,7 +14,7 @@ !> Driver for unit testing program tester use, intrinsic :: iso_fortran_env, only : error_unit - use, intrinsic :: ieee_arithmetic + use, intrinsic :: ieee_arithmetic, only: ieee_quiet_nan use testdrive, only : run_testsuite, new_testsuite, testsuite_type, & & select_suite, run_selected, get_argument, junit_output, junit_header, & & init_color_output