@@ -12,6 +12,8 @@ program fpm_testing
12
12
type (testsuite_t), allocatable :: testsuite(:)
13
13
character (len=* ), parameter :: fmt = ' ("#", *(1x, a))'
14
14
15
+ stat = 0
16
+
15
17
testsuite = [ &
16
18
& new_testsuite(" fpm_toml" , collect_toml), &
17
19
& new_testsuite(" fpm_manifest" , collect_manifest), &
@@ -27,18 +29,13 @@ program fpm_testing
27
29
if (allocated (test_name)) then
28
30
write (error_unit, fmt) " Suite:" , testsuite(is)% name
29
31
call run_selected(testsuite(is)% collect, test_name, error_unit, stat)
30
- if (stat == - 1 ) then
32
+ if (stat < 0 ) then
31
33
error stop 1
32
34
end if
33
35
else
34
36
write (error_unit, fmt) " Testing:" , testsuite(is)% name
35
37
call run_testsuite(testsuite(is)% collect, error_unit, stat)
36
38
end if
37
-
38
- if (stat > 0 ) then
39
- write (error_unit, ' (i0, 1x, a)' ) stat, " test(s) failed!"
40
- error stop 1
41
- end if
42
39
else
43
40
write (error_unit, fmt) " Available testsuites"
44
41
do is = 1 , size (testsuite)
@@ -50,14 +47,14 @@ program fpm_testing
50
47
do is = 1 , size (testsuite)
51
48
write (error_unit, fmt) " Testing:" , testsuite(is)% name
52
49
call run_testsuite(testsuite(is)% collect, error_unit, stat)
53
-
54
- if (stat > 0 ) then
55
- write (error_unit, ' (i0, 1x, a)' ) stat, " test(s) failed!"
56
- error stop 1
57
- end if
58
50
end do
59
51
end if
60
52
53
+ if (stat > 0 ) then
54
+ write (error_unit, ' (i0, 1x, a)' ) stat, " test(s) failed!"
55
+ error stop 1
56
+ end if
57
+
61
58
62
59
contains
63
60
0 commit comments