Skip to content
Snippets Groups Projects
Commit afbc897d authored by Christian Engwer's avatar Christian Engwer
Browse files

make rules for automated build tests

[[Imported from SVN: r2157]]
parent 944c1bb4
No related branches found
No related tags found
No related merge requests found
# -*- Makefile -*-
# $Id$
LOG_STORE = $(PERL) $(top_srcdir)/bin/check-log-store
LOG_FILE = $(top_srcdir)/check-log.log
LOG_SET_OPTIONS = \
path=$$(test "$(subdir)" = "." && echo "/dune"|| echo "/dune/$(subdir)");\
ppath=$$(dirname $$path); \
dir=$$(basename $$path)
$(top_srcdir)/bin/check-log-store: $(top_srcdir)/bin/check-log-store.in
$(MAKE) -C $(top_srcdir)/bin/ check-log-store
check-log: $(top_srcdir)/bin/check-log-store
check-log:
rm -f $(LOG_FILE)
check-log: check-log-lib
check-log: check-log-build
check-log: check-log-test
check-log: check-log-sources
check-log: check-log-dir
check-log-lib: check-log-lib-recursive
check-log-build: check-log-build-recursive
check-log-test: check-log-test-recursive
check-log-sources: check-log-sources-recursive
check-log-dir: check-log-dir-recursive
check-log-sources-am:
$(LOG_SET_OPTIONS); \
$(MAKE) sourcescheck-am 2>&1> $(LOG_FILE); \
$(LOG_STORE) "sources" "Makefile.am" "$$path" $(LOG_FILE);
check-log-libs-am:
$(LOG_SET_OPTIONS); \
for target in $(lib_LTLIBRARIES); do \
$(MAKE) $$i 2>&1> $(LOG_FILE); \
$(LOG_STORE) "build" "$$target" "$$path" $(LOG_FILE); \
done;
check-log-build-am:
$(LOG_SET_OPTIONS); \
for target in $(check_PROGRAMS) $(PROGRAMS); do \
$(MAKE) $$i 2>&1> $(LOG_FILE); \
$(LOG_STORE) "build" "$$target" "$$path" $(LOG_FILE); \
done;
check-log-test-am:
$(LOG_SET_OPTIONS); \
for test in $(TESTS); do \
./$$test 2>&1> $(LOG_FILE); \
$(LOG_STORE) "run" "$$test" "$$path" $(LOG_FILE); \
done;
check-log-dir-am:
$(LOG_SET_OPTIONS); \
$(LOG_STORE) "dir" "$$dir" "$$ppath"
check-log-lib-recursive \
check-log-build-recursive \
check-log-test-recursive \
check-log-sources-recursive \
check-log-dir-recursive:
@set fnord $$MAKEFLAGS; amf=$$2; \
dot_seen=no; \
target=`echo $@ | sed s/-recursive//`; \
list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
dot_seen=yes; \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
done; \
if test "$$dot_seen" = "no"; then \
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
fi; test -z "$$fail"
.PHONY: check-log \
check-log-lib check-log-lib-am check-log-lib-recursive \
check-log-build check-log-build-am check-log-build-recursive \
check-log-test check-log-test-am check-log-test-recursive \
check-log-sources check-log-sources-am check-log-sources-recursive \
check-log-dir check-log-dir-am check-log-dir-recursive
......@@ -9,5 +9,8 @@
# add "sourcescheck"-target testing if all source files are mentioned
include $(top_srcdir)/am/sourcescheck
# add "check-log"-target to create automated build logs
include $(top_srcdir)/am/checklog
# prevent "make check" if libdune does not yet exist
include $(top_srcdir)/am/no-check-without-lib
......@@ -13,7 +13,7 @@ sourcescheck-am:
grep [hc][hc]$$ | sort | uniq > header_CHECK.present
@RESULT=0; \
if diff header_CHECK.* | grep ^[\<\>] -q; then \
echo "==== ERROR ===="; \
echo "==== WARNING ===="; \
echo -n "Directory: "; pwd; \
echo "Files present but not installed:"; \
diff -u header_CHECK.install header_CHECK.present | \
......
......@@ -26,6 +26,7 @@ AC_CHECK_PROGS([BIBTEX], [bibtex], [true])
AC_CHECK_PROGS([DVIPDF], [dvipdf], [true])
AC_CHECK_PROGS([DVIPS], [dvips], [true])
AC_CHECK_PROGS([WML], [wml], [true])
AC_CHECK_PROGS([PERL], [perl], [true])
DUNE_INKSCAPE
# doxygen and latex take a lot of time...
......@@ -44,6 +45,19 @@ if test -d $with_duneweb ; then
fi
AC_SUBST(DUNEWEBDIR, $with_duneweb)
# special settings for check-log
AC_SUBST(host, $(echo "$ac_hostname ($(uname -sm), $COMPILER_NAME)") )
AC_ARG_WITH(tag,
AC_HELP_STRING([--with-tag=TAG],
[tag to use for automated test runs]))
if test x$with_tag == xno ; then with_tag=foo; fi
AC_SUBST(tag, $with_tag)
AC_ARG_WITH(revision,
AC_HELP_STRING([--with-revision=TAG],
[revision to use for automated test runs]))
if test x$with_revision == xno ; then with_revision=bar; fi
AC_SUBST(revision, $with_revision)
echo
echo Checking for libraries the self-test could use:
echo
......@@ -179,5 +193,9 @@ AC_CONFIG_FILES([Makefile
m4/Makefile
am/Makefile
bin/wmlwrap
bin/check-log-store
dune.pc])
AC_OUTPUT
chmod +x bin/wmlwrap
chmod +x bin/check-log-store
......@@ -14,34 +14,41 @@ SUPPORTED_COMPILER="gcc (>= 3.4.1) or icc (>= 7.0)"
AC_REQUIRE([AC_PROG_CXX])
cat >conftest.cc <<_ACEOF
#ifdef __xlC__
#include <cstdio>
#if defined __xlC__ && ! defined CXX_SUPPORTED
#if __xlC__ >= 0x0600
#define CXX_SUPPORTED
#define CXX_SUPPORTED "xlC %X", __xlC__
#endif
#endif
#ifdef __ICC
#if defined __ICC && ! defined CXX_SUPPORTED
#if __ICC >= 700
#define CXX_SUPPORTED
#define CXX_SUPPORTED "icc %2.2f", 1.0*__ICC/100
#endif
#endif
#ifdef __GNUC__
#if defined __GNUC__ && ! defined CXX_SUPPORTED
#if __GNUC__ > 3 || \
(__GNUC__ == 3 && (__GNUC_MINOR__ > 4 || \
(__GNUC_MINOR__ == 4 && \
__GNUC_PATCHLEVEL__ >= 1)))
#define CXX_SUPPORTED
#define CXX_SUPPORTED \
"gcc %i.%i.%i", __GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__
#endif
#endif
#ifndef CXX_SUPPORTED
#error Your compiler is not officially supprted by dune
#endif
int main() { return 0; }
int main() {
printf(CXX_SUPPORTED);
return 0;
}
_ACEOF
if test "x$compilercheck" != "xyes" ; then
AC_MSG_WARN([compilercheck is disabled. DANGEROUS!])
else
if $CXX conftest.cc -o conftest.$ac_exeext >&5; then
COMPILER_NAME=$(./conftest.$ac_exeext)
rm -f conftest.$ac_exeext
else
AC_MSG_ERROR([Your compiler is not officially supported by dune
......@@ -49,4 +56,8 @@ else
fi
fi
if test x$COMPILER_NAME = x; then
$COMPILER_NAME="unknown compiler"
fi
])
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment