Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 5 additions & 13 deletions example/derived-type_diagnostic.F90
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion example/invoke-via-macro.F90
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 4 additions & 0 deletions fpm.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,7 @@ license = "BSD"
author = ["Damian Rouson"]
maintainer = "damian@sourceryinstitute.org"
copyright = "2021-2024 Sourcery Institute"

[install]
library = true

File renamed without changes.
12 changes: 6 additions & 6 deletions test/test-assert-macro.F90
Original file line number Diff line number Diff line change
Expand Up @@ -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('')

Expand All @@ -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('')

Expand All @@ -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"

Expand Down