diff --git a/example/derived-type_diagnostic.F90 b/example/derived-type_diagnostic.F90 index 5d2385e..740f8ca 100644 --- a/example/derived-type_diagnostic.F90 +++ b/example/derived-type_diagnostic.F90 @@ -25,10 +25,10 @@ pure module function z(self) result(self_z) complex self_z end function - pure module function defined(self) + pure module function defined(self) result(self_defined) !! Result is true if the object has been marked as user-defined. class(stuff_t), intent(in) :: self - logical defined + logical self_defined end function end interface @@ -41,14 +41,10 @@ pure module function construct(z) result(new_stuff_t) end function end interface -end module - -submodule(stuff_m) stuff_s - implicit none contains module procedure defined - defined = self%defined_ + self_defined = self%defined_ end procedure module procedure construct @@ -62,7 +58,7 @@ pure module function construct(z) result(new_stuff_t) self_z = self%z_ end procedure -end submodule +end module module characterizable_stuff_m !! Demonstrate a pattern for getting derived-type diagnostic data output from a type that @@ -105,10 +101,6 @@ pure module function construct(stuff) result(new_characterizable_stuff) end interface -end module - -submodule(characterizable_stuff_m) characterizable_stuff_s - implicit none contains module procedure as_character @@ -122,7 +114,7 @@ pure module function construct(stuff) result(new_characterizable_stuff) new_characterizable_stuff%stuff_ = stuff end procedure -end submodule +end module program diagnostic_data_pattern !! Demonstrate diff --git a/example/invoke-via-macro.F90 b/example/invoke-via-macro.F90 index d87dabe..3799990 100644 --- a/example/invoke-via-macro.F90 +++ b/example/invoke-via-macro.F90 @@ -1,4 +1,4 @@ -#include "../src/assert/assert_macros.h" +#include "assert_macros.h" program invoke_via_macro !! Demonstrate how to invoke the 'assert' subroutine using a preprocessor macro that facilitates diff --git a/fpm.toml b/fpm.toml index 05e3bc5..373abd7 100644 --- a/fpm.toml +++ b/fpm.toml @@ -4,3 +4,7 @@ license = "BSD" author = ["Damian Rouson"] maintainer = "damian@sourceryinstitute.org" copyright = "2021-2024 Sourcery Institute" + +[install] +library = true + diff --git a/src/assert/assert_macros.h b/include/assert_macros.h similarity index 100% rename from src/assert/assert_macros.h rename to include/assert_macros.h diff --git a/test/test-assert-macro.F90 b/test/test-assert-macro.F90 index 23e4d14..213161c 100644 --- a/test/test-assert-macro.F90 +++ b/test/test-assert-macro.F90 @@ -6,12 +6,12 @@ program test_assert_macros print *,"The call_assert macro" #define DEBUG -#include "../../src/assert/assert_macros.h" +#include "assert_macros.h" call_assert(1==1) print *," passes on not error-terminating when an assertion expression evaluating to .true. is the only argument" #undef DEBUG -#include "../../src/assert/assert_macros.h" +#include "assert_macros.h" call_assert(.false.) print *," passes on being removed by the preprocessor when DEBUG is undefined" // new_line('') @@ -20,12 +20,12 @@ program test_assert_macros print *,"The call_assert_describe macro" #define DEBUG -#include "../../src/assert/assert_macros.h" +#include "assert_macros.h" call_assert_describe(.true., ".true.") print *," passes on not error-terminating when assertion = .true. and a description is present" #undef DEBUG -#include "../../src/assert/assert_macros.h" +#include "assert_macros.h" call_assert_describe(.false., "") print *," passes on being removed by the preprocessor when DEBUG is undefined" // new_line('') @@ -34,12 +34,12 @@ program test_assert_macros print *,"The call_assert_diagnose macro" #define DEBUG -#include "../../src/assert/assert_macros.h" +#include "assert_macros.h" call_assert_diagnose(.true., ".true.", diagnostic_data=1) print *," passes on not error-terminating when assertion = .true. and description and diagnostic_data are present" #undef DEBUG -#include "../../src/assert/assert_macros.h" +#include "assert_macros.h" call_assert_describe(.false., "") print *," passes on being removed by the preprocessor when DEBUG is undefined"