Bug 24139 - Support suppressing some enumerator changes
authorDodji Seketeli <dodji@redhat.com>
Wed, 30 Jan 2019 12:46:29 +0000 (13:46 +0100)
committerDodji Seketeli <dodji@redhat.com>
Thu, 31 Jan 2019 08:20:06 +0000 (09:20 +0100)
commit3826ab5308915990e36f194c120c88fd9bbcc46a
tree7cb9df1fb11a70ec0fb9f0f1bfdc806af791a585
parent52369923ac4dde5d057677e7aebf5c66a93e33e2
Bug 24139 - Support suppressing some enumerator changes

This patch teaches the suppression specification subsystem how to
ignore changes of some enumerators in particular.

The patch adds a new property to the [suppress_type] section which is:

    changed_enumerators = enumerator1, enumerator2, etc

This property is taken into accound iff the current suppress_type does
have the 'type_kind = enum' property.

Changes to enum types that match the new 'changed_enumerators'
property are suppressed.

* doc/manuals/libabigail-concepts.rst: Document the new
'changed_enumerators' property.
* include/abg-suppression.h
(type_suppression::{g, s}et_changed_enumerator_names): Declare two
new member functions.
* src/abg-suppression-priv.h
(type_suppression::priv::changed_enumerator_names_): Add a new
data member.
* src/abg-suppression.cc
(type_suppression::{g,s}et_changed_enumerator_names): Define two
new member functions.
(type_suppression::suppresses_diff): Support evaluating the new
'changed_enumerators = <vector of changed enumerators>'.
(read_type_suppression): Read the new list
property'changed_enumerators" and store it into the
type_suppression using the new
type_suppression::set_changed_enumerator_names ().
* tests/data/test-diff-suppr/libtest4{0,1}-enumerator-changes-v{0,1}.so:
Add new test inpujts.
* tests/data/test-diff-suppr/test4{0,1}-enumerator-changes-0.suppr:
Add a new suppr spec for this new test.
* tests/data/test-diff-suppr/test4{0,1}-enumerator-changes-report-0.txt:
The default report.
* tests/data/test-diff-suppr/test4{0,1}-enumerator-changes-v{0,1}.cc:
Add Source code of libtest4{0,1}-enumerator-changes-v{0,1}.so.
* tests/data/Makefile.am: Add the test files above to source
distribution.
* tests/test-diff-suppr.cc: Add the test input files above to the
harness.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
18 files changed:
doc/manuals/libabigail-concepts.rst
include/abg-suppression.h
src/abg-suppression-priv.h
src/abg-suppression.cc
tests/data/Makefile.am
tests/data/test-diff-suppr/libtest40-enumerator-changes-v0.so [new file with mode: 0755]
tests/data/test-diff-suppr/libtest40-enumerator-changes-v1.so [new file with mode: 0755]
tests/data/test-diff-suppr/libtest41-enumerator-changes-v0.so [new file with mode: 0755]
tests/data/test-diff-suppr/libtest41-enumerator-changes-v1.so [new file with mode: 0755]
tests/data/test-diff-suppr/test40-enumerator-changes-0.suppr [new file with mode: 0644]
tests/data/test-diff-suppr/test40-enumerator-changes-report-0.txt [new file with mode: 0644]
tests/data/test-diff-suppr/test40-enumerator-changes-v0.cc [new file with mode: 0644]
tests/data/test-diff-suppr/test40-enumerator-changes-v1.cc [new file with mode: 0644]
tests/data/test-diff-suppr/test41-enumerator-changes-0.suppr [new file with mode: 0644]
tests/data/test-diff-suppr/test41-enumerator-changes-report-0.txt [new file with mode: 0644]
tests/data/test-diff-suppr/test41-enumerator-changes-v0.cc [new file with mode: 0644]
tests/data/test-diff-suppr/test41-enumerator-changes-v1.cc [new file with mode: 0644]
tests/test-diff-suppr.cc