-
Notifications
You must be signed in to change notification settings - Fork 0
/
autotest.mk
89 lines (70 loc) · 2.72 KB
/
autotest.mk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# -*-Automake-*-
# Copyright (C) 2009 by Thomas Moulard, AIST, CNRS, INRIA.
# This file is part of the roboptim.
#
# roboptim is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Additional permission under section 7 of the GNU General Public
# License, version 3 ("GPLv3"):
#
# If you convey this file as part of a work that contains a
# configuration script generated by Autoconf, you may do so under
# terms of your choice.
#
# roboptim is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with roboptim. If not, see <http://www.gnu.org/licenses/>.
# -------#
# README #
# -------#
# This file should be included in Makefile.am associated to a directory which
# contains an Autotest test suite.
#
# This file assumes that:
#
# - you include *before* this file init.mk or make sure that any global
# variable can be used with the += syntax.
# - package.m4 is located in $(top_builddir)/tests
# - you provide atlocal and testsuite.at files (see Autotest
# documentation in the Autoconf manual).
# - you define TESTSUITE_AT which contains the list of the .at files
# included by this test suite.
# -----#
# TODO #
# -----#
# - Make it more generic.
# Define how autom4te is called to generate the testsuite file.
AUTOTEST = $(AUTOM4TE) --language=autotest -Wall
# Package following files.
EXTRA_DIST += atlocal testsuite.at $(TESTSUITE) $(TESTSUITE_AT)
# Run testsuite in this directory.
TESTSUITE = $(srcdir)/testsuite
# Define where package.m4.in is located.
PACKAGE_M4_IN=$(top_srcdir)/tests/package.m4.in
# Define m4 dependencies.
TESTSUITE_AT = $(top_srcdir)/build-aux/autotest.at
TESTSUITEDIR ?= '$(top_builddir)/tests'
# ----- #
# RULES #
# ----- #
check-local: atconfig atlocal $(TESTSUITE)
$(SHELL) $(TESTSUITE) $(TESTSUITEFLAGS)
installcheck-local: atconfig atlocal $(TESTSUITE)
$(SHELL) $(TESTSUITE) AUTOTEST_PATH="$(bindir)" $(TESTSUITEFLAGS)
clean-local:
test ! -f $(TESTSUITE) || $(SHELL) $(TESTSUITE) --clean
rm -f -r autom4te.cache
$(TESTSUITE): $(PACKAGE_M4_IN) $(srcdir)/testsuite.at $(TESTSUITE_AT) \
$(top_srcdir)/configure
$(AUTOTEST) -I'$(srcdir)' -I'$(top_srcdir)/build-aux' \
-I$(TESTSUITEDIR) $@.at -o $@.tmp
mv $@.tmp $@
atconfig: $(top_builddir)/config.status
cd $(top_builddir) && $(SHELL) ./config.status tests/$@