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