summaryrefslogtreecommitdiffstats
path: root/fortran/test
diff options
context:
space:
mode:
authorScot Breitenfeld <brtnfld@hdfgroup.org>2015-07-13 19:37:28 (GMT)
committerScot Breitenfeld <brtnfld@hdfgroup.org>2015-07-13 19:37:28 (GMT)
commit838755cf71e270e2123b540bae3a89f6bbffbc2b (patch)
tree38debfdcb9b1481a4a692c56055067db58611783 /fortran/test
parentc90d6ad2869a9787e5068ca2a9f72f51d5b30438 (diff)
downloadhdf5-838755cf71e270e2123b540bae3a89f6bbffbc2b.zip
hdf5-838755cf71e270e2123b540bae3a89f6bbffbc2b.tar.gz
hdf5-838755cf71e270e2123b540bae3a89f6bbffbc2b.tar.bz2
[svn-r27375] Moved generating Fortran 'test' code from the fortran src directory to the fortran 'test' directory. Updated autotools and cmake.
Diffstat (limited to 'fortran/test')
-rw-r--r--fortran/test/CMakeLists.txt38
-rw-r--r--fortran/test/Makefile.am21
-rw-r--r--fortran/test/Makefile.in71
3 files changed, 109 insertions, 21 deletions
diff --git a/fortran/test/CMakeLists.txt b/fortran/test/CMakeLists.txt
index 9b82765..32b3a09 100644
--- a/fortran/test/CMakeLists.txt
+++ b/fortran/test/CMakeLists.txt
@@ -23,8 +23,8 @@ set_target_properties (${HDF5_F90_C_TEST_LIB_TARGET} PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include>"
)
-set_source_files_properties (tf.F90 tf_gen.F90 PROPERTIES LANGUAGE Fortran)
-add_library (${HDF5_F90_TEST_LIB_TARGET} ${LIB_TYPE} tf.F90 tf_gen.F90)
+set_source_files_properties (tf.F90 ${HDF5_F90_BINARY_DIR}/tf_gen.F90 PROPERTIES LANGUAGE Fortran)
+add_library (${HDF5_F90_TEST_LIB_TARGET} ${LIB_TYPE} tf.F90 ${HDF5_F90_BINARY_DIR}/tf_gen.F90)
set (SHARED_LINK_FLAGS " ")
if (WIN32)
@@ -51,6 +51,40 @@ set_target_properties (${HDF5_F90_TEST_LIB_TARGET} PROPERTIES
)
#-----------------------------------------------------------------------------
+# Setup the Fortran auto-detection utilities
+# H5_test_buildiface.F90 used to generate various KIND test interfaces
+#-----------------------------------------------------------------------------
+
+add_executable (H5_test_buildiface
+ ${HDF5_F90_SRC_DIR}/test/H5_test_buildiface.F90
+ )
+
+if (WIN32 AND MSVC)
+ if (BUILD_SHARED_LIBS)
+ set_target_properties (H5_test_buildiface
+ PROPERTIES
+ COMPILE_FLAGS "/MT"
+ )
+ endif (BUILD_SHARED_LIBS)
+ set_target_properties (H5_test_buildiface
+ PROPERTIES
+ LINK_FLAGS "/SUBSYSTEM:CONSOLE"
+ )
+endif (WIN32 AND MSVC)
+set_target_properties (H5_test_buildiface PROPERTIES
+ LINKER_LANGUAGE Fortran
+ Fortran_MODULE_DIRECTORY ${CMAKE_Fortran_MODULE_DIRECTORY}
+)
+
+set (CMD $<TARGET_FILE:H5_test_buildiface>)
+add_custom_command (
+ OUTPUT ${HDF5_F90_BINARY_DIR}/tf_gen.F90
+ COMMAND ${CMD}
+ WORKING_DIRECTORY ${HDF5_F90_BINARY_DIR}
+ DEPENDS H5_test_buildiface
+)
+
+#-----------------------------------------------------------------------------
# Add Tests
#-----------------------------------------------------------------------------
diff --git a/fortran/test/Makefile.am b/fortran/test/Makefile.am
index 9c5b4f0..608b1e9 100644
--- a/fortran/test/Makefile.am
+++ b/fortran/test/Makefile.am
@@ -76,13 +76,32 @@ maintainer-clean-local: clean-local
distclean-local: clean-local
clean-local:
@if test -n "$(F9XMODEXT)" && test "X$(F9XMODEXT)" != "Xo"; then \
- $(RM) *.$(F9XMODEXT); \
+ $(RM) *.$(F9XMODEXT) tf_gen.F90; \
fi
# Mark this directory as part of the Fortran API (this affects output
# from tests in conclude.am)
FORTRAN_API=yes
+# helper program we need to build.
+noinst_PROGRAMS = H5_test_buildiface
+
+# H5_test_buildiface.F90 generates all the test APIs that have a KIND type associated
+# with them.
+
+tf_gen.F90: H5_test_buildiface$(EXEEXT)
+ $(RUNSERIAL) ./H5_test_buildiface$(EXEEXT)
+
+# H5_test_buildiface.F90 is included in the distribution, and Automake knows
+# how to compile a fortran program given its sources.
+
+H5_test_buildiface_SOURCES = H5_test_buildiface.F90
+
+# The build of the H5_test_buildiface does depend on any libraries, so set it
+# to nothing.
+
+H5_test_buildiface_LDADD =
+
# fflush2 depends on files created by fflush1
fflush2.chkexe_: fflush1.chkexe_
diff --git a/fortran/test/Makefile.in b/fortran/test/Makefile.in
index cadba68..4e9bbd6 100644
--- a/fortran/test/Makefile.in
+++ b/fortran/test/Makefile.in
@@ -14,6 +14,7 @@
@SET_MAKE@
+
VPATH = @srcdir@
am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
am__make_running_with_option = \
@@ -88,6 +89,7 @@ DIST_COMMON = $(top_srcdir)/config/commence.am \
# pass the -static flag to the library linker.
@FORTRAN_SHARED_CONDITIONAL_FALSE@am__append_1 = -static
check_PROGRAMS = $(am__EXEEXT_1)
+noinst_PROGRAMS = H5_test_buildiface$(EXEEXT)
TESTS = $(am__EXEEXT_1)
subdir = fortran/test
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
@@ -111,6 +113,10 @@ am__v_lt_1 =
am__EXEEXT_1 = fortranlib_test$(EXEEXT) fflush1$(EXEEXT) \
fflush2$(EXEEXT) fortranlib_test_1_8$(EXEEXT) \
fortranlib_test_F03$(EXEEXT)
+PROGRAMS = $(noinst_PROGRAMS)
+am_H5_test_buildiface_OBJECTS = H5_test_buildiface.$(OBJEXT)
+H5_test_buildiface_OBJECTS = $(am_H5_test_buildiface_OBJECTS)
+H5_test_buildiface_DEPENDENCIES =
am_fflush1_OBJECTS = fflush1.$(OBJEXT)
fflush1_OBJECTS = $(am_fflush1_OBJECTS)
fflush1_LDADD = $(LDADD)
@@ -212,10 +218,12 @@ AM_V_FC = $(am__v_FC_@AM_V@)
am__v_FC_ = $(am__v_FC_@AM_DEFAULT_V@)
am__v_FC_0 = @echo " FC " $@;
am__v_FC_1 =
-SOURCES = $(libh5test_fortran_la_SOURCES) $(fflush1_SOURCES) \
+SOURCES = $(libh5test_fortran_la_SOURCES) \
+ $(H5_test_buildiface_SOURCES) $(fflush1_SOURCES) \
$(fflush2_SOURCES) $(fortranlib_test_SOURCES) \
$(fortranlib_test_1_8_SOURCES) $(fortranlib_test_F03_SOURCES)
-DIST_SOURCES = $(libh5test_fortran_la_SOURCES) $(fflush1_SOURCES) \
+DIST_SOURCES = $(libh5test_fortran_la_SOURCES) \
+ $(H5_test_buildiface_SOURCES) $(fflush1_SOURCES) \
$(fflush2_SOURCES) $(fortranlib_test_SOURCES) \
$(fortranlib_test_1_8_SOURCES) $(fortranlib_test_F03_SOURCES)
am__can_run_installinfo = \
@@ -766,6 +774,14 @@ MOSTLYCLEANFILES = *.tmp
# from tests in conclude.am)
FORTRAN_API = yes
+# H5_test_buildiface.F90 is included in the distribution, and Automake knows
+# how to compile a fortran program given its sources.
+H5_test_buildiface_SOURCES = H5_test_buildiface.F90
+
+# The build of the H5_test_buildiface does depend on any libraries, so set it
+# to nothing.
+H5_test_buildiface_LDADD =
+
# Automake needs to be taught how to build lib, progs, and tests targets.
# These will be filled in automatically for the most part (e.g.,
# lib_LIBRARIES are built for lib target), but EXTRA_LIB, EXTRA_PROG, and
@@ -844,6 +860,19 @@ clean-checkPROGRAMS:
echo " rm -f" $$list; \
rm -f $$list
+clean-noinstPROGRAMS:
+ @list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \
+ echo " rm -f" $$list; \
+ rm -f $$list || exit $$?; \
+ test -n "$(EXEEXT)" || exit 0; \
+ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+ echo " rm -f" $$list; \
+ rm -f $$list
+
+H5_test_buildiface$(EXEEXT): $(H5_test_buildiface_OBJECTS) $(H5_test_buildiface_DEPENDENCIES) $(EXTRA_H5_test_buildiface_DEPENDENCIES)
+ @rm -f H5_test_buildiface$(EXEEXT)
+ $(AM_V_FCLD)$(FCLINK) $(H5_test_buildiface_OBJECTS) $(H5_test_buildiface_LDADD) $(LIBS)
+
fflush1$(EXEEXT): $(fflush1_OBJECTS) $(fflush1_DEPENDENCIES) $(EXTRA_fflush1_DEPENDENCIES)
@rm -f fflush1$(EXEEXT)
$(AM_V_FCLD)$(FCLINK) $(fflush1_OBJECTS) $(fflush1_LDADD) $(LIBS)
@@ -1273,7 +1302,7 @@ check-am: all-am
$(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS)
$(MAKE) $(AM_MAKEFLAGS) check-TESTS
check: check-am
-all-am: Makefile $(LTLIBRARIES) all-local
+all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) all-local
installdirs:
install: install-am
install-exec: install-exec-am
@@ -1312,7 +1341,7 @@ maintainer-clean-generic:
clean: clean-am
clean-am: clean-checkPROGRAMS clean-generic clean-libtool clean-local \
- clean-noinstLTLIBRARIES mostlyclean-am
+ clean-noinstLTLIBRARIES clean-noinstPROGRAMS mostlyclean-am
distclean: distclean-am
-rm -rf ./$(DEPDIR)
@@ -1385,19 +1414,19 @@ uninstall-am:
.PHONY: CTAGS GTAGS TAGS all all-am all-local check check-TESTS \
check-am clean clean-checkPROGRAMS clean-generic clean-libtool \
- clean-local clean-noinstLTLIBRARIES cscopelist-am ctags \
- ctags-am distclean distclean-compile distclean-generic \
- distclean-libtool distclean-local distclean-tags distdir dvi \
- dvi-am html html-am info info-am install install-am \
- install-data install-data-am install-dvi install-dvi-am \
- install-exec install-exec-am install-html install-html-am \
- install-info install-info-am install-man install-pdf \
- install-pdf-am install-ps install-ps-am install-strip \
- installcheck installcheck-am installdirs maintainer-clean \
- maintainer-clean-generic maintainer-clean-local mostlyclean \
- mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
- mostlyclean-local pdf pdf-am ps ps-am recheck tags tags-am \
- uninstall uninstall-am
+ clean-local clean-noinstLTLIBRARIES clean-noinstPROGRAMS \
+ cscopelist-am ctags ctags-am distclean distclean-compile \
+ distclean-generic distclean-libtool distclean-local \
+ distclean-tags distdir dvi dvi-am html html-am info info-am \
+ install install-am install-data install-data-am install-dvi \
+ install-dvi-am install-exec install-exec-am install-html \
+ install-html-am install-info install-info-am install-man \
+ install-pdf install-pdf-am install-ps install-ps-am \
+ install-strip installcheck installcheck-am installdirs \
+ maintainer-clean maintainer-clean-generic \
+ maintainer-clean-local mostlyclean mostlyclean-compile \
+ mostlyclean-generic mostlyclean-libtool mostlyclean-local pdf \
+ pdf-am ps ps-am recheck tags tags-am uninstall uninstall-am
#
@@ -1438,9 +1467,15 @@ maintainer-clean-local: clean-local
distclean-local: clean-local
clean-local:
@if test -n "$(F9XMODEXT)" && test "X$(F9XMODEXT)" != "Xo"; then \
- $(RM) *.$(F9XMODEXT); \
+ $(RM) *.$(F9XMODEXT) tf_gen.F90; \
fi
+# H5_test_buildiface.F90 generates all the test APIs that have a KIND type associated
+# with them.
+
+tf_gen.F90: H5_test_buildiface$(EXEEXT)
+ $(RUNSERIAL) ./H5_test_buildiface$(EXEEXT)
+
# fflush2 depends on files created by fflush1
fflush2.chkexe_: fflush1.chkexe_