--- /dev/null
+#
+# Header tests are special:
+#
+# Construct a list of all header files and build up a test that just tries
+# to compile a simple worker (test_header.cc) that only includes the given
+# header file. We omit linking to safe some time.
+#
+SET(_category all-headers)
+
+FILE(GLOB_RECURSE _header
+ ${CMAKE_SOURCE_DIR}/include/*.h
+ )
+
+FOREACH(_full_file ${_header})
+ GET_FILENAME_COMPONENT(_file ${_full_file} NAME)
+ GET_FILENAME_COMPONENT(_path ${_full_file} PATH)
+ GET_FILENAME_COMPONENT(_path ${_path} NAME)
+
+ FOREACH(_build ${DEAL_II_BUILD_TYPES})
+ STRING(TOLOWER ${_build} _build_lowercase)
+
+ SET(_test ${_category}-${_path}-${_file}.${_build_lowercase})
+
+ #
+ # Add an object library for each header file and build configuration:
+ #
+ ADD_LIBRARY(${_test} OBJECT EXCLUDE_FROM_ALL test_header.cc)
+ SET_TARGET_PROPERTIES(${_test} PROPERTIES
+ COMPILE_DEFINITIONS "${DEAL_II_DEFINITIONS};${DEAL_II_DEFINITIONS_${_build}}"
+ COMPILE_FLAGS "${DEAL_II_CXX_FLAGS_${_build}}"
+ )
+ SET_PROPERTY(TARGET ${_test} APPEND PROPERTY
+ INCLUDE_DIRECTORIES
+ "${CMAKE_BINARY_DIR}/include"
+ "${CMAKE_SOURCE_DIR}/include"
+ "${CMAKE_SOURCE_DIR}/include/deal.II/"
+ )
+ SET_PROPERTY(TARGET ${_test} APPEND PROPERTY
+ COMPILE_DEFINITIONS
+ HEADER=<deal.II/${_path}/${_file}>
+ )
+
+ #
+ # And finally add the test:
+ #
+ ADD_TEST(NAME ${_category}/${_path}/${_file}.${_build}
+ COMMAND ${CMAKE_COMMAND}
+ -DTEST=${_test}
+ -DDEAL_II_BINARY_DIR=${CMAKE_BINARY_DIR}
+ -P ${CMAKE_SOURCE_DIR}/cmake/scripts/run_test.cmake
+ WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+ )
+ SET_TESTS_PROPERTIES(${_category}/${_path}/${_file}.${_build} PROPERTIES
+ LABEL "${_category}"
+ TIMEOUT ${TEST_TIME_LIMIT}
+ )
+ ENDFOREACH()
+ENDFOREACH()
+++ /dev/null
-# collect all header files, and for each try to do the following:
-# generate a file tmp.cc that contains nothing but "#include <xxx>"
-# with this particular header file. then try to compile it. this
-# sometimes fails since this header does not include all other headers
-# it actually needs. we don't usually see this since we may be
-# including these missing headers into our files before, so that nobody
-# notices the problem. expose it this way.
-
-include ../Makefile.paths
-include $D/common/Make.global_options
-
-# The mail program. Override this by something like
-#
-# MAIL=mymailprog
-#
-# as part of the 'make' arguments or in the environment to use a different
-# mail agent or to tunnel through ssh. The mail program takes a single
-# argument, which is the mail address for tests The contents of the mail will
-# be provided on STDIN
-MAIL ?= mail
-
-
-############################################################
-# First how to create executables, including all necessary
-# flags:
-############################################################
-
-flags = $(CXXFLAGS.g)
-
-ifeq ($(findstring gcc,$(GXX_VERSION)),gcc)
-flags += -Wno-missing-noreturn
-endif
-
-%.g.$(OBJEXT) : %.cc
- @echo =====debug========= $@
- @$(CXX) $(flags) -c $< -o $@
-
-%.$(OBJEXT) : %.cc
- @echo =====optimized===== $@
- @$(CXX) $(CXXFLAGS.o) -c $< -o $@
-
-%.cc :
- @echo "=================== $@"
- @echo "#include <$^>" > $@
- @echo "// make sure we include config.h somehow:" >> $@
- @echo "DEAL_II_NAMESPACE_OPEN DEAL_II_NAMESPACE_CLOSE" >> $@
-
-%.OK : %.g.$(OBJEXT)
- @echo "=================== $@"
- @touch $@
-
-
-default: all
-
-# collect all headers
-HEADERS = $(shell cd $D; echo include/deal.II/*/*.h)
-TESTS = $(shell for i in $(HEADERS) ; do echo test-$$i | $(PERL) -pi -e 's/.h$$/.OK/g; s/\//-/g;' ; done)
-
-ID = `id -un`"@"`hostname`
-
-
-# next the target that creates the target rules. First, we list all the header
-# files as the head of the rule, followed by a colon. Then the actual rule
-# that includes writing the .cc file that only includes a single header file,
-# compiles it, and then deletes everything again
-Makefile.dep: $(HEADERS:%=$D/%)
- @for i in $(HEADERS) ; do \
- echo `echo test-$$i | $(PERL) -pi -e 's/\.h/.cc/g; s/\//-/g;'` : $D/$$i ; \
- done > Makefile.dep
-
--include Makefile.dep
-
-
-# here's what's to be done
-all: $(TESTS)
-
-
-# create a report, where we get exactly one line per test.
-report:
- @-$(MAKE) -k
- @-svn info . | grep '^Revision'
- @echo 'Date: ' `date -u +"%Y %j %F %U-%w"`
- @echo 'Id: ' $(ID)
- @for test in $(TESTS) ; do \
- testname=`echo $$test | perl -pi -e 's/.*include.//g; s/\//-/g;'` ; \
- if test -f $$test ; then \
- echo "`date -u +"%Y-%m-%d %H:%M"` + $(WORKDIR)/$$testname" ; \
- else \
- echo "`date -u +"%Y-%m-%d %H:%M"` 0 $(WORKDIR)/$$testname" ; \
- fi ; \
- done
-
-report+mail: all
- @$(MAKE) report | tee testresults
- @cat testresults | $(MAIL) dealii.regression.tests@gmail.com
- @rm testresults
-
-
-clean:
- -rm -f Makefile.dep *.$(OBJEXT) \
- *.g.$(OBJEXT) *.output *~ *.OK *.cc
-
-summary:
- @echo "not implemented"
-
-.PHONY: report clean distclean all default report report+mail summary