• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1## SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
2SUBDIRS = data
3
4AM_CXXFLAGS = $(VISIBILITY_FLAGS)
5
6FEDABIPKGDIFF_TEST =
7if ENABLE_FEDABIPKGDIFF
8if ENABLE_RUNNING_TESTS_WITH_PY3
9FEDABIPKGDIFF_TEST += runtestfedabipkgdiffpy3.sh
10else
11FEDABIPKGDIFF_TEST += runtestfedabipkgdiff.py
12endif
13endif
14
15RUN_TEST_SLOW_SELF_COMPARE=runtestslowselfcompare.sh
16
17# rather expensive tests (keep in this order), > 1s runtime
18TESTS=				\
19$(RUN_TEST_SLOW_SELF_COMPARE)   \
20runtestdiffsuppr		\
21runtesttypesstability		\
22runtestdiffpkg			\
23runtestannotate			\
24runtestdifffilter		\
25runtestreaddwarf	        \
26runtestcanonicalizetypes.sh
27
28# rather cheap tests
29TESTS+=				\
30runtestabicompat		\
31runtestabidiff			\
32runtestabidiffexit		\
33runtestaltdwarf			\
34runtestcorediff			\
35runtestcxxcompat		\
36runtestdiffdwarf		\
37runtestdiffdwarfabixml		\
38runtestelfhelpers		\
39runtestini			\
40runtestkmiwhitelist		\
41runtestlookupsyms		\
42runtestreadwrite		\
43runtestsymtab			\
44runtestsymtabreader		\
45runtesttoolsutils		\
46runtestsvg			\
47$(FEDABIPKGDIFF_TEST)
48
49
50if ENABLE_RUNNING_TESTS_WITH_PY3
51TESTS += runtestdefaultsupprspy3.sh
52else
53TESTS += runtestdefaultsupprs.py
54endif
55
56EXTRA_DIST = \
57runtestcanonicalizetypes.sh.in \
58runtestfedabipkgdiff.py.in \
59runtestslowselfcompare.sh.in \
60mockfedabipkgdiff.in \
61test-valgrind-suppressions.supp
62
63if ENABLE_RUNNING_TESTS_WITH_PY3
64EXTRA_DIST += \
65runtestfedabipkgdiffpy3.sh.in 	\
66runtestdefaultsupprspy3.sh.in
67endif
68
69CLEANFILES = \
70runtestcanonicalizetypes.output.txt \
71runtestcanonicalizetypes.output.final.txt
72
73noinst_PROGRAMS= $(TESTS) testirwalker testdiff2 printdifftree
74noinst_SCRIPTS = mockfedabipkgdiff
75noinst_LTLIBRARIES = libtestutils.la libcatch.la
76
77libtestutils_la_SOURCES=	\
78test-utils.h 			\
79test-utils.cc
80
81libtestutils_la_CXXFLAGS=		\
82-DABIGAIL_SRC_DIR=\"${abs_top_srcdir}\"  	\
83-DABIGAIL_BUILD_DIR=\"${abs_top_builddir}\"
84
85libcatch_la_SOURCES = lib/catch.cc lib/catch.hpp
86
87runtestreadwrite_SOURCES=test-read-write.cc
88runtestreadwrite_LDADD=libtestutils.la $(top_builddir)/src/libabigail.la
89
90runtestreaddwarf_SOURCES=test-read-dwarf.cc
91runtestreaddwarf_LDADD=libtestutils.la $(top_builddir)/src/libabigail.la
92runtestreaddwarf_LDFLAGS=-pthread
93
94runtestannotate_SOURCES=test-annotate.cc
95runtestannotate_LDADD=libtestutils.la $(top_builddir)/src/libabigail.la
96
97runtestlookupsyms_SOURCES=test-lookup-syms.cc
98runtestlookupsyms_LDADD=libtestutils.la $(top_builddir)/src/libabigail.la
99
100runtestaltdwarf_SOURCES=test-alt-dwarf-file.cc
101runtestaltdwarf_LDADD=libtestutils.la $(top_builddir)/src/libabigail.la
102
103runtestcorediff_SOURCES=test-core-diff.cc
104runtestcorediff_LDADD=libtestutils.la $(top_builddir)/src/libabigail.la
105
106runtestabidiff_SOURCES = test-abidiff.cc
107runtestabidiff_LDADD = libtestutils.la $(top_builddir)/src/libabigail.la
108
109runtestabidiffexit_SOURCES = test-abidiff-exit.cc
110runtestabidiffexit_LDADD = libtestutils.la $(top_builddir)/src/libabigail.la
111
112runtestdiffdwarf_SOURCES = test-diff-dwarf.cc
113runtestdiffdwarf_LDADD = libtestutils.la $(top_builddir)/src/libabigail.la
114
115runtestdifffilter_SOURCES = test-diff-filter.cc
116runtestdifffilter_LDADD = libtestutils.la $(top_builddir)/src/libabigail.la
117
118runtestdiffsuppr_SOURCES = test-diff-suppr.cc
119runtestdiffsuppr_LDADD = libtestutils.la $(top_builddir)/src/libabigail.la
120
121runtestdiffdwarfabixml_SOURCES = test-diff-dwarf-abixml.cc
122runtestdiffdwarfabixml_LDADD = libtestutils.la $(top_builddir)/src/libabigail.la
123
124runtestabicompat_SOURCES = test-abicompat.cc
125runtestabicompat_LDADD = libtestutils.la $(top_builddir)/src/libabigail.la
126
127runtestdiffpkg_SOURCES = test-diff-pkg.cc
128runtestdiffpkg_LDADD = libtestutils.la $(top_builddir)/src/libabigail.la
129
130runtesttypesstability_SOURCES = test-types-stability.cc
131runtesttypesstability_LDADD = libtestutils.la $(top_builddir)/src/libabigail.la
132
133runtestini_SOURCES = test-ini.cc
134runtestini_LDADD = libtestutils.la $(top_builddir)/src/libabigail.la
135
136runtesttoolsutils_SOURCES = test-tools-utils.cc
137runtesttoolsutils_LDADD = libtestutils.la $(top_builddir)/src/libabigail.la
138
139runtestkmiwhitelist_SOURCES = test-kmi-whitelist.cc
140runtestkmiwhitelist_LDADD = libtestutils.la libcatch.la $(top_builddir)/src/libabigail.la
141
142runtestelfhelpers_SOURCES = test-elf-helpers.cc
143runtestelfhelpers_LDADD = libcatch.la $(top_builddir)/src/libabigail.la
144
145runtestcxxcompat_SOURCES = test-cxx-compat.cc
146runtestcxxcompat_LDADD = libcatch.la $(top_builddir)/src/libabigail.la
147
148runtestsymtab_SOURCES = test-symtab.cc
149runtestsymtab_LDADD = libtestutils.la libcatch.la $(top_builddir)/src/libabigail.la
150
151runtestsymtabreader_SOURCES = test-symtab-reader.cc
152runtestsymtabreader_LDADD = libcatch.la $(top_builddir)/src/libabigail.la
153
154runtestsvg_SOURCES=test-svg.cc
155runtestsvg_LDADD=$(top_builddir)/src/libabigail.la
156
157runtestdot_SOURCES = test-dot.cc
158runtestdot_LDADD = $(top_builddir)/src/libabigail.la
159
160testirwalker_SOURCES=test-ir-walker.cc
161testirwalker_LDADD=$(top_builddir)/src/libabigail.la
162
163testdiff2_SOURCES=test-diff2.cc
164testdiff2_LDADD=$(top_builddir)/src/libabigail.la
165
166printdifftree_SOURCES = print-diff-tree.cc
167printdifftree_LDADD = $(top_builddir)/src/libabigail.la
168
169runtestslowselfcompare_sh_SOURCES =
170runtestslowselfcompare.sh$(EXEEXT):
171
172runtestcanonicalizetypes_sh_SOURCES =
173runtestcanonicalizetypes.sh$(EXEEXT):
174
175runtestfedabipkgdiff_py_SOURCES =
176runtestfedabipkgdiff.py$(EXEEXT):
177
178runtestdefaultsupprs_py_SOURCES =
179runtestdefaultsupprs.py$(EXEEXT):
180
181runtestfedabipkgdiffpy3_sh_SOURCES =
182runtestfedabipkgdiffpy3.sh$(EXEEXT):
183
184runtestdefaultsupprspy3_sh_SOURCES =
185runtestdefaultsupprspy3.sh$(EXEEXT):
186
187AM_CPPFLAGS=-I${abs_top_srcdir}/include -I${abs_top_srcdir}/src \
188-I${abs_top_builddir}/include -I${abs_top_srcdir}/tools -fPIC
189
190clean-local: clean-local-check
191.PHONY: clean-local-check
192
193clean-local-check:
194	-rm -rf ${builddir}/output *.svg *.gv
195
196@VALGRIND_CHECK_RULES@
197VALGRIND_SUPPRESSIONS_FILES = ${srcdir}/test-valgrind-suppressions.supp
198
199# These are flags passed to Valgrind so that it follows children
200# processes of the test programs.  This is because many test programs
201# actually fork libabigail command line tools, and we want to valgrind
202# those libabigail command line tools as well.
203#
204# The problem though is that there are many other command line
205# programs that are forked too.  For instance, /bin/sh is forked
206# because tests are using the system() function to execute commands.
207# So we must tell Valgrind to avoid following a bunch of command line
208# programs that we don't care about and that take a lot of time to
209# valgrind.
210RECURSIVE_VALGRIND_FLAGS = \
211--num-callers=30 \
212--trace-children=yes \
213--trace-children-skip=/bin/diff,/bin/rm,/bin/mkdir,/bin/cd,*cpio,/bin/dpkg,/bin/rpm,/bin/test,/bin/tar,/bin/sed,/bin/ls,/bin/g++,/*collect*,/bin/ld
214
215# Use the target below to run tests under Valgrind's memcheck tool by
216# telling it to follow children process, so that it can also check
217# libabigail tools that are forked by the tests.  This usually takes a
218# while.  So, to launch just one test in this configuration, if you
219# are in the top-most source directory you can do:
220#
221#  make -C <build-directory>/tests check-valgrind-memcheck-recursive TESTS=runtestdiffsuppr
222
223check-valgrind-memcheck-recursive:
224	$(MAKE) check-valgrind-memcheck VALGRIND_FLAGS="${RECURSIVE_VALGRIND_FLAGS}"
225
226check-valgrind-helgrind-recursive:
227	$(MAKE) check-valgrind-helgrind VALGRIND_FLAGS="${RECURSIVE_VALGRIND_FLAGS}"
228
229check-self-compare:
230	$(MAKE) check TESTS=runtestslowselfcompare.sh ENABLE_SLOW_TEST=yes
231
232