Skip to content

Commit 17d3dae

Browse files
committed
support of fypp for test_to_number
1 parent ad0bb71 commit 17d3dae

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

test/string/CMakeLists.txt

+2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# Create a list of the files to be preprocessed
44
set(fppFiles
55
test_string_assignment.fypp
6+
test_string_to_number.fypp
67
)
78

89
fypp_f90("${fyppFlags}" "${fppFiles}" outFiles)
@@ -14,4 +15,5 @@ ADDTEST(string_match)
1415
ADDTEST(string_derivedtype_io)
1516
ADDTEST(string_functions)
1617
ADDTEST(string_strip_chomp)
18+
ADDTEST(string_to_number)
1719
ADDTEST(string_to_string)

test/string/test_string_to_number.f90 renamed to test/string/test_string_to_number.fypp

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module test_string_to_number
2-
use iso_fortran_env, only: sp=>real32, dp=>real64, qp=>real128
2+
use stdlib_kinds, only: sp, dp, qp
33
use stdlib_str2num
44
use testdrive, only : new_unittest, unittest_type, error_type, check
55
implicit none
@@ -14,6 +14,9 @@ subroutine collect_string_to_number(testsuite)
1414
testsuite = [ &
1515
new_unittest("to_float", test_to_float), &
1616
new_unittest("to_double", test_to_double) &
17+
#:if WITH_QP
18+
, new_unittest("to_quadruple", test_to_quadruple) &
19+
#:endif
1720
]
1821
end subroutine collect_string_to_number
1922

@@ -215,6 +218,7 @@ logical function ucheck(s)
215218
end function
216219
end subroutine
217220

221+
#:if WITH_QP
218222
subroutine test_to_quadruple(error)
219223
use stdlib_str2num
220224
type(error_type), allocatable, intent(out) :: error
@@ -313,6 +317,7 @@ logical function ucheck(s)
313317
end if
314318
end function
315319
end subroutine
320+
#:endif
316321

317322
end module test_string_to_number
318323

@@ -340,4 +345,4 @@ program tester
340345
write(error_unit, '(i0, 1x, a)') stat, "test(s) failed!"
341346
error stop
342347
end if
343-
end program
348+
end program

0 commit comments

Comments
 (0)