1e01aa904Sopenharmony_ci## SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
2e01aa904Sopenharmony_ciSUBDIRS = data
3e01aa904Sopenharmony_ci
4e01aa904Sopenharmony_ciAM_CXXFLAGS = $(VISIBILITY_FLAGS)
5e01aa904Sopenharmony_ci
6e01aa904Sopenharmony_ciFEDABIPKGDIFF_TEST =
7e01aa904Sopenharmony_ciif ENABLE_FEDABIPKGDIFF
8e01aa904Sopenharmony_ciif ENABLE_RUNNING_TESTS_WITH_PY3
9e01aa904Sopenharmony_ciFEDABIPKGDIFF_TEST += runtestfedabipkgdiffpy3.sh
10e01aa904Sopenharmony_cielse
11e01aa904Sopenharmony_ciFEDABIPKGDIFF_TEST += runtestfedabipkgdiff.py
12e01aa904Sopenharmony_ciendif
13e01aa904Sopenharmony_ciendif
14e01aa904Sopenharmony_ci
15e01aa904Sopenharmony_ciRUN_TEST_SLOW_SELF_COMPARE=runtestslowselfcompare.sh
16e01aa904Sopenharmony_ci
17e01aa904Sopenharmony_ci# rather expensive tests (keep in this order), > 1s runtime
18e01aa904Sopenharmony_ciTESTS=				\
19e01aa904Sopenharmony_ci$(RUN_TEST_SLOW_SELF_COMPARE)   \
20e01aa904Sopenharmony_ciruntestaltdwarf			\
21e01aa904Sopenharmony_ciruntestdiffsuppr		\
22e01aa904Sopenharmony_ciruntesttypesstability		\
23e01aa904Sopenharmony_ciruntestdiffpkg			\
24e01aa904Sopenharmony_ciruntestannotate			\
25e01aa904Sopenharmony_ciruntestdifffilter		\
26e01aa904Sopenharmony_ciruntestreaddwarf	        \
27e01aa904Sopenharmony_ciruntestcanonicalizetypes.sh
28e01aa904Sopenharmony_ci
29e01aa904Sopenharmony_ciif CTF_READER
30e01aa904Sopenharmony_ciTESTS += runtestreadctf
31e01aa904Sopenharmony_ciendif
32e01aa904Sopenharmony_ci
33e01aa904Sopenharmony_ci# rather cheap tests
34e01aa904Sopenharmony_ciTESTS+=				\
35e01aa904Sopenharmony_ciruntestabicompat		\
36e01aa904Sopenharmony_ciruntestabidiff			\
37e01aa904Sopenharmony_ciruntestabidiffexit		\
38e01aa904Sopenharmony_ciruntestcorediff			\
39e01aa904Sopenharmony_ciruntestcxxcompat		\
40e01aa904Sopenharmony_ciruntestdiffdwarf		\
41e01aa904Sopenharmony_ciruntestdiffdwarfabixml		\
42e01aa904Sopenharmony_ciruntestelfhelpers		\
43e01aa904Sopenharmony_ciruntestini			\
44e01aa904Sopenharmony_ciruntestkmiwhitelist		\
45e01aa904Sopenharmony_ciruntestlookupsyms		\
46e01aa904Sopenharmony_ciruntestreadwrite		\
47e01aa904Sopenharmony_ciruntestsymtab			\
48e01aa904Sopenharmony_ciruntestsymtabreader		\
49e01aa904Sopenharmony_ciruntesttoolsutils		\
50e01aa904Sopenharmony_ciruntestsvg			\
51e01aa904Sopenharmony_ci$(FEDABIPKGDIFF_TEST)
52e01aa904Sopenharmony_ci
53e01aa904Sopenharmony_ci
54e01aa904Sopenharmony_ciif ENABLE_RUNNING_TESTS_WITH_PY3
55e01aa904Sopenharmony_ciTESTS += runtestdefaultsupprspy3.sh
56e01aa904Sopenharmony_cielse
57e01aa904Sopenharmony_ciTESTS += runtestdefaultsupprs.py
58e01aa904Sopenharmony_ciendif
59e01aa904Sopenharmony_ci
60e01aa904Sopenharmony_ciEXTRA_DIST = \
61e01aa904Sopenharmony_ciruntestcanonicalizetypes.sh.in \
62e01aa904Sopenharmony_ciruntestfedabipkgdiff.py.in \
63e01aa904Sopenharmony_ciruntestslowselfcompare.sh.in \
64e01aa904Sopenharmony_cimockfedabipkgdiff.in \
65e01aa904Sopenharmony_citest-valgrind-suppressions.supp
66e01aa904Sopenharmony_ci
67e01aa904Sopenharmony_ciif ENABLE_RUNNING_TESTS_WITH_PY3
68e01aa904Sopenharmony_ciEXTRA_DIST += \
69e01aa904Sopenharmony_ciruntestfedabipkgdiffpy3.sh.in 	\
70e01aa904Sopenharmony_ciruntestdefaultsupprspy3.sh.in
71e01aa904Sopenharmony_ciendif
72e01aa904Sopenharmony_ci
73e01aa904Sopenharmony_ciCLEANFILES = \
74e01aa904Sopenharmony_ciruntestcanonicalizetypes.output.txt \
75e01aa904Sopenharmony_ciruntestcanonicalizetypes.output.final.txt
76e01aa904Sopenharmony_ci
77e01aa904Sopenharmony_cinoinst_PROGRAMS= $(TESTS) testirwalker testdiff2 printdifftree
78e01aa904Sopenharmony_cinoinst_SCRIPTS = mockfedabipkgdiff
79e01aa904Sopenharmony_cinoinst_LTLIBRARIES = libtestutils.la libtestreadcommon.la libcatch.la
80e01aa904Sopenharmony_ci
81e01aa904Sopenharmony_cilibtestutils_la_SOURCES=	\
82e01aa904Sopenharmony_citest-utils.h 			\
83e01aa904Sopenharmony_citest-utils.cc
84e01aa904Sopenharmony_ci
85e01aa904Sopenharmony_cilibtestutils_la_CXXFLAGS=		\
86e01aa904Sopenharmony_ci-DABIGAIL_SRC_DIR=\"${abs_top_srcdir}\"  	\
87e01aa904Sopenharmony_ci-DABIGAIL_BUILD_DIR=\"${abs_top_builddir}\"
88e01aa904Sopenharmony_ci
89e01aa904Sopenharmony_cilibtestreadcommon_la_SOURCES=	\
90e01aa904Sopenharmony_citest-read-common.h 		\
91e01aa904Sopenharmony_citest-read-common.cc
92e01aa904Sopenharmony_ci
93e01aa904Sopenharmony_cilibtestreadcommon_la_CXXFLAGS=			\
94e01aa904Sopenharmony_ci-DABIGAIL_SRC_DIR=\"${abs_top_srcdir}\"  	\
95e01aa904Sopenharmony_ci-DABIGAIL_BUILD_DIR=\"${abs_top_builddir}\"
96e01aa904Sopenharmony_ci
97e01aa904Sopenharmony_cilibcatch_la_SOURCES = lib/catch.cc lib/catch.hpp
98e01aa904Sopenharmony_ci
99e01aa904Sopenharmony_ciruntestreadwrite_SOURCES=test-read-write.cc
100e01aa904Sopenharmony_ciruntestreadwrite_LDADD=libtestutils.la $(top_builddir)/src/libabigail.la
101e01aa904Sopenharmony_ci
102e01aa904Sopenharmony_ciruntestreaddwarf_SOURCES=test-read-dwarf.cc
103e01aa904Sopenharmony_ciruntestreaddwarf_LDADD=libtestreadcommon.la libtestutils.la	\
104e01aa904Sopenharmony_ci		       $(top_builddir)/src/libabigail.la
105e01aa904Sopenharmony_ciruntestreaddwarf_LDFLAGS=-pthread
106e01aa904Sopenharmony_ci
107e01aa904Sopenharmony_ciif CTF_READER
108e01aa904Sopenharmony_ciruntestreadctf_SOURCES=test-read-ctf.cc
109e01aa904Sopenharmony_ciruntestreadctf_LDADD=libtestreadcommon.la libtestutils.la	\
110e01aa904Sopenharmony_ci		     $(top_builddir)/src/libabigail.la
111e01aa904Sopenharmony_ciruntestreadctf_LDFLAGS=-pthread
112e01aa904Sopenharmony_ciendif
113e01aa904Sopenharmony_ci
114e01aa904Sopenharmony_ciruntestannotate_SOURCES=test-annotate.cc
115e01aa904Sopenharmony_ciruntestannotate_LDADD=libtestutils.la $(top_builddir)/src/libabigail.la
116e01aa904Sopenharmony_ci
117e01aa904Sopenharmony_ciruntestlookupsyms_SOURCES=test-lookup-syms.cc
118e01aa904Sopenharmony_ciruntestlookupsyms_LDADD=libtestutils.la $(top_builddir)/src/libabigail.la
119e01aa904Sopenharmony_ci
120e01aa904Sopenharmony_ciruntestaltdwarf_SOURCES=test-alt-dwarf-file.cc
121e01aa904Sopenharmony_ciruntestaltdwarf_LDADD=libtestutils.la $(top_builddir)/src/libabigail.la
122e01aa904Sopenharmony_ci
123e01aa904Sopenharmony_ciruntestcorediff_SOURCES=test-core-diff.cc
124e01aa904Sopenharmony_ciruntestcorediff_LDADD=libtestutils.la $(top_builddir)/src/libabigail.la
125e01aa904Sopenharmony_ci
126e01aa904Sopenharmony_ciruntestabidiff_SOURCES = test-abidiff.cc
127e01aa904Sopenharmony_ciruntestabidiff_LDADD = libtestutils.la $(top_builddir)/src/libabigail.la
128e01aa904Sopenharmony_ci
129e01aa904Sopenharmony_ciruntestabidiffexit_SOURCES = test-abidiff-exit.cc
130e01aa904Sopenharmony_ciruntestabidiffexit_LDADD = libtestutils.la $(top_builddir)/src/libabigail.la
131e01aa904Sopenharmony_ci
132e01aa904Sopenharmony_ciruntestdiffdwarf_SOURCES = test-diff-dwarf.cc
133e01aa904Sopenharmony_ciruntestdiffdwarf_LDADD = libtestutils.la $(top_builddir)/src/libabigail.la
134e01aa904Sopenharmony_ci
135e01aa904Sopenharmony_ciruntestdifffilter_SOURCES = test-diff-filter.cc
136e01aa904Sopenharmony_ciruntestdifffilter_LDADD = libtestutils.la $(top_builddir)/src/libabigail.la
137e01aa904Sopenharmony_ci
138e01aa904Sopenharmony_ciruntestdiffsuppr_SOURCES = test-diff-suppr.cc
139e01aa904Sopenharmony_ciruntestdiffsuppr_LDADD = libtestutils.la $(top_builddir)/src/libabigail.la
140e01aa904Sopenharmony_ci
141e01aa904Sopenharmony_ciruntestdiffdwarfabixml_SOURCES = test-diff-dwarf-abixml.cc
142e01aa904Sopenharmony_ciruntestdiffdwarfabixml_LDADD = libtestutils.la $(top_builddir)/src/libabigail.la
143e01aa904Sopenharmony_ci
144e01aa904Sopenharmony_ciruntestabicompat_SOURCES = test-abicompat.cc
145e01aa904Sopenharmony_ciruntestabicompat_LDADD = libtestutils.la $(top_builddir)/src/libabigail.la
146e01aa904Sopenharmony_ci
147e01aa904Sopenharmony_ciruntestdiffpkg_SOURCES = test-diff-pkg.cc
148e01aa904Sopenharmony_ciruntestdiffpkg_LDADD = libtestutils.la $(top_builddir)/src/libabigail.la
149e01aa904Sopenharmony_ci
150e01aa904Sopenharmony_ciruntesttypesstability_SOURCES = test-types-stability.cc
151e01aa904Sopenharmony_ciruntesttypesstability_LDADD = libtestutils.la $(top_builddir)/src/libabigail.la
152e01aa904Sopenharmony_ci
153e01aa904Sopenharmony_ciruntestini_SOURCES = test-ini.cc
154e01aa904Sopenharmony_ciruntestini_LDADD = libtestutils.la $(top_builddir)/src/libabigail.la
155e01aa904Sopenharmony_ci
156e01aa904Sopenharmony_ciruntesttoolsutils_SOURCES = test-tools-utils.cc
157e01aa904Sopenharmony_ciruntesttoolsutils_LDADD = libtestutils.la $(top_builddir)/src/libabigail.la
158e01aa904Sopenharmony_ci
159e01aa904Sopenharmony_ciruntestkmiwhitelist_SOURCES = test-kmi-whitelist.cc
160e01aa904Sopenharmony_ciruntestkmiwhitelist_LDADD = libtestutils.la libcatch.la $(top_builddir)/src/libabigail.la
161e01aa904Sopenharmony_ci
162e01aa904Sopenharmony_ciruntestelfhelpers_SOURCES = test-elf-helpers.cc
163e01aa904Sopenharmony_ciruntestelfhelpers_LDADD = libcatch.la $(top_builddir)/src/libabigail.la
164e01aa904Sopenharmony_ci
165e01aa904Sopenharmony_ciruntestcxxcompat_SOURCES = test-cxx-compat.cc
166e01aa904Sopenharmony_ciruntestcxxcompat_LDADD = libcatch.la $(top_builddir)/src/libabigail.la
167e01aa904Sopenharmony_ci
168e01aa904Sopenharmony_ciruntestsymtab_SOURCES = test-symtab.cc
169e01aa904Sopenharmony_ciruntestsymtab_LDADD = libtestutils.la libcatch.la $(top_builddir)/src/libabigail.la
170e01aa904Sopenharmony_ci
171e01aa904Sopenharmony_ciruntestsymtabreader_SOURCES = test-symtab-reader.cc
172e01aa904Sopenharmony_ciruntestsymtabreader_LDADD = libcatch.la $(top_builddir)/src/libabigail.la
173e01aa904Sopenharmony_ci
174e01aa904Sopenharmony_ciruntestsvg_SOURCES=test-svg.cc
175e01aa904Sopenharmony_ciruntestsvg_LDADD=$(top_builddir)/src/libabigail.la
176e01aa904Sopenharmony_ci
177e01aa904Sopenharmony_citestirwalker_SOURCES=test-ir-walker.cc
178e01aa904Sopenharmony_citestirwalker_LDADD=$(top_builddir)/src/libabigail.la
179e01aa904Sopenharmony_ci
180e01aa904Sopenharmony_citestdiff2_SOURCES=test-diff2.cc
181e01aa904Sopenharmony_citestdiff2_LDADD=$(top_builddir)/src/libabigail.la
182e01aa904Sopenharmony_ci
183e01aa904Sopenharmony_ciprintdifftree_SOURCES = print-diff-tree.cc
184e01aa904Sopenharmony_ciprintdifftree_LDADD = $(top_builddir)/src/libabigail.la
185e01aa904Sopenharmony_ci
186e01aa904Sopenharmony_ciruntestslowselfcompare_sh_SOURCES =
187e01aa904Sopenharmony_ciruntestslowselfcompare.sh$(EXEEXT):
188e01aa904Sopenharmony_ci
189e01aa904Sopenharmony_ciruntestcanonicalizetypes_sh_SOURCES =
190e01aa904Sopenharmony_ciruntestcanonicalizetypes.sh$(EXEEXT):
191e01aa904Sopenharmony_ci
192e01aa904Sopenharmony_ciruntestfedabipkgdiff_py_SOURCES =
193e01aa904Sopenharmony_ciruntestfedabipkgdiff.py$(EXEEXT):
194e01aa904Sopenharmony_ci
195e01aa904Sopenharmony_ciruntestdefaultsupprs_py_SOURCES =
196e01aa904Sopenharmony_ciruntestdefaultsupprs.py$(EXEEXT):
197e01aa904Sopenharmony_ci
198e01aa904Sopenharmony_ciruntestfedabipkgdiffpy3_sh_SOURCES =
199e01aa904Sopenharmony_ciruntestfedabipkgdiffpy3.sh$(EXEEXT):
200e01aa904Sopenharmony_ci
201e01aa904Sopenharmony_ciruntestdefaultsupprspy3_sh_SOURCES =
202e01aa904Sopenharmony_ciruntestdefaultsupprspy3.sh$(EXEEXT):
203e01aa904Sopenharmony_ci
204e01aa904Sopenharmony_ciAM_CPPFLAGS=-I${abs_top_srcdir}/include -I${abs_top_srcdir}/src \
205e01aa904Sopenharmony_ci-I${abs_top_builddir}/include -I${abs_top_srcdir}/tools -fPIC
206e01aa904Sopenharmony_ci
207e01aa904Sopenharmony_ciclean-local: clean-local-check
208e01aa904Sopenharmony_ci.PHONY: clean-local-check
209e01aa904Sopenharmony_ci
210e01aa904Sopenharmony_ciclean-local-check:
211e01aa904Sopenharmony_ci	-rm -rf ${builddir}/output *.svg *.gv
212e01aa904Sopenharmony_ci
213e01aa904Sopenharmony_ci@VALGRIND_CHECK_RULES@
214e01aa904Sopenharmony_ciVALGRIND_SUPPRESSIONS_FILES = ${srcdir}/test-valgrind-suppressions.supp
215e01aa904Sopenharmony_ci
216e01aa904Sopenharmony_ci# These are flags passed to Valgrind so that it follows children
217e01aa904Sopenharmony_ci# processes of the test programs.  This is because many test programs
218e01aa904Sopenharmony_ci# actually fork libabigail command line tools, and we want to valgrind
219e01aa904Sopenharmony_ci# those libabigail command line tools as well.
220e01aa904Sopenharmony_ci#
221e01aa904Sopenharmony_ci# The problem though is that there are many other command line
222e01aa904Sopenharmony_ci# programs that are forked too.  For instance, /bin/sh is forked
223e01aa904Sopenharmony_ci# because tests are using the system() function to execute commands.
224e01aa904Sopenharmony_ci# So we must tell Valgrind to avoid following a bunch of command line
225e01aa904Sopenharmony_ci# programs that we don't care about and that take a lot of time to
226e01aa904Sopenharmony_ci# valgrind.
227e01aa904Sopenharmony_ciRECURSIVE_VALGRIND_FLAGS = \
228e01aa904Sopenharmony_ci--num-callers=30 \
229e01aa904Sopenharmony_ci--trace-children=yes \
230e01aa904Sopenharmony_ci--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
231e01aa904Sopenharmony_ci
232e01aa904Sopenharmony_ci# Use the target below to run tests under Valgrind's memcheck tool by
233e01aa904Sopenharmony_ci# telling it to follow children process, so that it can also check
234e01aa904Sopenharmony_ci# libabigail tools that are forked by the tests.  This usually takes a
235e01aa904Sopenharmony_ci# while.  So, to launch just one test in this configuration, if you
236e01aa904Sopenharmony_ci# are in the top-most source directory you can do:
237e01aa904Sopenharmony_ci#
238e01aa904Sopenharmony_ci#  make -C <build-directory>/tests check-valgrind-memcheck-recursive TESTS=runtestdiffsuppr
239e01aa904Sopenharmony_ci
240e01aa904Sopenharmony_cicheck-valgrind-memcheck-recursive:
241e01aa904Sopenharmony_ci	$(MAKE) check-valgrind-memcheck VALGRIND_FLAGS="${RECURSIVE_VALGRIND_FLAGS}"
242e01aa904Sopenharmony_ci
243e01aa904Sopenharmony_cicheck-valgrind-helgrind-recursive:
244e01aa904Sopenharmony_ci	$(MAKE) check-valgrind-helgrind VALGRIND_FLAGS="${RECURSIVE_VALGRIND_FLAGS}"
245e01aa904Sopenharmony_ci
246e01aa904Sopenharmony_cicheck-self-compare:
247e01aa904Sopenharmony_ci	$(MAKE) check TESTS=runtestslowselfcompare.sh ENABLE_SLOW_TEST=yes
248e01aa904Sopenharmony_ci
249