File tree Expand file tree Collapse file tree 9 files changed +2142
-324
lines changed
Expand file tree Collapse file tree 9 files changed +2142
-324
lines changed Original file line number Diff line number Diff line change 1+ fypp_f90("${fyppFlags} ;-I${CMAKE_CURRENT_SOURCE_DIR} /.." "stdlib_test.fypp" outFiles)
2+ add_library ("${PROJECT_NAME} -testing" "${outFiles} " )
3+ target_link_libraries ("${PROJECT_NAME} -testing" PUBLIC "${PROJECT_NAME} " )
4+ set_target_properties (
5+ "${PROJECT_NAME} -testing" PROPERTIES
6+ Fortran_MODULE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
7+ )
8+ target_include_directories (
9+ "${PROJECT_NAME} -testing" PUBLIC
10+ $<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR} >
11+ )
12+
113macro (ADDTEST name )
214 add_executable (test_${name} test_${name} .f90)
3- target_link_libraries (test_${name} ${PROJECT_NAME} )
15+ target_link_libraries (test_${name} " ${PROJECT_NAME} -testing" )
416 add_test (NAME ${name}
517 COMMAND $<TARGET_FILE:test_${name} > ${CMAKE_CURRENT_BINARY_DIR}
618 WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} )
@@ -16,6 +28,7 @@ add_subdirectory(sorting)
1628add_subdirectory (stats)
1729add_subdirectory (string )
1830add_subdirectory (system )
31+ add_subdirectory (test )
1932add_subdirectory (quadrature)
2033add_subdirectory (math)
2134
Original file line number Diff line number Diff line change 11.PHONY: all clean test
22
3- all test clean:
3+ LIB = libstdlib-testing.a
4+ SRCFYPP = stdlib_test.fypp
5+ SRCGEN = $(SRCFYPP:.fypp=.f90)
6+ SRC = $(SRCGEN)
7+ OBJS = $(SRC:.f90=.o)
8+ MODS = $(OBJS:.o=.mod)
9+
10+ all test:: $(LIB)
11+
12+ all test clean::
413 $(MAKE) -f Makefile.manual --directory=ascii $@
514 $(MAKE) -f Makefile.manual --directory=bitsets $@
615 $(MAKE) -f Makefile.manual --directory=io $@
@@ -10,4 +19,17 @@ all test clean:
1019 $(MAKE) -f Makefile.manual --directory=quadrature $@
1120 $(MAKE) -f Makefile.manual --directory=stats $@
1221 $(MAKE) -f Makefile.manual --directory=string $@
22+ $(MAKE) -f Makefile.manual --directory=test $@
1323 $(MAKE) -f Makefile.manual --directory=math $@
24+
25+ $(LIB): $(OBJS)
26+ ar rcs $@ $^
27+
28+ clean::
29+ $(RM) $(LIB) $(OBJS) $(MODS) $(SRCGEN)
30+
31+ %.o: %.f90
32+ $(FC) $(FFLAGS) -I.. -c $<
33+
34+ $(SRCGEN): %.f90: %.fypp ../common.fypp
35+ fypp $(FYPPFLAGS) -I.. $< $@
Original file line number Diff line number Diff line change 11# Common Makefile rules that are included from each test subdirectory's
22# Makefile
33
4- CPPFLAGS += -I../..
5- LDFLAGS += -L../.. -lstdlib
4+ CPPFLAGS += -I../.. -I..
5+ LDFLAGS += -L../.. -L.. -lstdlib-testing - lstdlib
66
77OBJS = $(PROGS_SRC:.f90=.o )
88PROGS = $(OBJS:.o= )
You can’t perform that action at this time.
0 commit comments