Skip to content

Commit 5d108de

Browse files
committed
addedunit test for clip function; added math subdirectory in CMakeLists.txt and Makefile.manual of tests directory
1 parent 2608434 commit 5d108de

File tree

7 files changed

+449
-1
lines changed

7 files changed

+449
-1
lines changed

src/stdlib_math.fypp

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
#:set INT_KINDS_TYPES = [("int8", "integer"), ("int16", "integer"), ("int32", "integer"), ("int64", "integer")]
44
#:set REAL_KINDS_TYPES = [("sp", "real"), ("dp", "real"), ("qp", "real")]
5-
65
#:set IR_KINDS_TYPES = INT_KINDS_TYPES + REAL_KINDS_TYPES
6+
77
module stdlib_math
88
use stdlib_kinds, only: int8, int16, int32, int64, sp, dp, qp
99

@@ -20,6 +20,7 @@ module stdlib_math
2020

2121

2222
contains
23+
2324
#:for k1, t1 in IR_KINDS_TYPES
2425
elemental function clip_${t1}$_${k1}$(x, xmin, xmax) result(res)
2526
${t1}$(${k1}$), intent(in) :: x
@@ -28,6 +29,7 @@ module stdlib_math
2829
${t1}$(${k1}$) :: res
2930
res = max(min(x, xmax), xmin)
3031
end function clip_${t1}$_${k1}$
32+
3133
#:endfor
3234

3335
end module stdlib_math

src/tests/CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ add_subdirectory(stats)
1616
add_subdirectory(string)
1717
add_subdirectory(system)
1818
add_subdirectory(quadrature)
19+
add_subdirectory(math)
1920

2021
ADDTEST(always_skip)
2122
set_tests_properties(always_skip PROPERTIES SKIP_RETURN_CODE 77)

src/tests/Makefile.manual

+3
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ all:
99
$(MAKE) -f Makefile.manual --directory=quadrature
1010
$(MAKE) -f Makefile.manual --directory=stats
1111
$(MAKE) -f Makefile.manual --directory=string
12+
$(MAKE) -f Makefile.manual --directory=math
1213

1314
test:
1415
$(MAKE) -f Makefile.manual --directory=ascii test
@@ -19,6 +20,7 @@ test:
1920
$(MAKE) -f Makefile.manual --directory=quadrature test
2021
$(MAKE) -f Makefile.manual --directory=stats test
2122
$(MAKE) -f Makefile.manual --directory=string test
23+
$(MAKE) -f Makefile.manual --directory=math test
2224

2325
clean:
2426
$(MAKE) -f Makefile.manual --directory=ascii clean
@@ -28,3 +30,4 @@ clean:
2830
$(MAKE) -f Makefile.manual --directory=optval clean
2931
$(MAKE) -f Makefile.manual --directory=stats clean
3032
$(MAKE) -f Makefile.manual --directory=string clean
33+
$(MAKE) -f Makefile.manual --directory=math clean

src/tests/math/CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ADDTEST(math)

src/tests/math/Makefile.manual

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
PROGS_SRC = test_math.f90
2+
3+
4+
include ../Makefile.manual.test.mk

0 commit comments

Comments
 (0)