Skip to content

Commit 4220a97

Browse files
committed
try one more like previous build to clear error
1 parent ce303bc commit 4220a97

File tree

7 files changed

+1980
-1
lines changed

7 files changed

+1980
-1
lines changed

fpm/fpm.toml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,26 @@ tag = "v0.2"
1212

1313
[dependencies.M_CLI2]
1414
git = "https://github.com/urbanjost/M_CLI2.git"
15+
<<<<<<< HEAD
1516
rev = "5c7df1267c918ec2b1b8e2c6a0ac000367b562cf"
17+
=======
18+
rev = "a177b0077819571815fa6a8da6980bcb45443858"
1619

1720
[[test]]
18-
name = "cli_test"
21+
name = "cli-test"
1922
source-dir = "test/cli_test"
2023
main = "cli_test.f90"
2124

2225
[[test]]
2326
name = "fpm-test"
2427
source-dir = "test/fpm_test"
2528
main = "main.f90"
29+
>>>>>>> try one more like previous build to clear error
30+
31+
32+
[[test]]
33+
name = "fpm-test"
34+
source-dir = "test/fpm_test"
35+
main = "main.f90"
2636

2737

fpm/src/fpm_command_line.f90

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@ subroutine get_command_line_settings(cmd_settings)
182182
cmd_settings=fpm_build_settings( release=lget('release'),list=lget('list') )
183183

184184
case('new')
185+
<<<<<<< HEAD
185186
help_text=[character(len=80) :: &
186187
'NAME ', &
187188
' new(1) - the fpm(1) subcommand to initialize a new project ', &
@@ -226,6 +227,39 @@ subroutine get_command_line_settings(cmd_settings)
226227
' The fpm(1) home page is https://github.com/fortran-lang/fpm ', &
227228
' ', &
228229
' Registered packages are at https://fortran-lang.org/packages ', &
230+
=======
231+
help_text=[character(len=80) :: &
232+
'NAME ', &
233+
' new(1) - the fpm(1) subcommand to initialize a new project ', &
234+
'SYNOPSIS ', &
235+
' fpm new NAME [--with-executable] [--with-test] ', &
236+
' ', &
237+
' fpm new --help|--version ', &
238+
' ', &
239+
'DESCRIPTION ', &
240+
' Create a new programming project in a new directory ', &
241+
' ', &
242+
' The "new" subcommand creates a directory and runs the command ', &
243+
' "git init" in that directory and makes an example "fpm.toml" ', &
244+
' file, a src/ directory, and optionally a test/ and app/ ', &
245+
' directory with trivial example Fortran source files. ', &
246+
' ', &
247+
' Remember to update the information in the sample "fpm.toml" ', &
248+
' file with such information as your name and e-mail address. ', &
249+
' ', &
250+
'EXAMPLES ', &
251+
' Sample use ', &
252+
' ', &
253+
' # create new project directory and seed it ', &
254+
' fpm new myproject ', &
255+
' # Enter the new directory ', &
256+
' cd myproject ', &
257+
' # and run commands such as ', &
258+
' fpm build ', &
259+
' fpm run # if you selected --with-executable ', &
260+
' fpm test # if you selected --with-test ', &
261+
' ', &
262+
>>>>>>> try one more like previous build to clear error
229263
'' ]
230264
call set_args(' --with-executable F --with-test F --lib F --app F --test F', help_text, version_text)
231265
select case(size(unnamed))
@@ -409,7 +443,11 @@ subroutine get_command_line_settings(cmd_settings)
409443
endif
410444
help_text=[character(len=80) :: &
411445
'USAGE: fpm [ SUBCOMMAND [SUBCOMMAND_OPTIONS] ] | [|--help|--version] ', &
446+
<<<<<<< HEAD
412447
' Enter "fpm --help" for more information ', &
448+
=======
449+
' Enter "fpm --help" for more information , &
450+
>>>>>>> try one more like previous build to clear error
413451
'' ]
414452
write(stderr,'(g0)')(trim(help_text(i)), i=1, size(help_text) )
415453
!!stop 3 ! causes github site tests to fail

fpm/test/fpm_test/main.f90

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
!> Driver for unit testing
2+
program fpm_testing
3+
use, intrinsic :: iso_fortran_env, only : error_unit
4+
use testsuite, only : run_testsuite, new_testsuite, testsuite_t, &
5+
& select_suite, run_selected
6+
use test_toml, only : collect_toml
7+
use test_manifest, only : collect_manifest
8+
use test_source_parsing, only : collect_source_parsing
9+
implicit none
10+
integer :: stat, is
11+
character(len=:), allocatable :: suite_name, test_name
12+
type(testsuite_t), allocatable :: testsuite(:)
13+
character(len=*), parameter :: fmt = '("#", *(1x, a))'
14+
15+
stat = 0
16+
17+
testsuite = [ &
18+
& new_testsuite("fpm_toml", collect_toml), &
19+
& new_testsuite("fpm_manifest", collect_manifest), &
20+
& new_testsuite("fpm_source_parsing", collect_source_parsing) &
21+
& ]
22+
23+
call get_argument(1, suite_name)
24+
call get_argument(2, test_name)
25+
26+
if (allocated(suite_name)) then
27+
is = select_suite(testsuite, suite_name)
28+
if (is > 0 .and. is <= size(testsuite)) then
29+
if (allocated(test_name)) then
30+
write(error_unit, fmt) "Suite:", testsuite(is)%name
31+
call run_selected(testsuite(is)%collect, test_name, error_unit, stat)
32+
if (stat < 0) then
33+
error stop 1
34+
end if
35+
else
36+
write(error_unit, fmt) "Testing:", testsuite(is)%name
37+
call run_testsuite(testsuite(is)%collect, error_unit, stat)
38+
end if
39+
else
40+
write(error_unit, fmt) "Available testsuites"
41+
do is = 1, size(testsuite)
42+
write(error_unit, fmt) "-", testsuite(is)%name
43+
end do
44+
error stop 1
45+
end if
46+
else
47+
do is = 1, size(testsuite)
48+
write(error_unit, fmt) "Testing:", testsuite(is)%name
49+
call run_testsuite(testsuite(is)%collect, error_unit, stat)
50+
end do
51+
end if
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+
58+
59+
contains
60+
61+
62+
!> Obtain the command line argument at a given index
63+
subroutine get_argument(idx, arg)
64+
65+
!> Index of command line argument, range [0:command_argument_count()]
66+
integer, intent(in) :: idx
67+
68+
!> Command line argument
69+
character(len=:), allocatable, intent(out) :: arg
70+
71+
integer :: length, stat
72+
73+
call get_command_argument(idx, length=length, status=stat)
74+
if (stat /= 0) then
75+
return
76+
endif
77+
78+
allocate(character(len=length) :: arg, stat=stat)
79+
if (stat /= 0) then
80+
return
81+
endif
82+
83+
if (length > 0) then
84+
call get_command_argument(idx, arg, status=stat)
85+
if (stat /= 0) then
86+
deallocate(arg)
87+
return
88+
end if
89+
end if
90+
91+
end subroutine get_argument
92+
93+
94+
end program fpm_testing

0 commit comments

Comments
 (0)