I forgot to add these files as part of my previous commit
* test2-filtered-removed-fns-v{0,1}.o: Add these test input files.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
Libabigail considers a removed function (or global variable) as being
an incompatible change, whether it has been suppressed or not.
Likewise, even if all function sub-type changes have been suppressed,
changed virtual offset on functions are still considered incompatible.
Thus, abidiff still returns an exit code that reflects an incompatible
change even if the removed symbol change was suppressed.
The rule should rather be that if incompatible changes have been
suppressed, abidiff (and the other tools) should take that into
account and not return an exit code that reflects incompatible
changes.
This patch implements that rule, at least for the incompatible changes
that are detected so far.
* src/abg-comparison.cc (corpus_diff::has_incompatible_changes):
Consider the *net* number of removed function and variable
symbols. Also, if all function sub-type changes have been
suppressed, then no virtual offset change should be considered
incompatible.
* tests/data/test-abidiff-exit/test1-voffset-change-report1.txt
* tests/data/test-abidiff-exit/test1-voffset-change.abignore
* tests/data/test-abidiff-exit/test2-filtered-removed-fns-report0.txt
* tests/data/test-abidiff-exit/test2-filtered-removed-fns-report1.txt
* tests/data/test-abidiff-exit/test2-filtered-removed-fns-v0.c
* tests/data/test-abidiff-exit/test2-filtered-removed-fns-v1.c
* tests/data/test-abidiff-exit/test2-filtered-removed-fns.abignore
* tests/data/Makefile.am: Add the new test material above to
source distribution.
* tests/test-abidiff-exit.cc (InOutSpec::in_suppr_path): New data
member.
(in_out_specs): Adjust. Add new test inputs.
(main): Adjust.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
The comparison engine doesn't take virtual offset changes into account
when deciding if a diff node carries an incompatible change. This is
obviously an oversight.
Fixed thus.
* include/abg-comparison.h (enum diff_category): Adjust the
comment for enumerator VIRTUAL_MEMBER_CHANGE_CATEGORY; changes of
this category are incompatible ABI changes.
(corpus_diff::diff_stats::num_func_with_virtual_offset_changes):
Declare new accessors.
* src/abg-comparison.cc
(corpus_diff::diff_stats::priv::num_func_with_virt_offset_changes):
New data member.
(corpus_diff::diff_stats::priv::priv): Initialize the new data
member.
(corpus_diff::diff_stats::num_func_with_virtual_offset_changes):
Define new accessors.
(corpus_diff::priv::apply_filters_and_compute_diff_stats): Use the
new accessor to set the number of functions with virtual offset
changes onto the stats data structure.
(corpus_diff::has_incompatible_changes): Take functions with
virtual offset changes into account.
* tests/test-abidiff-exit.cc: New test harness to test for exit
codes of abidiff.
* tests/Makefile.am: Build the new test harness runtestabidiff
from the test-abidiff-exit.cc source file.
* tests/data/test-abidiff-exit/test1-voffset-change-report0.txt:
New reference test output.
* tests/data/test-abidiff-exit/test1-voffset-change-v0.cc: New
test input source code.
* tests/data/test-abidiff-exit/test1-voffset-change-v0.o: New test input.
* tests/data/test-abidiff-exit/test1-voffset-change-v1.cc: New
test input source code.
* tests/data/test-abidiff-exit/test1-voffset-change-v1.o: New test input.
* tests/data/Makefile.am: tests/data/Makefile.am: Add the new test
inputs above to the source distribution.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>