]> sourceware.org Git - libabigail.git/commit
Support source_location_not_in and source_location_not_regexp suppressions
authorDodji Seketeli <dodji@redhat.com>
Wed, 16 Sep 2015 09:37:22 +0000 (11:37 +0200)
committerDodji Seketeli <dodji@redhat.com>
Wed, 16 Sep 2015 18:54:40 +0000 (20:54 +0200)
commit16299395d738f544640c3f9dca9fd3653d93af0d
treed882c145ebd45f0e9e14d1a4d29f67595d525d62
parent110494af9437234299d3054cd74a09fffa93db8d
Support source_location_not_in and source_location_not_regexp suppressions

This patch adds support for properties source_location_not_in and
source_location_not_regexp in the [suppress_type] section of
suppression specifications.  So the suppression specification:

  [suppress_type]
    source_location_not_in = foo1.h, foo2.h bar1.h bar2.h

suppresses ABI change reports about types that are *NOT* defined in
files foo{1,2}.h and bar{1,2}.h.  The intended use of this construct is to
constrain abi change reports to types that are part of the API of a
given shared library.  The API of the library is supposed to be
defined in foo.h and bar.h only.

Similarly, the suppression specification:

  [suppress_type]
    source_location_not_regexp = (foo|bar){1,2}\\.h

suppresses ABI change reports about types that are not defined in the
same set of files foo1.h, foo2.h, bar1.h and bar2.h.

* include/abg-ini.h (enum property_value::value_kind): Add a
LIST_PROPERTY_VALUE kind.
(class {list_property_value, list_property}): Declare new types.
(is_list_property, is_list_property_value): Declare new functions.
* src/abg-ini.cc (struct list_property_value::priv): Define new
type.
(list_property_value::{list_property_value, get_content,
set_content, as_string}): Define new member functions.
(is_list_property_value): Define new function.
(struct list_property::priv): Define new type.
(list_property::{list_property, get_value, set_value,
handle_escape}): Define new member functions.
(is_list_property): Define new function.
(read_context::buf_): New data member.
(read_context::{peek, get, put_back, good, eof, read_string,
read_list_property_value}): New member functions.
(read_context::read_next_char): Use the new read_context::{get,
good, eof} member function, rather than using the input stream
directly.
(read_context::{skip_white_spaces, skip_comments,
skip_white_spaces_or_comments, read_property_name,
read_function_name, read_function_argument,
read_function_call_expr, read_property_value,
read_tuple_property_value, read_section_name, read_section}):
Adjust to use the new member functions of read_context rather than
using the input stream directly.
(read_context::read_string_property_value): Likewise.  Use the new
read_context::read_string() method.
(read_context::{read, write}_property): Support reading list_property.
* include/abg-comparison.h
(type_suppression::{get_source_locations_to_keep,
set_source_locations_to_keep,
set_source_location_to_keep_regex_str,
get_source_location_to_keep_regex_str}): Add new member functions.
* src/abg-comparison.cc
(type_suppression::priv::{source_location_to_keep_,
source_location_to_keep_regex_str_,
source_location_to_keep_regex_}): Add new data members.
(type_suppression::priv::{g,s}et_source_location_to_keep_regex):
Define new member functions.
(type_suppression::{g,s}et_source_locations_to_keep): Define new
member functions.
(type_suppression::{g,s}et_source_location_to_keep_regex_str):
Likewise.
(type_suppression::suppresses_type): Support
"source_location_not_regexp" and "source_location_not_in"
properties of suppression specifications.
(read_type_suppression): Likewise. Also adjust to the fact that
ta tuple property value that is a list of strings is not a list
property value.
* doc/manuals/libabigail-concepts.rst: Add documentation for
source_location_not_in and source_location_not_regexp.
* tests/data/test-diff-suppr/libtest26-loc-suppr-v{0,1}.so: New
binary test inputs.
* tests/data/test-diff-suppr/test26-loc-suppr-{0,1,2}.suppr: New
suppression specification test inputs.
* tests/data/test-diff-suppr/test26-loc-suppr-report-{0,1,2,3}.txt:
New test reference reports.
* tests/data/test-diff-suppr/test26-loc-suppr-v{0,1}.cc: Source
code of the test binary input above.
* tests/data/test-diff-suppr/test26-loc-suppr.h: Likewise.
* tests/data/Makefile.am: Add the new test material to source
distribution.
* tests/test-diff-suppr.cc (in_out_specs): Add the new test inputs above.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
19 files changed:
doc/manuals/libabigail-concepts.rst
include/abg-comparison.h
include/abg-ini.h
src/abg-comparison.cc
src/abg-ini.cc
tests/data/Makefile.am
tests/data/test-diff-suppr/libtest26-loc-suppr-v0.so [new file with mode: 0755]
tests/data/test-diff-suppr/libtest26-loc-suppr-v1.so [new file with mode: 0755]
tests/data/test-diff-suppr/test26-loc-suppr-0.suppr [new file with mode: 0644]
tests/data/test-diff-suppr/test26-loc-suppr-1.suppr [new file with mode: 0644]
tests/data/test-diff-suppr/test26-loc-suppr-2.suppr [new file with mode: 0644]
tests/data/test-diff-suppr/test26-loc-suppr-report-0.txt [new file with mode: 0644]
tests/data/test-diff-suppr/test26-loc-suppr-report-1.txt [new file with mode: 0644]
tests/data/test-diff-suppr/test26-loc-suppr-report-2.txt [new file with mode: 0644]
tests/data/test-diff-suppr/test26-loc-suppr-report-3.txt [new file with mode: 0644]
tests/data/test-diff-suppr/test26-loc-suppr-v0.cc [new file with mode: 0644]
tests/data/test-diff-suppr/test26-loc-suppr-v1.cc [new file with mode: 0644]
tests/data/test-diff-suppr/test26-loc-suppr.h [new file with mode: 0644]
tests/test-diff-suppr.cc
This page took 0.064644 seconds and 5 git commands to generate.