libabigail/tests
Dodji Seketeli ef9d20c97c Fix redundancy detection through fn ptr and typedef paths
When analyzing the libfreetype.so binary, it appears that
libabigail's diff node redundancy marking pass is failing to detect a
redundant diff node in cases were the node is recursively referencing
itself through a path that involves function type and typedef diff
nodes.

So it is only at reporting time that we'd detect that the node is
redundant so we emit messages like "this change was reported
earlier".  But When the earlier change in question is suppressed due
to, e.g, a suppression specification resulting from the user providing
abidiff with the --headers-dir{1,2} command line option, then the
change report becomes confusing, at best.

The right behaviour is to detect the node is redundant and mark it as
such, so that the reporting pass can avoid reporting it altogether.

This is what this patch does.

This patch changes the output of the runtestdiffpkg regression test.
To update the reference output, we need an additional patch to handle
a separate (but somewhat related) issue.  That is going to be done in
the subsequent commit which title is:

	    "Filter out changes like type to const type"

	* include/abg-comparison.h
	(is_function_type_diff_with_local_changes)
	(is_reference_or_pointer_diff_to_non_basic_distinct_types)
	(peel_typedef_diff): Declare new functions.
	* src/abg-comparison.cc
	(is_function_type_diff_with_local_changes)
	(is_reference_or_ptr_diff_to_non_basic_nor_distinct_types)
	(peel_typedef_diff): Define new functions.
	(is_reference_or_pointer_diff): Peel typedefs before operating.
	(redundancy_marking_visitor::visit_begin): Only sibbling parameter
	diff node that carry basic type changes (or distinct type changes)
	are *not* marked as redundant.  All other kinds of sibbling
	parameter diff nodes are markes redundant.  Also, rather than
	never marking function type diffs as redundant by fear of missing
	local changes on these, just avoid marking function type diff
	nodes with local changes.  It's possible to be that precise now
	that we can detect that a diff node carries local changes.
	* tests/data/test-diff-suppr/test37-opaque-type-v{0,1}.o: New
	binary tests input.
	* tests/data/test-diff-suppr/test37-opaque-type-v{0,1}.c: Source
	code of the binary tests input above.
	* tests/data/test-diff-suppr/test37-opaque-type-header-dir/test37-opaque-type-header-v{0,1}.h:
	Headers of the binary tests input above.
	* tests/data/test-diff-suppr/test37-opaque-type-report-0.txt:
	Reference output for this new test.
	* tests/data/Makefile.am: Add the new test material above to
	source distribution.
	* tests/test-diff-suppr.cc (in_out_specs): Add the new test input
	above to the test harness.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2018-06-28 13:03:51 +02:00
..
data Fix redundancy detection through fn ptr and typedef paths 2018-06-28 13:03:51 +02:00
Makefile.am Do not enable fedabipkgdiff tests if fedabipkgdiff itself is disabled 2018-03-30 10:38:23 +02:00
mockfedabipkgdiff.in Bug 22722 - Make fedabipkgdiff and its tests support both python 3 and 2 2018-03-29 13:46:50 +02:00
print-diff-tree.cc Update copyright notice for all source files 2018-01-08 18:24:26 +01:00
runtestcanonicalizetypes.sh.in
runtestdefaultsupprs.py.in Fix typo in tests/runtestdefaultsupprs.py 2018-05-24 10:48:56 +02:00
runtestdefaultsupprspy3.sh.in Bug 22722 - Make fedabipkgdiff and its tests support both python 3 and 2 2018-03-29 13:46:50 +02:00
runtestfedabipkgdiff.py.in Bug 22722 - Make fedabipkgdiff and its tests support both python 3 and 2 2018-03-29 13:46:50 +02:00
runtestfedabipkgdiffpy3.sh.in Bug 22722 - Make fedabipkgdiff and its tests support both python 3 and 2 2018-03-29 13:46:50 +02:00
test-abicompat.cc Update copyright notice for all source files 2018-01-08 18:24:26 +01:00
test-abidiff-exit.cc Update copyright notice for all source files 2018-01-08 18:24:26 +01:00
test-abidiff.cc Update copyright notice for all source files 2018-01-08 18:24:26 +01:00
test-alt-dwarf-file.cc Update copyright notice for all source files 2018-01-08 18:24:26 +01:00
test-annotate.cc Wire the --no-show-locs option to abidw 2017-11-02 12:57:11 +01:00
test-core-diff.cc Update copyright notice for all source files 2018-01-08 18:24:26 +01:00
test-diff2.cc Update copyright notice for all source files 2018-01-08 18:24:26 +01:00
test-diff-dwarf-abixml.cc Update copyright notice for all source files 2018-01-08 18:24:26 +01:00
test-diff-dwarf.cc Explicitely detect anonymous data member changes 2018-06-06 14:07:10 +02:00
test-diff-filter.cc Better detect when diff nodes only carry local type changes 2018-05-24 16:04:44 +02:00
test-diff-pkg.cc Identify a function using its symbol name and version 2018-06-08 05:12:24 +02:00
test-diff-suppr.cc Fix redundancy detection through fn ptr and typedef paths 2018-06-28 13:03:51 +02:00
test-dot.cc
test-ir-walker.cc Update copyright notice for all source files 2018-01-08 18:24:26 +01:00
test-lookup-syms.cc Update copyright notice for all source files 2018-01-08 18:24:26 +01:00
test-read-dwarf.cc Update copyright notice for all source files 2018-01-08 18:24:26 +01:00
test-read-write.cc Update copyright notice for all source files 2018-01-08 18:24:26 +01:00
test-svg.cc
test-types-stability.cc Update copyright notice for all source files 2018-01-08 18:24:26 +01:00
test-utils.cc Update copyright notice for all source files 2018-01-08 18:24:26 +01:00
test-utils.h Update copyright notice for all source files 2018-01-08 18:24:26 +01:00
test-valgrind-suppressions.supp Shut down a helgrind false positive in the "system" libc call 2017-03-17 09:02:19 +01:00
test-write-read-archive.cc Update copyright notice for all source files 2018-01-08 18:24:26 +01:00
update-test-output.py