Skip to content

Commit 6e10539

Browse files
authored
Merge pull request #30 from sourceryinstitute/install-library
Install library
2 parents d853532 + 25facb0 commit 6e10539

5 files changed

Lines changed: 16 additions & 20 deletions

File tree

example/derived-type_diagnostic.F90

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ pure module function z(self) result(self_z)
2525
complex self_z
2626
end function
2727

28-
pure module function defined(self)
28+
pure module function defined(self) result(self_defined)
2929
!! Result is true if the object has been marked as user-defined.
3030
class(stuff_t), intent(in) :: self
31-
logical defined
31+
logical self_defined
3232
end function
3333

3434
end interface
@@ -41,14 +41,10 @@ pure module function construct(z) result(new_stuff_t)
4141
end function
4242
end interface
4343

44-
end module
45-
46-
submodule(stuff_m) stuff_s
47-
implicit none
4844
contains
4945

5046
module procedure defined
51-
defined = self%defined_
47+
self_defined = self%defined_
5248
end procedure
5349

5450
module procedure construct
@@ -62,7 +58,7 @@ pure module function construct(z) result(new_stuff_t)
6258
self_z = self%z_
6359
end procedure
6460

65-
end submodule
61+
end module
6662

6763
module characterizable_stuff_m
6864
!! 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)
105101

106102
end interface
107103

108-
end module
109-
110-
submodule(characterizable_stuff_m) characterizable_stuff_s
111-
implicit none
112104
contains
113105

114106
module procedure as_character
@@ -122,7 +114,7 @@ pure module function construct(stuff) result(new_characterizable_stuff)
122114
new_characterizable_stuff%stuff_ = stuff
123115
end procedure
124116

125-
end submodule
117+
end module
126118

127119
program diagnostic_data_pattern
128120
!! Demonstrate

example/invoke-via-macro.F90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#include "../src/assert/assert_macros.h"
1+
#include "assert_macros.h"
22

33
program invoke_via_macro
44
!! Demonstrate how to invoke the 'assert' subroutine using a preprocessor macro that facilitates

fpm.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,7 @@ license = "BSD"
44
author = ["Damian Rouson"]
55
maintainer = "[email protected]"
66
copyright = "2021-2024 Sourcery Institute"
7+
8+
[install]
9+
library = true
10+

test/test-assert-macro.F90

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ program test_assert_macros
66
print *,"The call_assert macro"
77

88
#define DEBUG
9-
#include "../../src/assert/assert_macros.h"
9+
#include "assert_macros.h"
1010
call_assert(1==1)
1111
print *," passes on not error-terminating when an assertion expression evaluating to .true. is the only argument"
1212

1313
#undef DEBUG
14-
#include "../../src/assert/assert_macros.h"
14+
#include "assert_macros.h"
1515
call_assert(.false.)
1616
print *," passes on being removed by the preprocessor when DEBUG is undefined" // new_line('')
1717

@@ -20,12 +20,12 @@ program test_assert_macros
2020
print *,"The call_assert_describe macro"
2121

2222
#define DEBUG
23-
#include "../../src/assert/assert_macros.h"
23+
#include "assert_macros.h"
2424
call_assert_describe(.true., ".true.")
2525
print *," passes on not error-terminating when assertion = .true. and a description is present"
2626

2727
#undef DEBUG
28-
#include "../../src/assert/assert_macros.h"
28+
#include "assert_macros.h"
2929
call_assert_describe(.false., "")
3030
print *," passes on being removed by the preprocessor when DEBUG is undefined" // new_line('')
3131

@@ -34,12 +34,12 @@ program test_assert_macros
3434
print *,"The call_assert_diagnose macro"
3535

3636
#define DEBUG
37-
#include "../../src/assert/assert_macros.h"
37+
#include "assert_macros.h"
3838
call_assert_diagnose(.true., ".true.", diagnostic_data=1)
3939
print *," passes on not error-terminating when assertion = .true. and description and diagnostic_data are present"
4040

4141
#undef DEBUG
42-
#include "../../src/assert/assert_macros.h"
42+
#include "assert_macros.h"
4343
call_assert_describe(.false., "")
4444
print *," passes on being removed by the preprocessor when DEBUG is undefined"
4545

0 commit comments

Comments
 (0)