]> git.ozlabs.org Git - petitboot/blob - test/parser/Makefile.am
test/lib: add process 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 AM_CFLAGS = -O0 -ggdb -Wall -Wextra -Werror
25
26 LDADD = $(top_builddir)/lib/libpbcore.la libtest.ro
27
28 TESTS = \
29         test-null \
30         test-grub2-single \
31         test-grub2-multiple-resolve \
32         test-grub2-f18-ppc64 \
33         test-grub2-ubuntu-13_04-x86 \
34         test-kboot-single \
35         test-yaboot-single \
36         test-yaboot-external \
37         test-yaboot-root-global \
38         test-yaboot-root-override \
39         test-yaboot-device-override \
40         test-yaboot-default \
41         test-yaboot-rh8-ppc64 \
42         test-pxe-single \
43         test-pxe-initrd-in-append
44
45 $(TESTS): %: %.embedded-config.o
46 $(TESTS): LDADD += $@.embedded-config.o
47
48 extract_config = $(srcdir)/extract-config.awk
49
50 %.embedded-config.c: %.c $(extract_config)
51         $(AWK) -f $(extract_config) $< > $@
52
53 # objects under test
54 parser_objs = \
55         $(top_srcdir)/discover/yaboot-parser.c \
56         $(top_srcdir)/discover/kboot-parser.c \
57         $(top_srcdir)/discover/grub2-parser.c \
58         $(top_srcdir)/discover/pxe-parser.c \
59         $(top_srcdir)/discover/resource.c \
60         $(top_srcdir)/discover/paths.c \
61         $(top_srcdir)/discover/device-handler.c \
62         $(top_srcdir)/discover/parser-conf.c
63
64 libtest_ro_SOURCES = \
65         main.c \
66         utils.c \
67         handler.c \
68         parser-test.h \
69         $(parser_objs)
70
71 libtest.ro$(EXEEXT): $(libtest_ro_OBJECTS)
72         $(LD) -o $@ -r $^
73
74 check_PROGRAMS = $(TESTS) libtest.ro
75
76 check_DATA = \
77         data/grub2-f18-ppc64.conf \
78         data/grub2-ubuntu-13_04-x86.conf \
79         data/yaboot-rh8-ppc64.conf
80
81 EXTRA_DIST = $(check_DATA) $(extract_config)
82
83 CLEANFILES = \
84         $(foreach f, $(TESTS), $(f).embedded-config.c $(f).embedded-config.o)
85
86 MAINTAINERCLEANFILES = Makefile.in