]> git.ozlabs.org Git - petitboot/blob - test/parser/Makefile.am
363933e324efabba0168e9c93d923ab88706f555
[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 parser_TESTS = \
15         test/parser/test-null \
16         test/parser/test-grub2-single \
17         test/parser/test-grub2-default \
18         test/parser/test-grub2-empty \
19         test/parser/test-grub2-noeol \
20         test/parser/test-grub2-menuentry-formats \
21         test/parser/test-grub2-if-formats \
22         test/parser/test-grub2-default-index \
23         test/parser/test-grub2-default-multiword \
24         test/parser/test-grub2-implicit-default-unset \
25         test/parser/test-grub2-implicit-default-invalid \
26         test/parser/test-grub2-multiple-resolve \
27         test/parser/test-grub2-multiple-id \
28         test/parser/test-grub2-single-line-if \
29         test/parser/test-grub2-pos-param \
30         test/parser/test-grub2-load-env \
31         test/parser/test-grub2-save-env \
32         test/parser/test-grub2-save-env-dash-f \
33         test/parser/test-grub2-saved-default \
34         test/parser/test-grub2-nondefault-prefix \
35         test/parser/test-grub2-f18-ppc64 \
36         test/parser/test-grub2-f20-ppc64 \
37         test/parser/test-grub2-ubuntu-13_04-x86 \
38         test/parser/test-grub2-sles-btrfs-snapshot \
39         test/parser/test-grub2-lexer-error \
40         test/parser/test-grub2-parser-error \
41         test/parser/test-grub2-test-file-ops \
42         test/parser/test-grub2-single-yocto \
43         test/parser/test-grub2-blscfg-default-filename \
44         test/parser/test-grub2-blscfg-default-index \
45         test/parser/test-grub2-blscfg-default-title \
46         test/parser/test-grub2-blscfg-multiple-bls \
47         test/parser/test-grub2-blscfg-opts-config \
48         test/parser/test-grub2-blscfg-opts-grubenv \
49         test/parser/test-kboot-single \
50         test/parser/test-kboot-default \
51         test/parser/test-yaboot-empty \
52         test/parser/test-yaboot-single \
53         test/parser/test-yaboot-partition \
54         test/parser/test-yaboot-partition-override \
55         test/parser/test-yaboot-external \
56         test/parser/test-yaboot-root-global \
57         test/parser/test-yaboot-root-override \
58         test/parser/test-yaboot-device-override \
59         test/parser/test-yaboot-global-state \
60         test/parser/test-yaboot-leftovers \
61         test/parser/test-yaboot-default \
62         test/parser/test-yaboot-rh8-ppc64 \
63         test/parser/test-pxe-empty \
64         test/parser/test-pxe-single \
65         test/parser/test-pxe-initrd-in-append \
66         test/parser/test-pxe-mac-without-conf \
67         test/parser/test-pxe-ip-without-conf \
68         test/parser/test-pxe-ipxe \
69         test/parser/test-pxe-ipxe-named \
70         test/parser/test-pxe-ipxe-default \
71         test/parser/test-pxe-non-url-conf \
72         test/parser/test-pxe-local \
73         test/parser/test-pxe-ipappend \
74         test/parser/test-pxe-pathprefix-with-conf \
75         test/parser/test-pxe-non-url-pathprefix-with-conf \
76         test/parser/test-pxe-pathprefix-discover \
77         test/parser/test-pxe-pathprefix-discover-mac \
78         test/parser/test-pxe-path-resolve-relative \
79         test/parser/test-pxe-path-resolve-absolute \
80         test/parser/test-pxe-discover-bootfile-root \
81         test/parser/test-pxe-discover-bootfile-subdir \
82         test/parser/test-pxe-discover-bootfile-pathprefix \
83         test/parser/test-pxe-discover-bootfile-relative-conffile \
84         test/parser/test-pxe-discover-bootfile-absolute-conffile \
85         test/parser/test-pxe-discover-bootfile-async-file \
86         test/parser/test-unresolved-remove \
87         test/parser/test-syslinux-single-yocto \
88         test/parser/test-syslinux-global-append \
89         test/parser/test-syslinux-explicit \
90         test/parser/test-syslinux-nested-config
91
92
93 TESTS += $(parser_TESTS)
94 check_PROGRAMS += $(parser_TESTS) test/parser/libtest.ro
95
96 check_DATA += \
97         test/parser/data/grub2-f18-ppc64.conf \
98         test/parser/data/grub2-f20-ppc.conf \
99         test/parser/data/grub2-ubuntu-13_04-x86.conf \
100         test/parser/data/yaboot-rh8-ppc64.conf \
101         test/parser/data/syslinux-include-root.cfg \
102         test/parser/data/syslinux-include-nest-1.cfg \
103         test/parser/data/syslinux-include-nest-2.cfg
104
105 $(parser_TESTS): AM_CPPFLAGS += \
106                 -I$(top_srcdir)/discover \
107                 -DLOCAL_STATE_DIR='"$(localstatedir)"'
108 $(parser_TESTS): LDADD += $@.embedded-config.o test/parser/libtest.ro $(core_lib)
109 $(parser_TESTS): %: %.embedded-config.o test/parser/libtest.ro $(core_lib)
110
111 extract_config = $(srcdir)/test/parser/extract-config.awk
112
113 %.embedded-config.c: %.c $(extract_config)
114         $(AM_V_GEN)$(AWK) -f $(extract_config) $< > $@
115
116 # objects under test
117
118 test_parser_libtest_ro_SOURCES = \
119         test/parser/main.c \
120         test/parser/utils.c \
121         test/parser/handler.c \
122         test/parser/network.c \
123         test/parser/user-event.c \
124         test/parser/parser-test.h \
125         discover/yaboot-parser.c \
126         discover/kboot-parser.c \
127         discover/pxe-parser.c \
128         discover/syslinux-parser.c \
129         discover/platform.c \
130         discover/resource.c \
131         discover/paths.c \
132         discover/device-handler.c \
133         discover/parser-conf.c \
134         discover/user-event.c \
135         discover/event.c \
136         $(discover_grub2_grub2_parser_ro_SOURCES)
137
138 test_parser_libtest_ro_CPPFLAGS = \
139         $(AM_CPPFLAGS) \
140         -I$(top_srcdir)/discover \
141         -I$(top_srcdir)/discover/grub2 \
142         -I$(top_builddir)/discover/grub2 \
143         -DPETITBOOT_TEST \
144         -DLOCAL_STATE_DIR='"$(localstatedir)"' \
145         -DTEST_CONF_BASE='"$(top_srcdir)/test/parser/data"'
146
147 test/parser/libtest.ro$(EXEEXT): $(test_parser_libtest_ro_OBJECTS) \
148                                            $(test_parser_libtest_ro_LDADD)
149         $(AM_V_GEN)$(LD) -o $@ -r $^
150
151 EXTRA_DIST += $(check_DATA) $(extract_config)
152
153 CLEANFILES += \
154         $(foreach f, $(TESTS), $(f).embedded-config.c $(f).embedded-config.o)
155