Skip to content

Commit c6a45c0

Browse files
committed
Update tests, examples, documentation:
1. Add a dependency path example; 2. Update `new_dependency` test; 3. Update help manual.
1 parent 5bd66d6 commit c6a45c0

File tree

10 files changed

+59
-2
lines changed

10 files changed

+59
-2
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
program hello_fpm
2+
use utils1_m, only: say_hello1
3+
use utils1_1_m, only: say_hello1_1
4+
use utils2_m, only: say_hello2
5+
6+
call say_hello1()
7+
call say_hello1_1()
8+
call say_hello2()
9+
10+
end program hello_fpm
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
name = "utils1"
2+
3+
[dependencies]
4+
utils1_1 = { path = "../utils1_1" }
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
module utils1_m
2+
3+
implicit none
4+
5+
contains
6+
7+
subroutine say_hello1()
8+
print '(a)', "Hello, utils1."
9+
end subroutine say_hello1
10+
11+
end module utils1_m
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
name = "utils1_1"
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
module utils1_1_m
2+
3+
implicit none
4+
5+
contains
6+
7+
subroutine say_hello1_1()
8+
print '(a)', "Hello, utils1_1."
9+
end subroutine say_hello1_1
10+
11+
end module utils1_1_m
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
name = "utils2"
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
module utils2_m
2+
3+
implicit none
4+
5+
contains
6+
7+
subroutine say_hello2()
8+
print '(a)', "Hello, utils2."
9+
end subroutine say_hello2
10+
11+
end module utils2_m
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
name = "hello_fpm_path"
2+
3+
[dependencies]
4+
utils1 = { path = "crate/utils1" }
5+
utils2 = { path = "crate/utils2" }

src/fpm/cmd/new.f90

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -369,8 +369,8 @@ subroutine cmd_new(settings)
369369
&' ',&
370370
&'#M_strings = { path = "M_strings" } ',&
371371
&' ',&
372-
&' # If you specify paths outside of your repository (ie. paths with a ',&
373-
&' # slash in them) things will not work for your users! ',&
372+
&' # This tells fpm that we depend on a crate called M_strings which is found ',&
373+
&' # in the M_strings folder (relative to the fpm.toml it’s written in). ',&
374374
&' # ',&
375375
&' # For a more verbose layout use normal tables rather than inline tables ',&
376376
&' # to specify dependencies: ',&

test/fpm_test/test_package_dependencies.f90

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,9 @@ subroutine test_add_dependencies(error)
186186
call new_dependencies(nodes, table, error=error)
187187
if (allocated(error)) return
188188

189+
call new_dependencies(nodes, table, root='.', error=error)
190+
if (allocated(error)) return
191+
189192
call new_dependency_tree(deps%dependency_tree_t)
190193
call deps%add(nodes, error)
191194
if (allocated(error)) return

0 commit comments

Comments
 (0)