Skip to content

Commit 6084cf0

Browse files
authored
Remove a name clash in the fpm testsuite (#334)
- local variable uses same name as used module (testsuite)
1 parent 0a5c3f1 commit 6084cf0

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

fpm/test/fpm_test/main.f90

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ program fpm_testing
1414
implicit none
1515
integer :: stat, is
1616
character(len=:), allocatable :: suite_name, test_name
17-
type(testsuite_t), allocatable :: testsuite(:)
17+
type(testsuite_t), allocatable :: suite(:)
1818
character(len=*), parameter :: fmt = '("#", *(1x, a))'
1919

2020
stat = 0
2121

22-
testsuite = [ &
22+
suite = [ &
2323
& new_testsuite("fpm_toml", collect_toml), &
2424
& new_testsuite("fpm_manifest", collect_manifest), &
2525
& new_testsuite("fpm_source_parsing", collect_source_parsing), &
@@ -34,29 +34,29 @@ program fpm_testing
3434
call get_argument(2, test_name)
3535

3636
if (allocated(suite_name)) then
37-
is = select_suite(testsuite, suite_name)
38-
if (is > 0 .and. is <= size(testsuite)) then
37+
is = select_suite(suite, suite_name)
38+
if (is > 0 .and. is <= size(suite)) then
3939
if (allocated(test_name)) then
40-
write(error_unit, fmt) "Suite:", testsuite(is)%name
41-
call run_selected(testsuite(is)%collect, test_name, error_unit, stat)
40+
write(error_unit, fmt) "Suite:", suite(is)%name
41+
call run_selected(suite(is)%collect, test_name, error_unit, stat)
4242
if (stat < 0) then
4343
error stop 1
4444
end if
4545
else
46-
write(error_unit, fmt) "Testing:", testsuite(is)%name
47-
call run_testsuite(testsuite(is)%collect, error_unit, stat)
46+
write(error_unit, fmt) "Testing:", suite(is)%name
47+
call run_testsuite(suite(is)%collect, error_unit, stat)
4848
end if
4949
else
5050
write(error_unit, fmt) "Available testsuites"
51-
do is = 1, size(testsuite)
52-
write(error_unit, fmt) "-", testsuite(is)%name
51+
do is = 1, size(suite)
52+
write(error_unit, fmt) "-", suite(is)%name
5353
end do
5454
error stop 1
5555
end if
5656
else
57-
do is = 1, size(testsuite)
58-
write(error_unit, fmt) "Testing:", testsuite(is)%name
59-
call run_testsuite(testsuite(is)%collect, error_unit, stat)
57+
do is = 1, size(suite)
58+
write(error_unit, fmt) "Testing:", suite(is)%name
59+
call run_testsuite(suite(is)%collect, error_unit, stat)
6060
end do
6161
end if
6262

0 commit comments

Comments
 (0)