File tree 9 files changed +2142
-324
lines changed
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
+
1
13
macro (ADDTEST name )
2
14
add_executable (test_${name} test_${name} .f90)
3
- target_link_libraries (test_${name} ${PROJECT_NAME} )
15
+ target_link_libraries (test_${name} " ${PROJECT_NAME} -testing" )
4
16
add_test (NAME ${name}
5
17
COMMAND $<TARGET_FILE:test_${name} > ${CMAKE_CURRENT_BINARY_DIR}
6
18
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} )
@@ -16,6 +28,7 @@ add_subdirectory(sorting)
16
28
add_subdirectory (stats)
17
29
add_subdirectory (string )
18
30
add_subdirectory (system )
31
+ add_subdirectory (test )
19
32
add_subdirectory (quadrature)
20
33
add_subdirectory (math)
21
34
Original file line number Diff line number Diff line change 1
1
.PHONY: all clean test
2
2
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::
4
13
$(MAKE) -f Makefile.manual --directory=ascii $@
5
14
$(MAKE) -f Makefile.manual --directory=bitsets $@
6
15
$(MAKE) -f Makefile.manual --directory=io $@
@@ -10,4 +19,17 @@ all test clean:
10
19
$(MAKE) -f Makefile.manual --directory=quadrature $@
11
20
$(MAKE) -f Makefile.manual --directory=stats $@
12
21
$(MAKE) -f Makefile.manual --directory=string $@
22
+ $(MAKE) -f Makefile.manual --directory=test $@
13
23
$(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 1
1
# Common Makefile rules that are included from each test subdirectory's
2
2
# Makefile
3
3
4
- CPPFLAGS += -I../..
5
- LDFLAGS += -L../.. -lstdlib
4
+ CPPFLAGS += -I../.. -I..
5
+ LDFLAGS += -L../.. -L.. -lstdlib-testing - lstdlib
6
6
7
7
OBJS = $(PROGS_SRC:.f90=.o )
8
8
PROGS = $(OBJS:.o= )
You can’t perform that action at this time.
0 commit comments