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 $(AM_V_GEN)$(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
62 { echo '#! /bin/sh'; \
63 echo 'exec $(SHELL) $(srcdir)/testsuite "$$@"'; \
64 } >$@.new && chmod +x $@.new && mv $@.new $@
66 ###--------------------------------------------------------------------------
67 ### Infrastructure for the test suite build process.
70 TESTDEPS += $(srcdir)/tests.m4
71 MAINTAINERCLEANFILES += $(srcdir)/tests.m4
72 EXTRA_DIST += tests.m4
74 $(srcdir)/tests.m4: Makefile.in
76 for i in $(all_autotest_TESTS); do \
78 -e 's:^$(top_srcdir):$(top_builddir):' \
79 -e 's:\(.*\)/\([^/]*\)$$:TESTS([\1], [\2]):'; \
80 done >$@.new && mv $@.new $@
83 TESTDEPS += $(srcdir)/package.m4
84 MAINTAINERCLEANFILES += $(srcdir)/package.m4
85 EXTRA_DIST += package.m4
87 $(srcdir)/package.m4: $(top_srcdir)/configure.ac
89 { echo '### package information'; \
90 echo 'm4_define([AT_PACKAGE_NAME], [@PACKAGE_NAME@])'; \
91 echo 'm4_define([AT_PACKAGE_TARNAME], [@PACKAGE_TARNAME@])'; \
92 echo 'm4_define([AT_PACKAGE_VERSION], [@PACKAGE_VERSION@])'; \
93 echo 'm4_define([AT_PACKAGE_STRING], [@PACKAGE_STRING@])'; \
94 echo 'm4_define([AT_PACKAGE_BUGREPORT], [@PACKAGE_BUGREPORT@])'; \
95 } >$@.new && mv $@.new $@
97 ###----- That's all, folks --------------------------------------------------