eca4c0a6df9ee61368aa19dcb3b6ae250b20d1dc
[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-default-index \
20         test/parser/test-grub2-default-multiword \
21         test/parser/test-grub2-multiple-resolve \
22         test/parser/test-grub2-multiple-id \
23         test/parser/test-grub2-single-line-if \
24         test/parser/test-grub2-load-env \
25         test/parser/test-grub2-save-env \
26         test/parser/test-grub2-saved-default \
27         test/parser/test-grub2-nondefault-prefix \
28         test/parser/test-grub2-f18-ppc64 \
29         test/parser/test-grub2-f20-ppc64 \
30         test/parser/test-grub2-ubuntu-13_04-x86 \
31         test/parser/test-grub2-lexer-error \
32         test/parser/test-grub2-parser-error \
33         test/parser/test-kboot-single \
34         test/parser/test-yaboot-empty \
35         test/parser/test-yaboot-single \
36         test/parser/test-yaboot-partition \
37         test/parser/test-yaboot-partition-override \
38         test/parser/test-yaboot-external \
39         test/parser/test-yaboot-root-global \
40         test/parser/test-yaboot-root-override \
41         test/parser/test-yaboot-device-override \
42         test/parser/test-yaboot-global-state \
43         test/parser/test-yaboot-leftovers \
44         test/parser/test-yaboot-default \
45         test/parser/test-yaboot-rh8-ppc64 \
46         test/parser/test-pxe-empty \
47         test/parser/test-pxe-single \
48         test/parser/test-pxe-initrd-in-append \
49         test/parser/test-pxe-mac-without-conf \
50         test/parser/test-pxe-ip-without-conf \
51         test/parser/test-pxe-non-url-conf \
52         test/parser/test-pxe-local \
53         test/parser/test-pxe-ipappend \
54         test/parser/test-pxe-pathprefix-with-conf \
55         test/parser/test-pxe-non-url-pathprefix-with-conf \
56         test/parser/test-pxe-pathprefix-discover \
57         test/parser/test-pxe-pathprefix-discover-mac \
58         test/parser/test-pxe-path-resolve-relative \
59         test/parser/test-pxe-path-resolve-absolute \
60         test/parser/test-pxe-discover-bootfile-root \
61         test/parser/test-pxe-discover-bootfile-subdir \
62         test/parser/test-pxe-discover-bootfile-pathprefix \
63         test/parser/test-pxe-discover-bootfile-relative-conffile \
64         test/parser/test-pxe-discover-bootfile-absolute-conffile \
65         test/parser/test-unresolved-remove
66
67 TESTS += $(parser_TESTS)
68 check_PROGRAMS += $(parser_TESTS) test/parser/libtest.ro
69
70 check_DATA += \
71         test/parser/data/grub2-f18-ppc64.conf \
72         test/parser/data/grub2-f20-ppc.conf \
73         test/parser/data/grub2-ubuntu-13_04-x86.conf \
74         test/parser/data/yaboot-rh8-ppc64.conf
75
76 $(parser_TESTS): AM_CPPFLAGS += \
77                 -I$(top_srcdir)/discover \
78                 -DLOCAL_STATE_DIR='"$(localstatedir)"'
79 $(parser_TESTS): LDADD += $@.embedded-config.o test/parser/libtest.ro $(core_lib)
80 $(parser_TESTS): %: %.embedded-config.o test/parser/libtest.ro $(core_lib)
81
82 extract_config = $(srcdir)/test/parser/extract-config.awk
83
84 %.embedded-config.c: %.c $(extract_config)
85         $(AM_V_GEN)$(AWK) -f $(extract_config) $< > $@
86
87 # objects under test
88
89 test_parser_libtest_ro_SOURCES = \
90         test/parser/main.c \
91         test/parser/utils.c \
92         test/parser/handler.c \
93         test/parser/parser-test.h \
94         discover/yaboot-parser.c \
95         discover/kboot-parser.c \
96         discover/pxe-parser.c \
97         discover/platform.c \
98         discover/resource.c \
99         discover/paths.c \
100         discover/device-handler.c \
101         discover/parser-conf.c \
102         discover/user-event.c \
103         discover/event.c \
104         $(discover_grub2_grub2_parser_ro_SOURCES)
105
106 test_parser_libtest_ro_CPPFLAGS = \
107         $(AM_CPPFLAGS) \
108         -I$(top_srcdir)/discover \
109         -I$(top_srcdir)/discover/grub2 \
110         -I$(top_builddir)/discover/grub2 \
111         -DPETITBOOT_TEST \
112         -DLOCAL_STATE_DIR='"$(localstatedir)"' \
113         -DTEST_CONF_BASE='"$(top_srcdir)/test/parser/data"'
114
115 test/parser/libtest.ro$(EXEEXT): $(test_parser_libtest_ro_OBJECTS) \
116                                            $(test_parser_libtest_ro_LDADD)
117         $(AM_V_GEN)$(LD) -o $@ -r $^
118
119 EXTRA_DIST += $(check_DATA) $(extract_config)
120
121 CLEANFILES += \
122         $(foreach f, $(TESTS), $(f).embedded-config.c $(f).embedded-config.o)
123