From 8362c935a67c4b925046c7b48b4092a3e6546ab8 Mon Sep 17 00:00:00 2001 From: Damian Rouson Date: Thu, 1 Jun 2023 17:39:30 -0700 Subject: [PATCH 1/5] fix(test_result_test): fix typo --- test/test_result_test.f90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_result_test.f90 b/test/test_result_test.f90 index 8f0ab0b9..e79fa452 100644 --- a/test/test_result_test.f90 +++ b/test/test_result_test.f90 @@ -24,7 +24,7 @@ function results() result(test_results) type(test_result_t), allocatable :: test_results(:) test_results = [ & - test_result_t("constructs and array of test_result_t objects elmentally", check_array_result_construction()) & + test_result_t("constructs and array of test_result_t objects elementally", check_array_result_construction()) & ] end function From 766c38e265835a5bce602ccec7a8c425137758cf Mon Sep 17 00:00:00 2001 From: Damian Rouson Date: Fri, 2 Jun 2023 18:22:19 -0700 Subject: [PATCH 2/5] feat(co_all): make impure elemental --- src/sourcery/user_defined_collectives_m.f90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sourcery/user_defined_collectives_m.f90 b/src/sourcery/user_defined_collectives_m.f90 index 804a09c9..3815ba4a 100644 --- a/src/sourcery/user_defined_collectives_m.f90 +++ b/src/sourcery/user_defined_collectives_m.f90 @@ -12,7 +12,7 @@ module user_defined_collectives_m interface - module subroutine co_all(boolean) + impure elemental module subroutine co_all(boolean) !! If any image in a team calls this subroutine, then every image in the !! the same team must call this subroutine. This subroutine sets the !! "boolean" argument .true. if it is true in all participating images From 55f0e68909d0a7d676d22ceeb51839fe28bcb633 Mon Sep 17 00:00:00 2001 From: Damian Rouson Date: Fri, 2 Jun 2023 18:22:36 -0700 Subject: [PATCH 3/5] feat(report): only image 1 reports test results --- src/sourcery/test_s.f90 | 31 ++++++++++++++++++++----------- test/main.f90 | 3 +-- 2 files changed, 21 insertions(+), 13 deletions(-) diff --git a/src/sourcery/test_s.f90 b/src/sourcery/test_s.f90 index 0beb1ecc..d3c858c9 100644 --- a/src/sourcery/test_s.f90 +++ b/src/sourcery/test_s.f90 @@ -1,4 +1,5 @@ submodule(test_m) test_s + use user_defined_collectives_m, only : co_all implicit none contains @@ -6,17 +7,25 @@ module procedure report integer i - print * - print *, test%subject() - associate(test_results => test%results()) - associate(num_tests => size(test_results)) - tests = tests + num_tests - do i=1,num_tests - print *," ",test_results(i)%characterize() - end do - associate(num_passes => count(test_results%passed())) - print '(a,2(i0,a))'," ",num_passes," of ", num_tests," tests pass." - passes = passes + num_passes + associate(me => this_image()) + if (me==1) print *, new_line('a'), test%subject() + associate(test_results => test%results()) + associate(num_tests => size(test_results)) + tests = tests + num_tests + if (me==1) then + do i=1,num_tests + if (me==1) print *," ",test_results(i)%characterize() + end do + end if + block + logical, allocatable :: passing_tests(:) + passing_tests = test_results%passed() + call co_all(passing_tests) + associate(num_passes => count(passing_tests)) + if (me==1) print '(a,2(i0,a))'," ",num_passes," of ", num_tests," tests pass." + passes = passes + num_passes + end associate + end block end associate end associate end associate diff --git a/test/main.f90 b/test/main.f90 index e6d965fb..487d5eb4 100644 --- a/test/main.f90 +++ b/test/main.f90 @@ -26,6 +26,5 @@ program main call command_line_test%report(passes, tests) call string_test%report(passes, tests) - print * - print *,"_________ In total, ",passes," of ",tests, " tests pass. _________" + if (this_image()==1) print *, new_line('a'), "_________ In total, ",passes," of ",tests, " tests pass. _________" end program From 3ea6a0b40200d98c32e36b5e51b705933cb3b349 Mon Sep 17 00:00:00 2001 From: Damian Rouson Date: Fri, 2 Jun 2023 18:25:11 -0700 Subject: [PATCH 4/5] chore(LICENSE/fpm.toml): bump version,copyright yr --- LICENSE | 2 +- fpm.toml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/LICENSE b/LICENSE index abe6abc5..650938ec 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ BSD 3-Clause License -Copyright (c) 2020, Sourcery Institute +Copyright (c) 2020-2023, Sourcery Institute All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/fpm.toml b/fpm.toml index ed531bd5..fe6923d9 100644 --- a/fpm.toml +++ b/fpm.toml @@ -1,9 +1,9 @@ name = "sourcery" -version = "3.7.0" +version = "3.8.0" license = "BSD" author = ["Damian Rouson"] maintainer = "damian@archaeologic.codes" -copyright = "2020-2022 Sourcery Institute" +copyright = "2020-2023 Sourcery Institute" [dependencies] assert = {git = "https://github.com/sourceryinstitute/assert", tag = "1.4.0"} From 80bed7d24393ae41b6b051cf7d4d0656a1a4e420 Mon Sep 17 00:00:00 2001 From: Damian Rouson Date: Fri, 2 Jun 2023 18:36:03 -0700 Subject: [PATCH 5/5] test: error-terminate test suite if any tests fail --- test/main.f90 | 1 + 1 file changed, 1 insertion(+) diff --git a/test/main.f90 b/test/main.f90 index 487d5eb4..09698103 100644 --- a/test/main.f90 +++ b/test/main.f90 @@ -27,4 +27,5 @@ program main call string_test%report(passes, tests) if (this_image()==1) print *, new_line('a'), "_________ In total, ",passes," of ",tests, " tests pass. _________" + if (passes /= tests) error stop end program