8b7b751fe1949b5a5148e82c8f867302b120127c
[platform/upstream/elfutils.git] / tests / Makefile.am
1 ## Process this file with automake to create Makefile.in
2 ##
3 ## Copyright (C) 1996-2012 Red Hat, Inc.
4 ## This file is part of elfutils.
5 ##
6 ## This file is free software; you can redistribute it and/or modify
7 ## it under the terms of the GNU General Public License as published by
8 ## the Free Software Foundation; either version 3 of the License, or
9 ## (at your option) any later version.
10 ##
11 ## elfutils is distributed in the hope that it will be useful, but
12 ## WITHOUT ANY WARRANTY; without even the implied warranty of
13 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 ## GNU General Public License for more details.
15 ##
16 ## You should have received a copy of the GNU General Public License
17 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
18 ##
19 include $(top_srcdir)/config/eu.am
20 if MUDFLAP
21 BUILD_RPATH = \$$ORIGIN/../backends
22 else
23 BUILD_RPATH = \$$ORIGIN/../libasm:\$$ORIGIN/../libdw:\$$ORIGIN/../backends:\$$ORIGIN/../libelf
24 endif
25
26 AM_LDFLAGS =
27
28 if !STANDALONE
29 INCLUDES += -I$(top_srcdir)/libasm -I$(top_srcdir)/libdw \
30             -I$(top_srcdir)/libdwfl \
31             -I$(top_srcdir)/libebl -I$(top_srcdir)/libelf \
32             -I$(top_srcdir)/lib -I..
33 AM_LDFLAGS += -Wl,-rpath-link,../libasm:../libdw:../libelf
34 endif
35
36 if TESTS_RPATH
37 AM_LDFLAGS += -Wl,-rpath,$(BUILD_RPATH)
38 tests_rpath = yes
39 else
40 tests_rpath = no
41 endif
42
43 check_PROGRAMS = arextract arsymtest newfile saridx scnnames sectiondump \
44                   showptable update1 update2 update3 update4 test-nlist \
45                   show-die-info get-files get-lines get-pubnames \
46                   get-aranges allfcts line2addr addrscopes funcscopes \
47                   show-abbrev hash newscn ecp dwflmodtest \
48                   find-prologues funcretval allregs rdwrmmap \
49                   dwfl-bug-addr-overflow arls dwfl-bug-fd-leak \
50                   dwfl-addr-sect dwfl-bug-report early-offscn \
51                   dwfl-bug-getmodules dwarf-getmacros addrcfi \
52                   test-flag-nobits dwarf-getstring rerequest_tag \
53                   alldts md5-sha1-test typeiter low_high_pc \
54                   test-elf_cntl_gelf_getshdr
55 asm_TESTS = asm-tst1 asm-tst2 asm-tst3 asm-tst4 asm-tst5 \
56             asm-tst6 asm-tst7 asm-tst8 asm-tst9
57
58 TESTS = run-arextract.sh run-arsymtest.sh newfile test-nlist \
59         update1 update2 update3 update4 \
60         run-show-die-info.sh run-get-files.sh run-get-lines.sh \
61         run-get-pubnames.sh run-get-aranges.sh run-allfcts.sh \
62         run-show-abbrev.sh run-line2addr.sh hash \
63         newscn run-strip-test.sh run-strip-test2.sh \
64         run-strip-test3.sh run-strip-test4.sh run-strip-test5.sh \
65         run-strip-test6.sh run-strip-test7.sh run-strip-test8.sh \
66         run-strip-groups.sh run-strip-reloc.sh \
67         run-unstrip-test.sh run-unstrip-test2.sh \
68         run-ecp-test.sh run-ecp-test2.sh run-alldts.sh \
69         run-elflint-test.sh run-elflint-self.sh run-ranlib-test.sh \
70         run-ranlib-test2.sh run-ranlib-test3.sh run-ranlib-test4.sh \
71         run-addrscopes.sh run-strings-test.sh run-funcscopes.sh \
72         run-find-prologues.sh run-allregs.sh \
73         run-nm-self.sh run-readelf-self.sh \
74         run-readelf-test1.sh run-readelf-test2.sh run-readelf-test3.sh \
75         run-readelf-test4.sh run-readelf-twofiles.sh \
76         run-readelf-macro.sh \
77         run-native-test.sh run-bug1-test.sh \
78         dwfl-bug-addr-overflow run-addrname-test.sh \
79         dwfl-bug-fd-leak dwfl-bug-report \
80         run-dwfl-bug-offline-rel.sh run-dwfl-addr-sect.sh \
81         run-disasm-x86.sh run-disasm-x86-64.sh \
82         run-early-offscn.sh run-dwarf-getmacros.sh \
83         run-test-flag-nobits.sh run-prelink-addr-test.sh \
84         run-dwarf-getstring.sh run-rerequest_tag.sh run-typeiter.sh \
85         run-readelf-d.sh run-readelf-gdb_index.sh run-unstrip-n.sh \
86         run-low_high_pc.sh run-macro-test.sh run-elf_cntl_gelf_getshdr.sh \
87         run-test-archive64.sh run-readelf-vmcoreinfo.sh \
88         run-readelf-mixed-corenote.sh
89
90 if !STANDALONE
91 check_PROGRAMS += msg_tst md5-sha1-test
92 TESTS += msg_tst md5-sha1-test
93 endif
94
95 if HAVE_LIBASM
96 check_PROGRAMS += $(asm_TESTS)
97 TESTS += $(asm_TESTS)
98 endif
99
100 if ENABLE_DWZ
101 TESTS += run-readelf-dwz-multi.sh
102 endif
103
104
105 EXTRA_DIST = run-arextract.sh run-arsymtest.sh \
106              run-show-die-info.sh run-get-files.sh run-get-lines.sh \
107              run-get-pubnames.sh run-get-aranges.sh \
108              run-show-abbrev.sh run-strip-test.sh \
109              run-strip-test2.sh run-ecp-test.sh run-ecp-test2.sh \
110              testfile.bz2 testfile2.bz2 testfile3.bz2 testfile4.bz2 \
111              testfile5.bz2 testfile6.bz2 testfile7.bz2 testfile8.bz2 \
112              testfile9.bz2 testfile10.bz2 testfile11.bz2 testfile12.bz2 \
113              testfile13.bz2 run-strip-test3.sh run-allfcts.sh \
114              run-line2addr.sh run-elflint-test.sh testfile14.bz2 \
115              run-strip-test4.sh run-strip-test5.sh run-strip-test6.sh \
116              run-strip-test7.sh run-strip-test8.sh run-strip-groups.sh \
117              run-strip-reloc.sh hello_i386.ko.bz2 hello_x86_64.ko.bz2 \
118              hello_ppc64.ko.bz2 hello_s390.ko.bz2 \
119              run-unstrip-test.sh run-unstrip-test2.sh \
120              run-elflint-self.sh run-ranlib-test.sh run-ranlib-test2.sh \
121              run-ranlib-test3.sh run-ranlib-test4.sh \
122              run-addrscopes.sh run-strings-test.sh run-funcscopes.sh \
123              run-nm-self.sh run-readelf-self.sh \
124              run-find-prologues.sh run-allregs.sh run-native-test.sh \
125              run-addrname-test.sh run-dwfl-bug-offline-rel.sh \
126              run-dwfl-addr-sect.sh run-early-offscn.sh \
127              run-dwarf-getmacros.sh run-test-flag-nobits.sh \
128              run-dwarf-getstring.sh run-rerequest_tag.sh run-alldts.sh \
129              testfile15.bz2 testfile15.debug.bz2 \
130              testfile16.bz2 testfile16.debug.bz2 \
131              testfile17.bz2 testfile17.debug.bz2 \
132              testfile18.bz2 testfile19.bz2 testfile19.index.bz2 \
133              testfile20.bz2 testfile20.index.bz2 \
134              testfile21.bz2 testfile21.index.bz2 \
135              testfile22.bz2 testfile23.bz2 testfile24.bz2 testfile25.bz2 \
136              testfile26.bz2 testfile27.bz2 \
137              coverage.sh test-subr.sh test-wrapper.sh \
138              run-readelf-test1.sh run-readelf-test2.sh run-readelf-test3.sh \
139              run-readelf-test4.sh run-readelf-twofiles.sh \
140              run-bug1-test.sh testfile28.bz2 testfile28.rdwr.bz2 \
141              testfile29.bz2 testfile29.rdwr.bz2 \
142              testfile30.bz2 testfile31.bz2 testfile32.bz2 testfile33.bz2 \
143              testfile34.bz2 testfile35.bz2 testfile35.debug.bz2 \
144              testfile36.bz2 testfile36.debug.bz2 \
145              testfile37.bz2 testfile37.debug.bz2 \
146              testfile38.bz2 testfile39.bz2 testfile40.bz2 testfile40.debug.bz2 \
147              testfile41.bz2 testfile42.bz2 testfile43.bz2 \
148              testfile44.S.bz2 testfile44.expect.bz2 run-disasm-x86.sh \
149              testfile45.S.bz2 testfile45.expect.bz2 run-disasm-x86-64.sh \
150              testfile46.bz2 testfile47.bz2 testfile48.bz2 testfile48.debug.bz2 \
151              testfile49.bz2 testfile50.bz2 testfile51.bz2 \
152              run-readelf-macro.sh testfilemacro.bz2 \
153              run-readelf-dwz-multi.sh libtestfile_multi_shared.so.bz2 \
154              testfile_multi.dwz.bz2 testfile_multi_main.bz2 \
155              run-prelink-addr-test.sh \
156              testfile52-32.so.bz2 testfile52-32.so.debug.bz2 \
157              testfile52-32.prelink.so.bz2 testfile52-32.noshdrs.so.bz2 \
158              testfile52-64.so.bz2 testfile52-64.so.debug.bz2 \
159              testfile52-64.prelink.so.bz2 testfile52-64.noshdrs.so.bz2 \
160              testfile53-32.bz2 testfile53-32.debug.bz2 \
161              testfile53-32.prelink.bz2 testfile53-64.bz2 \
162              testfile53-64.debug.bz2 testfile53-64.prelink.bz2 \
163              testfile54-32.so.bz2 testfile54-32.so.debug.bz2 \
164              testfile54-32.prelink.so.bz2 testfile54-32.noshdrs.so.bz2 \
165              testfile54-64.so.bz2 testfile54-64.so.debug.bz2 \
166              testfile54-64.prelink.so.bz2 testfile54-64.noshdrs.so.bz2 \
167              testfile55-32.bz2 testfile55-32.debug.bz2 \
168              testfile55-32.prelink.bz2 testfile55-64.bz2 \
169              testfile55-64.debug.bz2 testfile55-64.prelink.bz2 \
170              testfile56.bz2 testfile57.bz2 testfile58.bz2 \
171              run-typeiter.sh testfile59.bz2 \
172              run-readelf-d.sh testlib_dynseg.so.bz2 \
173              run-readelf-gdb_index.sh testfilegdbindex5.bz2 \
174              testfilegdbindex7.bz2 \
175              run-unstrip-n.sh testcore-rtlib.bz2 testcore-rtlib-ppc.bz2 \
176              run-low_high_pc.sh testfile_low_high_pc.bz2 \
177              run-macro-test.sh testfile-macinfo.bz2 testfile-macros.bz2 \
178              run-elf_cntl_gelf_getshdr.sh \
179              run-test-archive64.sh testarchive64.a.bz2 \
180              testfile60.bz2 testfile61.bz2 \
181              run-readelf-vmcoreinfo.sh testfile62.bz2 \
182              run-readelf-mixed-corenote.sh testfile63.bz2 testfile64.bz2 \
183              testfile65.bz2 testfile69.core.bz2 testfile69.so.bz2 \
184              testfile70.core.bz2 testfile70.exec.bz2
185
186 if USE_VALGRIND
187 valgrind_cmd="valgrind -q --trace-children=yes --error-exitcode=1 --run-libc-freeres=no"
188 endif
189
190 installed_TESTS_ENVIRONMENT = libdir=$(DESTDIR)$(libdir) \
191                               bindir=$(DESTDIR)$(bindir) \
192                               LC_ALL=C LANG=C \
193                               VALGRIND_CMD=$(valgrind_cmd) \
194                               $(srcdir)/test-wrapper.sh \
195                               installed $(tests_rpath) \
196                               $(program_transform_name)
197 if STANDALONE
198 TESTS_ENVIRONMENT = $(installed_TESTS_ENVIRONMENT)
199 else !STANDALONE
200 TESTS_ENVIRONMENT = LC_ALL=C LANG=C VALGRIND_CMD=$(valgrind_cmd) \
201                     $(srcdir)/test-wrapper.sh \
202                     ../libdw:../backends:../libelf:../libasm
203
204 installcheck-local:
205         $(MAKE) $(AM_MAKEFLAGS) \
206                 TESTS_ENVIRONMENT='$(installed_TESTS_ENVIRONMENT)' check-TESTS
207 endif !STANDALONE
208
209 if MUDFLAP
210 static_build = yes
211 endif
212
213 if STANDALONE
214 libdw = -ldw
215 libelf = -lelf
216 libasm = -lasm
217 libebl = -lebl
218 else !STANDALONE
219 if BUILD_STATIC
220 libdw = ../libdw/libdw.a $(zip_LIBS) $(libelf) $(libebl) -ldl
221 libelf = ../libelf/libelf.a
222 libasm = ../libasm/libasm.a
223 else
224 libdw = ../libdw/libdw.so
225 libelf = ../libelf/libelf.so
226 libasm = ../libasm/libasm.so
227 endif
228 libebl = ../libebl/libebl.a
229 libeu = ../lib/libeu.a
230 endif !STANDALONE
231
232 arextract_LDADD = $(libelf) $(libmudflap)
233 arsymtest_LDADD = $(libelf) $(libmudflap)
234 newfile_LDADD = $(libelf) $(libmudflap)
235 saridx_LDADD = $(libelf) $(libmudflap)
236 scnnames_LDADD = $(libelf) $(libmudflap)
237 sectiondump_LDADD = $(libelf) $(libmudflap)
238 showptable_LDADD = $(libelf) $(libmudflap)
239 hash_LDADD = $(libelf) $(libmudflap)
240 test_nlist_LDADD = $(libelf) $(libmudflap)
241 msg_tst_LDADD = $(libelf) $(libmudflap)
242 newscn_LDADD = $(libelf) $(libmudflap)
243 early_offscn_LDADD = $(libelf) $(libmudflap)
244 ecp_LDADD = $(libelf) $(libmudflap)
245 update1_LDADD = $(libelf) $(libmudflap)
246 update2_LDADD = $(libelf) $(libmudflap)
247 update3_LDADD = $(libebl) $(libelf) $(libmudflap)
248 update4_LDADD = $(libebl) $(libelf) $(libmudflap)
249 show_die_info_LDADD = $(libdw) $(libelf) $(libmudflap)
250 get_pubnames_LDADD = $(libdw) $(libelf) $(libmudflap)
251 show_abbrev_LDADD = $(libdw) $(libelf) $(libmudflap)
252 get_lines_LDADD = $(libdw) $(libelf) $(libmudflap)
253 get_files_LDADD = $(libdw) $(libelf) $(libmudflap)
254 get_aranges_LDADD = $(libdw) $(libelf) $(libmudflap)
255 allfcts_LDADD = $(libdw) $(libelf) $(libmudflap)
256 line2addr_no_Wformat = yes
257 line2addr_LDADD = $(libdw) $(libmudflap)
258 addrscopes_LDADD = $(libdw) $(libmudflap)
259 funcscopes_LDADD = $(libdw) $(libmudflap)
260 funcretval_LDADD = $(libdw) $(libmudflap)
261 allregs_LDADD = $(libdw) $(libmudflap)
262 find_prologues_LDADD = $(libdw) $(libmudflap)
263 #show_ciefde_LDADD = ../libdwarf/libdwarf.so $(libelf) $(libmudflap)
264 asm_tst1_LDADD = $(libasm) $(libebl) $(libelf) $(libmudflap) -ldl
265 asm_tst2_LDADD = $(libasm) $(libebl) $(libelf) $(libmudflap) -ldl
266 asm_tst3_LDADD = $(libasm) $(libebl) $(libelf) $(libmudflap) -ldl
267 asm_tst4_LDADD = $(libasm) $(libebl) $(libelf) $(libmudflap) -ldl
268 asm_tst5_LDADD = $(libasm) $(libebl) $(libelf) $(libmudflap) -ldl
269 asm_tst6_LDADD = $(libasm) $(libebl) $(libelf) $(libmudflap) -ldl
270 asm_tst7_LDADD = $(libasm) $(libebl) $(libelf) $(libmudflap) -ldl
271 asm_tst8_LDADD = $(libasm) $(libebl) $(libelf) $(libmudflap) -ldl
272 asm_tst9_LDADD = $(libasm) $(libebl) $(libelf) $(libmudflap) -ldl
273 dwflmodtest_LDADD = $(libdw) $(libebl) $(libelf) $(libmudflap) -ldl
274 rdwrmmap_LDADD = $(libelf) $(libmudflap)
275 dwfl_bug_addr_overflow_LDADD = $(libdw) $(libebl) $(libelf) $(libmudflap) -ldl
276 arls_LDADD = $(libelf) $(libmudflap)
277 dwfl_bug_fd_leak_LDADD = $(libdw) $(libebl) $(libelf) $(libmudflap) -ldl
278 dwfl_bug_report_LDADD = $(libdw) $(libebl) $(libelf) $(libmudflap) -ldl
279 dwfl_bug_getmodules_LDADD = $(libdw) $(libebl) $(libelf) $(libmudflap) -ldl
280 dwfl_addr_sect_LDADD = $(libdw) $(libebl) $(libelf) $(libmudflap) -ldl
281 dwarf_getmacros_LDADD = $(libdw) $(libmudflap)
282 dwarf_getstring_LDADD = $(libdw) $(libmudflap)
283 addrcfi_LDADD = $(libdw) $(libebl) $(libelf) $(libmudflap) -ldl
284 test_flag_nobits_LDADD = $(libelf) $(libmudflap)
285 rerequest_tag_LDADD = $(libdw) $(libmudflap)
286 alldts_LDADD = $(libebl) $(libelf) $(libmudflap)
287 md5_sha1_test_LDADD = $(libeu)
288 typeiter_LDADD = $(libdw) $(libelf) $(libmudflap)
289 low_high_pc_LDADD = $(libdw) $(libelf) $(libmudflap)
290 test_elf_cntl_gelf_getshdr_LDADD = $(libelf) $(libmudflap)
291
292 if GCOV
293 check: check-am coverage
294 .PHONY: coverage
295 coverage:
296         -$(srcdir)/coverage.sh
297 endif