]> git.ozlabs.org Git - petitboot/blob - test/parser/Makefile.am
test/parser: Add ubuntu grub tests
[petitboot] / test / parser / Makefile.am
1 #  This program is free software; you can redistribute it and/or modify
2 #  it under the terms of the GNU General Public License as published by
3 #  the Free Software Foundation; version 2 of the License.
4 #
5 #  This program is distributed in the hope that it will be useful,
6 #  but WITHOUT ANY WARRANTY; without even the implied warranty of
7 #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
8 #  GNU General Public License for more details.
9 #
10 #  You should have received a copy of the GNU General Public License
11 #  along with this program; if not, write to the Free Software
12 #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
13
14 AUTOMAKE_OPTIONS = parallel-tests
15
16 AM_CPPFLAGS = \
17         -I$(top_srcdir) \
18         -I$(top_srcdir)/lib \
19         -I$(top_srcdir)/discover \
20         -DLOCAL_STATE_DIR='"$(localstatedir)"' \
21         -DTEST_CONF_BASE='"$(srcdir)/data"' \
22         -DDEBUG -DPETITBOOT_TEST
23
24
25 AM_CFLAGS = -O0 -ggdb -Wall -Wextra -Werror
26
27 TESTS = test-null \
28         test-grub2-single \
29         test-grub2-multiple-resolve \
30         test-grub2-f18-ppc64 \
31         test-grub2-ubuntu-13_04-x86 \
32         test-kboot-single \
33         test-yaboot-single \
34         test-yaboot-external \
35         test-yaboot-rh8-ppc64
36
37 check_PROGRAMS = $(TESTS)
38 check_LIBRARIES = $(test_libs)
39 check_DATA = data/grub2-f18-ppc64.conf \
40              data/grub2-ubuntu-13_04-x86.conf \
41              data/yaboot-rh8-ppc64.conf
42
43 common_libs = $(top_builddir)/lib/libpbcore.la
44 test_libs = libtest.o
45
46 libtest.o: $(libtest_o_OBJECTS)
47         $(LD) -o $@ -r $^
48
49 # objects under test
50 parser_test_objs = $(top_srcdir)/discover/yaboot-parser.c \
51                    $(top_srcdir)/discover/kboot-parser.c \
52                    $(top_srcdir)/discover/grub2-parser.c \
53                    $(top_srcdir)/discover/resource.c \
54                    $(top_srcdir)/discover/paths.c \
55                    $(top_srcdir)/discover/device-handler.c \
56                    $(top_srcdir)/discover/parser-conf.c
57
58
59 LDADD = $(common_libs) $(test_libs)
60
61 libtest_o_SOURCES = utils.c parser-test.h handler.c main.c $(parser_test_objs)
62
63 $(check_PROGRAMS): %: %.embedded-config.o
64 $(check_PROGRAMS): LDADD += $@.embedded-config.o
65
66 extract_config = $(srcdir)/extract-config.awk
67
68 %.embedded-config.c: %.c $(extract_config)
69         gawk --file=$(extract_config) $^ > $@
70
71 EXTRA_DIST = $(check_DATA) $(extract_config)
72
73 CLEANFILES = $(foreach f, $(check_PROGRAMS), \
74                 $(f).embedded-config.c $(f).embedded-config.o)