debian: Ignore debhelper logs.
[cfd] / autotest.am
CommitLineData
74c50df9
MW
1### -*-makefile-*-
2###
3### Build script for test framework
4###
5### (c) 2008 Straylight/Edgeware
6###
7
8###----- Licensing notice ---------------------------------------------------
9###
10### This file is part of the Common Files Distribution (`common').
11###
12### `Common' is free software; you can redistribute it and/or modify
13### it under the terms of the GNU General Public License as published by
14### the Free Software Foundation; either version 2 of the License, or
15### (at your option) any later version.
16###
17### `Common' is distributed in the hope that it will be useful,
18### but WITHOUT ANY WARRANTY; without even the implied warranty of
19### MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20### GNU General Public License for more details.
21###
22### You should have received a copy of the GNU General Public License
23### along with `common'; if not, write to the Free Software Foundation,
24### Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
25
26EXTRA_DIST =
27CLEANFILES =
28DISTCLEANFILES =
29MAINTAINERCLEANFILES =
30
31###--------------------------------------------------------------------------
32### The test suite.
33
34check-local: atconfig run-tests
35 ./run-tests $(TEST_ARGS)
36
37###--------------------------------------------------------------------------
38### Building the test suite.
39
40## testsuite
41all_autotest_TESTS = $(autotest_TESTS) $(nodist_autotest_TESTS)
42TESTDEPS = testsuite.at Makefile.in $(all_autotest_TESTS)
43CLEANFILES += testsuite.log
44DISTCLEANFILES += atconfig
45MAINTAINERCLEANFILES += $(srcdir)/testsuite
46EXTRA_DIST += testsuite.at testsuite $(autotest_TESTS)
47
48$(srcdir)/testsuite: $(TESTDEPS)
49 $(AUTOM4TE) --language=autotest \
50 -I$(srcdir) $@.at -o $@.new && mv $@.new $@
51
52clean-local: clean-testsuite-dir
53.PHONY: clean-testsuite-dir
54clean-testsuite-dir:
55 -rm -rf testsuite.dir
56
57## run-tests
58CLEANFILES += run-tests
59
60run-tests: Makefile $(srcdir)/testsuite
61 { echo '#! /bin/sh'; \
62 echo 'exec $(SHELL) $(srcdir)/testsuite "$$@"'; \
63 } >$@.new && chmod +x $@.new && mv $@.new $@
64
65###--------------------------------------------------------------------------
66### Infrastructure for the test suite build process.
67
68## tests.m4
69TESTDEPS += $(srcdir)/tests.m4
70MAINTAINERCLEANFILES += $(srcdir)/tests.m4
71EXTRA_DIST += tests.m4
72
73$(srcdir)/tests.m4: Makefile.in
74 for i in $(all_autotest_TESTS); do \
75 echo $$i | sed \
76 -e 's:^$(top_srcdir):$(top_builddir):' \
77 -e 's:\(.*\)/\([^/]*\)$$:TESTS([\1], [\2]):'; \
78 done >$@.new && mv $@.new $@
79
80## package.m4
81TESTDEPS += $(srcdir)/package.m4
82MAINTAINERCLEANFILES += $(srcdir)/package.m4
83EXTRA_DIST += package.m4
84
85$(srcdir)/package.m4: $(top_srcdir)/configure.ac
86 { echo '### package information'; \
87 echo 'm4_define([AT_PACKAGE_NAME], [@PACKAGE_NAME@])'; \
88 echo 'm4_define([AT_PACKAGE_TARNAME], [@PACKAGE_TARNAME@])'; \
89 echo 'm4_define([AT_PACKAGE_VERSION], [@PACKAGE_VERSION@])'; \
90 echo 'm4_define([AT_PACKAGE_STRING], [@PACKAGE_STRING@])'; \
91 echo 'm4_define([AT_PACKAGE_BUGREPORT], [@PACKAGE_BUGREPORT@])'; \
92 } >$@.new && mv $@.new $@
93
94###----- That's all, folks --------------------------------------------------