libabigail/tests
Dodji Seketeli 8f994b5e29 Temporarily disable redundant diff report elimination
So, this is all about problem report
https://sourceware.org/bugzilla/show_bug.cgi?id=17693.

When redundant diff node reporting is enabled and when a diff node
appears twice in a diff tree, we detect that and the second occurrence
of the diff node is flagged as being redundant.  Later at diff tree
node reporting time, the redundant diff node is not reported.

The problem is that diff nodes are canonicalized.  That is, when the
same change is present twice in a diff, the same diff node is going to
be present twice.  So flagging the second occurrence as being
redundant amounts as flagging the first occurrence as being redundant
too!  So at reporting time, the diff tree visitor that walks the diff
tree nodes will avoid reporting the two occurrences of diff tree nodes
altogether.  This is what happens in the example of the bug above.  I
am reproducing the example here for convenience:

So suppose we have a first version of a library named lib-v0.so which
is made of this C code:

    int add(int a, int b)
    {
    }

Then suppose that code was changed in a subsequent version of the
library named lib-v1.so, leading to the following code:

    int add(float a, float b)
    {
    }

So, the diff tree node for the 'add' function is going to have several
child diff tree nodes, among which, one that carries the change for
the first parameter (int a becoming float a) and the one carrying the
change for the second parameter (int b becoming float b).

The diff tree node for the second parameter is going to be same diff
tree node as the one for the first parameter because what counts is
the change in the *type* of the parameter.  Thus, the diff tree node
for the second parameter is going to be marked as being redundant; and
so is the first parameter.

So abidiff lib-v0.so lib-v1.so yields:

    Functions changes summary: 0 Removed, 0 Changed (1 filtered out), 0 Added
    function
    Variables changes summary: 0 Removed, 0 Changed, 0 Added variable

You can see that even the function 'add' is not mentioned in the
report.  This is because it has also been considered as being
redundant because of a phenomenon named 'propagation'.  The
redundant-ness of the children nodes of the diff tree node of the
'add' function is propagated to the diff tree node of the add function
itself because that add function diff tree node has no child but
redundant diff children nodes.  This categorization behaviour is
correct.

What is not correct is that only the second child node of the add
function diff tree node should have been marked redundant.

I am going to tackle this issue a bit later.  For now, I am
temporarily disabling redundancy categorization for diff tree nodes by
default.  Hence this patch.

With this patch, abidiff lib-v0.so lib-v1.so yields:

    Functions changes summary: 0 Removed, 1 Changed, 0 Added function
    Variables changes summary: 0 Removed, 0 Changed, 0 Added variable

    1 function with some indirect sub-type change:

      [C]'function int add(int, int)' has some indirect sub-type changes:
	parameter 0 of type 'int' changed:
	  name changed from 'int' to 'float'
	parameter 1 of type 'int' changed:
	  name changed from 'int' to 'float'

Note how the change on the second parameter appears equal to the
change on the first.

	* src/abg-comparison.cc
	(diff_context::priv::priv): Show redundant changes by default.
	(categorize_redundancy): Do not categorize redundancy if the
	diff_context says that we shouldn't.
	* tools/abicompat.cc (options::show_redundant): New data member.
	(options::options): Initialize to true.
	(display_usage): Add new help string for new --no-redundant and
	--redundant options.
	(parse_command_line): Parse new --no-redundant and --redundant
	command line options.
	(main): Initialize the diff context with respect to the
	options::show_redundant property.
	* tools/abidiff.cc (options::options): Initialize the
	show_redundant_changes data member to true.
	(display_usage): Show new help string for the new --no-redundant
	command line option.
	(parse_command_line): Parse the new --no-redundant command line
	option.
	* tests/data/test-diff-filter/libtest23-redundant-fn-parm-change-v0.so:
	New test data input.
	* tests/data/test-diff-filter/libtest23-redundant-fn-parm-change-v1.so:
	Likewise.
	* tests/data/test-diff-filter/test23-redundant-fn-parm-change-report-0.txt:
	Likewise.
	* tests/data/test-diff-filter/test23-redundant-fn-parm-change-v0.c:
	Source code for the first binary above.
	* tests/data/test-diff-filter/test23-redundant-fn-parm-change-v1.c:
	Source code for the second binary above.
	* tests/data/Makefile.am: Add the new test data input to source
	distribution.
	* tests/test-abicompat.cc (in_out_specs): Add --no-redundant to
	abicompat when we don't want it to show redundant diff reports.
	* test-diff-filter.cc (in_out_specs): Likewise for abidiff.
	* test-diff-suppr.cc (in_out_specs): Likewise.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2014-12-10 19:19:57 +01:00
..
data Temporarily disable redundant diff report elimination 2014-12-10 19:19:57 +01:00
Makefile.am Fix conditional build wrt zip archives and cx11 2014-12-10 14:35:55 +01:00
print-diff-tree.cc Implement generic diff tree walking and port categorization over it 2014-10-10 13:18:04 +02:00
test-abicompat.cc Temporarily disable redundant diff report elimination 2014-12-10 19:19:57 +01:00
test-abidiff.cc Make the use of a C++-11 compiler optional 2014-11-05 10:45:07 +01:00
test-alt-dwarf-file.cc Rename bi* tools to abi* tools 2014-09-26 10:58:16 +02:00
test-core-diff.cc Fix further reaching reverse path calculation in core diff algo 2014-02-10 15:51:09 +01:00
test-diff2.cc Update copyright notice for tests/test-diff2.cc 2014-10-10 13:17:35 +02:00
test-diff-dwarf.cc Fix classification of parameter addition in C 2014-12-09 13:10:58 +01:00
test-diff-filter.cc Temporarily disable redundant diff report elimination 2014-12-10 19:19:57 +01:00
test-diff-suppr.cc Temporarily disable redundant diff report elimination 2014-12-10 19:19:57 +01:00
test-dot.cc Correct DOT merge. 2013-07-23 23:13:55 +02:00
test-ir-walker.cc Rename test-walker.cc into test-ir-walker.cc 2014-03-27 13:01:17 +01:00
test-lookup-syms.cc Rename bi* tools to abi* tools 2014-09-26 10:58:16 +02:00
test-read-dwarf.cc Yet another fix to the DWARF method "static-ness" detection heuristic 2014-10-16 23:49:41 +02:00
test-read-write.cc Fix a crash while writing symbol information 2014-12-07 17:25:26 +01:00
test-svg.cc
test-utils.cc Initial version of an archive manipulation program: biar 2013-08-29 17:08:47 +02:00
test-utils.h Initial version of an archive manipulation program: biar 2013-08-29 17:08:47 +02:00
test-write-read-archive.cc Add a symbol database to the ABI Corpus & support symbol aliases 2014-05-28 16:33:35 +02:00