Imported Upstream version 0.155
[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
88
89 if !STANDALONE
90 check_PROGRAMS += msg_tst md5-sha1-test
91 TESTS += msg_tst md5-sha1-test
92 endif
93
94 if HAVE_LIBASM
95 check_PROGRAMS += $(asm_TESTS)
96 TESTS += $(asm_TESTS)
97 endif
98
99 if ENABLE_DWZ
100 TESTS += run-readelf-dwz-multi.sh
101 endif
102
103
104 EXTRA_DIST = run-arextract.sh run-arsymtest.sh \
105              run-show-die-info.sh run-get-files.sh run-get-lines.sh \
106              run-get-pubnames.sh run-get-aranges.sh \
107              run-show-abbrev.sh run-strip-test.sh \
108              run-strip-test2.sh run-ecp-test.sh run-ecp-test2.sh \
109              testfile.bz2 testfile2.bz2 testfile3.bz2 testfile4.bz2 \
110              testfile5.bz2 testfile6.bz2 testfile7.bz2 testfile8.bz2 \
111              testfile9.bz2 testfile10.bz2 testfile11.bz2 testfile12.bz2 \
112              testfile13.bz2 run-strip-test3.sh run-allfcts.sh \
113              run-line2addr.sh run-elflint-test.sh testfile14.bz2 \
114              run-strip-test4.sh run-strip-test5.sh run-strip-test6.sh \
115              run-strip-test7.sh run-strip-test8.sh run-strip-groups.sh \
116              run-strip-reloc.sh hello_i386.ko.bz2 hello_x86_64.ko.bz2 \
117              hello_ppc64.ko.bz2 hello_s390.ko.bz2 \
118              run-unstrip-test.sh run-unstrip-test2.sh \
119              run-elflint-self.sh run-ranlib-test.sh run-ranlib-test2.sh \
120              run-ranlib-test3.sh run-ranlib-test4.sh \
121              run-addrscopes.sh run-strings-test.sh run-funcscopes.sh \
122              run-nm-self.sh run-readelf-self.sh \
123              run-find-prologues.sh run-allregs.sh run-native-test.sh \
124              run-addrname-test.sh run-dwfl-bug-offline-rel.sh \
125              run-dwfl-addr-sect.sh run-early-offscn.sh \
126              run-dwarf-getmacros.sh run-test-flag-nobits.sh \
127              run-dwarf-getstring.sh run-rerequest_tag.sh run-alldts.sh \
128              testfile15.bz2 testfile15.debug.bz2 \
129              testfile16.bz2 testfile16.debug.bz2 \
130              testfile17.bz2 testfile17.debug.bz2 \
131              testfile18.bz2 testfile19.bz2 testfile19.index.bz2 \
132              testfile20.bz2 testfile20.index.bz2 \
133              testfile21.bz2 testfile21.index.bz2 \
134              testfile22.bz2 testfile23.bz2 testfile24.bz2 testfile25.bz2 \
135              testfile26.bz2 testfile27.bz2 \
136              coverage.sh test-subr.sh test-wrapper.sh \
137              run-readelf-test1.sh run-readelf-test2.sh run-readelf-test3.sh \
138              run-readelf-test4.sh run-readelf-twofiles.sh \
139              run-bug1-test.sh testfile28.bz2 testfile28.rdwr.bz2 \
140              testfile29.bz2 testfile29.rdwr.bz2 \
141              testfile30.bz2 testfile31.bz2 testfile32.bz2 testfile33.bz2 \
142              testfile34.bz2 testfile35.bz2 testfile35.debug.bz2 \
143              testfile36.bz2 testfile36.debug.bz2 \
144              testfile37.bz2 testfile37.debug.bz2 \
145              testfile38.bz2 testfile39.bz2 testfile40.bz2 testfile40.debug.bz2 \
146              testfile41.bz2 testfile42.bz2 testfile43.bz2 \
147              testfile44.S.bz2 testfile44.expect.bz2 run-disasm-x86.sh \
148              testfile45.S.bz2 testfile45.expect.bz2 run-disasm-x86-64.sh \
149              testfile46.bz2 testfile47.bz2 testfile48.bz2 testfile48.debug.bz2 \
150              testfile49.bz2 testfile50.bz2 testfile51.bz2 \
151              run-readelf-macro.sh testfilemacro.bz2 \
152              run-readelf-dwz-multi.sh libtestfile_multi_shared.so.bz2 \
153              testfile_multi.dwz.bz2 testfile_multi_main.bz2 \
154              run-prelink-addr-test.sh \
155              testfile52-32.so.bz2 testfile52-32.so.debug.bz2 \
156              testfile52-32.prelink.so.bz2 testfile52-32.noshdrs.so.bz2 \
157              testfile52-64.so.bz2 testfile52-64.so.debug.bz2 \
158              testfile52-64.prelink.so.bz2 testfile52-64.noshdrs.so.bz2 \
159              testfile53-32.bz2 testfile53-32.debug.bz2 \
160              testfile53-32.prelink.bz2 testfile53-64.bz2 \
161              testfile53-64.debug.bz2 testfile53-64.prelink.bz2 \
162              testfile54-32.so.bz2 testfile54-32.so.debug.bz2 \
163              testfile54-32.prelink.so.bz2 testfile54-32.noshdrs.so.bz2 \
164              testfile54-64.so.bz2 testfile54-64.so.debug.bz2 \
165              testfile54-64.prelink.so.bz2 testfile54-64.noshdrs.so.bz2 \
166              testfile55-32.bz2 testfile55-32.debug.bz2 \
167              testfile55-32.prelink.bz2 testfile55-64.bz2 \
168              testfile55-64.debug.bz2 testfile55-64.prelink.bz2 \
169              testfile56.bz2 testfile57.bz2 testfile58.bz2 \
170              run-typeiter.sh testfile59.bz2 \
171              run-readelf-d.sh testlib_dynseg.so.bz2 \
172              run-readelf-gdb_index.sh testfilegdbindex5.bz2 \
173              testfilegdbindex7.bz2 \
174              run-unstrip-n.sh testcore-rtlib.bz2 testcore-rtlib-ppc.bz2 \
175              run-low_high_pc.sh testfile_low_high_pc.bz2 \
176              run-macro-test.sh testfile-macinfo.bz2 testfile-macros.bz2 \
177              run-elf_cntl_gelf_getshdr.sh \
178              run-test-archive64.sh testarchive64.a.bz2 \
179              testfile60.bz2
180
181 installed_TESTS_ENVIRONMENT = libdir=$(DESTDIR)$(libdir) \
182                               bindir=$(DESTDIR)$(bindir) \
183                               LC_ALL=C LANG=C \
184                               $(srcdir)/test-wrapper.sh \
185                               installed $(tests_rpath) \
186                               $(program_transform_name)
187 if STANDALONE
188 TESTS_ENVIRONMENT = $(installed_TESTS_ENVIRONMENT)
189 else !STANDALONE
190 TESTS_ENVIRONMENT = LC_ALL=C LANG=C $(srcdir)/test-wrapper.sh \
191                     ../libdw:../backends:../libelf:../libasm
192
193 installcheck-local:
194         $(MAKE) $(AM_MAKEFLAGS) \
195                 TESTS_ENVIRONMENT='$(installed_TESTS_ENVIRONMENT)' check-TESTS
196 endif !STANDALONE
197
198 if MUDFLAP
199 static_build = yes
200 endif
201
202 if STANDALONE
203 libdw = -ldw
204 libelf = -lelf
205 libasm = -lasm
206 libebl = -lebl
207 else !STANDALONE
208 if BUILD_STATIC
209 libdw = ../libdw/libdw.a $(zip_LIBS) $(libelf) $(libebl) -ldl
210 libelf = ../libelf/libelf.a
211 libasm = ../libasm/libasm.a
212 else
213 libdw = ../libdw/libdw.so
214 libelf = ../libelf/libelf.so
215 libasm = ../libasm/libasm.so
216 endif
217 libebl = ../libebl/libebl.a
218 libeu = ../lib/libeu.a
219 endif !STANDALONE
220
221 arextract_LDADD = $(libelf) $(libmudflap)
222 arsymtest_LDADD = $(libelf) $(libmudflap)
223 newfile_LDADD = $(libelf) $(libmudflap)
224 saridx_LDADD = $(libelf) $(libmudflap)
225 scnnames_LDADD = $(libelf) $(libmudflap)
226 sectiondump_LDADD = $(libelf) $(libmudflap)
227 showptable_LDADD = $(libelf) $(libmudflap)
228 hash_LDADD = $(libelf) $(libmudflap)
229 test_nlist_LDADD = $(libelf) $(libmudflap)
230 msg_tst_LDADD = $(libelf) $(libmudflap)
231 newscn_LDADD = $(libelf) $(libmudflap)
232 early_offscn_LDADD = $(libelf) $(libmudflap)
233 ecp_LDADD = $(libelf) $(libmudflap)
234 update1_LDADD = $(libelf) $(libmudflap)
235 update2_LDADD = $(libelf) $(libmudflap)
236 update3_LDADD = $(libebl) $(libelf) $(libmudflap)
237 update4_LDADD = $(libebl) $(libelf) $(libmudflap)
238 show_die_info_LDADD = $(libdw) $(libelf) $(libmudflap)
239 get_pubnames_LDADD = $(libdw) $(libelf) $(libmudflap)
240 show_abbrev_LDADD = $(libdw) $(libelf) $(libmudflap)
241 get_lines_LDADD = $(libdw) $(libelf) $(libmudflap)
242 get_files_LDADD = $(libdw) $(libelf) $(libmudflap)
243 get_aranges_LDADD = $(libdw) $(libelf) $(libmudflap)
244 allfcts_LDADD = $(libdw) $(libelf) $(libmudflap)
245 line2addr_no_Wformat = yes
246 line2addr_LDADD = $(libdw) $(libmudflap)
247 addrscopes_LDADD = $(libdw) $(libmudflap)
248 funcscopes_LDADD = $(libdw) $(libmudflap)
249 funcretval_LDADD = $(libdw) $(libmudflap)
250 allregs_LDADD = $(libdw) $(libmudflap)
251 find_prologues_LDADD = $(libdw) $(libmudflap)
252 #show_ciefde_LDADD = ../libdwarf/libdwarf.so $(libelf) $(libmudflap)
253 asm_tst1_LDADD = $(libasm) $(libebl) $(libelf) $(libmudflap) -ldl
254 asm_tst2_LDADD = $(libasm) $(libebl) $(libelf) $(libmudflap) -ldl
255 asm_tst3_LDADD = $(libasm) $(libebl) $(libelf) $(libmudflap) -ldl
256 asm_tst4_LDADD = $(libasm) $(libebl) $(libelf) $(libmudflap) -ldl
257 asm_tst5_LDADD = $(libasm) $(libebl) $(libelf) $(libmudflap) -ldl
258 asm_tst6_LDADD = $(libasm) $(libebl) $(libelf) $(libmudflap) -ldl
259 asm_tst7_LDADD = $(libasm) $(libebl) $(libelf) $(libmudflap) -ldl
260 asm_tst8_LDADD = $(libasm) $(libebl) $(libelf) $(libmudflap) -ldl
261 asm_tst9_LDADD = $(libasm) $(libebl) $(libelf) $(libmudflap) -ldl
262 dwflmodtest_LDADD = $(libdw) $(libebl) $(libelf) $(libmudflap) -ldl
263 rdwrmmap_LDADD = $(libelf) $(libmudflap)
264 dwfl_bug_addr_overflow_LDADD = $(libdw) $(libebl) $(libelf) $(libmudflap) -ldl
265 arls_LDADD = $(libelf) $(libmudflap)
266 dwfl_bug_fd_leak_LDADD = $(libdw) $(libebl) $(libelf) $(libmudflap) -ldl
267 dwfl_bug_report_LDADD = $(libdw) $(libebl) $(libelf) $(libmudflap) -ldl
268 dwfl_bug_getmodules_LDADD = $(libdw) $(libebl) $(libelf) $(libmudflap) -ldl
269 dwfl_addr_sect_LDADD = $(libdw) $(libebl) $(libelf) $(libmudflap) -ldl
270 dwarf_getmacros_LDADD = $(libdw) $(libmudflap)
271 dwarf_getstring_LDADD = $(libdw) $(libmudflap)
272 addrcfi_LDADD = $(libdw) $(libebl) $(libelf) $(libmudflap) -ldl
273 test_flag_nobits_LDADD = $(libelf) $(libmudflap)
274 rerequest_tag_LDADD = $(libdw) $(libmudflap)
275 alldts_LDADD = $(libebl) $(libelf) $(libmudflap)
276 md5_sha1_test_LDADD = $(libeu)
277 typeiter_LDADD = $(libdw) $(libelf) $(libmudflap)
278 low_high_pc_LDADD = $(libdw) $(libelf) $(libmudflap)
279 test_elf_cntl_gelf_getshdr_LDADD = $(libelf) $(libmudflap)
280
281 if GCOV
282 check: check-am coverage
283 .PHONY: coverage
284 coverage:
285         -$(srcdir)/coverage.sh
286 endif