3 ### Build script for test framework
5 ### (c) 2008 Straylight/Edgeware
8 ###----- Licensing notice ---------------------------------------------------
10 ### This file is part of the Common Files Distribution (`common').
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.
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.
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.
29 MAINTAINERCLEANFILES =
31 ###--------------------------------------------------------------------------
34 check-local: atconfig run-tests
35 ./run-tests $(TEST_ARGS)
37 ###--------------------------------------------------------------------------
38 ### Building the test suite.
41 all_autotest_TESTS = $(autotest_TESTS) $(nodist_autotest_TESTS)
42 TESTDEPS = testsuite.at Makefile.in $(all_autotest_TESTS)
43 CLEANFILES += testsuite.log
44 DISTCLEANFILES += atconfig
45 MAINTAINERCLEANFILES += $(srcdir)/testsuite
46 EXTRA_DIST += testsuite.at testsuite $(autotest_TESTS)
48 $(srcdir)/testsuite: $(TESTDEPS)
49 $(AUTOM4TE) --language=autotest \
50 -I$(srcdir) $@.at -o $@.new && mv $@.new $@
52 clean-local: clean-testsuite-dir
53 .PHONY: clean-testsuite-dir
58 CLEANFILES += run-tests
60 run-tests: Makefile $(srcdir)/testsuite
61 { echo '#! /bin/sh'; \
62 echo 'exec $(SHELL) $(srcdir)/testsuite "$$@"'; \
63 } >$@.new && chmod +x $@.new && mv $@.new $@
65 ###--------------------------------------------------------------------------
66 ### Infrastructure for the test suite build process.
69 TESTDEPS += $(srcdir)/tests.m4
70 MAINTAINERCLEANFILES += $(srcdir)/tests.m4
71 EXTRA_DIST += tests.m4
73 $(srcdir)/tests.m4: Makefile.in
74 for i in $(all_autotest_TESTS); do \
76 -e 's:^$(top_srcdir):$(top_builddir):' \
77 -e 's:\(.*\)/\([^/]*\)$$:TESTS([\1], [\2]):'; \
78 done >$@.new && mv $@.new $@
81 TESTDEPS += $(srcdir)/package.m4
82 MAINTAINERCLEANFILES += $(srcdir)/package.m4
83 EXTRA_DIST += package.m4
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 $@
94 ###----- That's all, folks --------------------------------------------------