summaryrefslogtreecommitdiffstats
path: root/test/parser/Makefile.am
blob: 32f204d31fa7337f775ca3e8ead1f69c8e7b049c (plain)
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
90
91
92
93
94
95
96
97
98
99
100
101
#  This program 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; version 2 of the License.
#
#  This program 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 this program; if not, write to the Free Software
#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

AUTOMAKE_OPTIONS = parallel-tests

AM_CPPFLAGS = \
	-I$(top_srcdir) \
	-I$(top_srcdir)/lib \
	-I$(top_srcdir)/discover \
	-DLOCAL_STATE_DIR='"$(localstatedir)"' \
	-DTEST_CONF_BASE='"$(srcdir)/data"' \
	-DDEBUG -DPETITBOOT_TEST

AM_CFLAGS = -O0 -ggdb -Wall -Wextra -Werror

LDADD = $(top_builddir)/lib/libpbcore.la libtest.ro

TESTS = \
	test-null \
	test-grub2-single \
	test-grub2-default \
	test-grub2-default-index \
	test-grub2-default-multiword \
	test-grub2-multiple-resolve \
	test-grub2-single-line-if \
	test-grub2-load-env \
	test-grub2-save-env \
	test-grub2-f18-ppc64 \
	test-grub2-ubuntu-13_04-x86 \
	test-grub2-lexer-error \
	test-grub2-parser-error \
	test-kboot-single \
	test-yaboot-single \
	test-yaboot-partition \
	test-yaboot-partition-override \
	test-yaboot-external \
	test-yaboot-root-global \
	test-yaboot-root-override \
	test-yaboot-device-override \
	test-yaboot-default \
	test-yaboot-rh8-ppc64 \
	test-pxe-empty \
	test-pxe-single \
	test-pxe-initrd-in-append

$(TESTS): %: %.embedded-config.o
$(TESTS): LDADD += $@.embedded-config.o

extract_config = $(srcdir)/extract-config.awk

%.embedded-config.c: %.c $(extract_config)
	$(AWK) -f $(extract_config) $< > $@

# objects under test
parser_objs = \
	$(top_srcdir)/discover/yaboot-parser.c \
	$(top_srcdir)/discover/kboot-parser.c \
	$(top_srcdir)/discover/pxe-parser.c \
	$(top_srcdir)/discover/resource.c \
	$(top_srcdir)/discover/paths.c \
	$(top_srcdir)/discover/device-handler.c \
	$(top_srcdir)/discover/parser-conf.c \
	$(top_srcdir)/discover/user-event.c \
	$(top_srcdir)/discover/event.c

libtest_ro_SOURCES = \
	main.c \
	utils.c \
	handler.c \
	parser-test.h \
	$(parser_objs)

libtest_ro_LDADD = \
	../../discover/grub2/grub2-parser.ro

libtest.ro$(EXEEXT): $(libtest_ro_OBJECTS) $(libtest_ro_LDADD)
	$(LD) -o $@ -r $^

check_PROGRAMS = $(TESTS) libtest.ro

check_DATA = \
	data/grub2-f18-ppc64.conf \
	data/grub2-ubuntu-13_04-x86.conf \
	data/yaboot-rh8-ppc64.conf

EXTRA_DIST = $(check_DATA) $(extract_config)

CLEANFILES = \
	$(foreach f, $(TESTS), $(f).embedded-config.c $(f).embedded-config.o)

MAINTAINERCLEANFILES = Makefile.in
OpenPOWER on IntegriCloud