From patchwork Mon Apr 20 16:41:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Giuliano Procida X-Patchwork-Id: 39103 From: gprocida@google.com (Giuliano Procida) Date: Mon, 20 Apr 2020 17:41:50 +0100 Subject: [PATCH 1/3] test-diff-suppr: Improve regexes in tests. Message-ID: <20200420164153.5213-1-gprocida@google.com> The are some (mostly inconsequential) issues with regexes: - Leading and trailing .* are redundant and can be removed. However, "match anything" should still be written as .* as the parser will treat an empty regex as if it were absent. - There are various cases where there's a trailing .* but no initial ^. These would be good for whole string matches, not the substring matches libabigail does. - File name matches are full path so should start with (^|/) if trying to match a base name, assuming a Unix-like filesystem. Given these are just tests, it's not that important, but they still serve as examples. - In cases where the ^ anchor was used, full paths would usually fail to match. In such cases, the regex was being ignored for other reasons (see later patch) or is expected not to match anyway. - In many cases, the $ anchor could be considered to be missing. - The .ini parser unescapes string values, so escaping regex metacharacters requires a double backslash. Single backslashes are pointless. - The dot metacharacter is used unescaped in a few places where a literal was likely intended, so should be escaped. - The characters [ and ] don't need to be (.ini) escaped. This patch resolves these issues, for a subset of files. * tests/data/test-diff-suppr/libtest31.suppr: Fix regexes. * tests/data/test-diff-suppr/libtest32-0.suppr: Ditto. * tests/data/test-diff-suppr/libtest48-soname-abixml-suppr-2.txt: Ditto. * tests/data/test-diff-suppr/libtest48-soname-abixml-suppr-3.txt: Ditto. * tests/data/test-diff-suppr/libtest48-soname-abixml-suppr-4.txt: Ditto. * tests/data/test-diff-suppr/libtest48-soname-abixml-suppr.txt: Ditto. * tests/data/test-diff-suppr/test0-type-suppr-0.suppr: Ditto. * tests/data/test-diff-suppr/test0-type-suppr-3.suppr: Ditto. * tests/data/test-diff-suppr/test0-type-suppr-4.suppr: Ditto. * tests/data/test-diff-suppr/test0-type-suppr-5.suppr: Ditto. * tests/data/test-diff-suppr/test0-type-suppr-6.suppr: Ditto. * tests/data/test-diff-suppr/test17-suppr-added-var-0.suppr: Ditto. * tests/data/test-diff-suppr/test17-suppr-added-var-1.suppr: Ditto. * tests/data/test-diff-suppr/test17-suppr-added-var-2.suppr: Ditto. * tests/data/test-diff-suppr/test17-suppr-added-var-3.suppr: Ditto. * tests/data/test-diff-suppr/test20-suppr-removed-fn-sym-0.suppr: Ditto. * tests/data/test-diff-suppr/test20-suppr-removed-fn-sym-3.suppr: Ditto. * tests/data/test-diff-suppr/test20-suppr-removed-fn-sym-4.suppr: Ditto. * tests/data/test-diff-suppr/test23-alias-filter-1.suppr: Ditto. * tests/data/test-diff-suppr/test23-alias-filter-2.suppr: Ditto. * tests/data/test-diff-suppr/test24-soname-suppr-10.txt: Ditto. * tests/data/test-diff-suppr/test24-soname-suppr-11.txt: Ditto. * tests/data/test-diff-suppr/test24-soname-suppr-12.txt: Ditto. * tests/data/test-diff-suppr/test24-soname-suppr-6.txt: Ditto. * tests/data/test-diff-suppr/test24-soname-suppr-8.txt: Ditto. * tests/data/test-diff-suppr/test4-local-suppr-0.suppr: Ditto. Signed-off-by: Giuliano Procida Reviewed-by: Matthias Maennich --- tests/data/test-diff-suppr/libtest31.suppr | 2 +- tests/data/test-diff-suppr/libtest32-0.suppr | 2 +- .../test-diff-suppr/libtest48-soname-abixml-suppr-2.txt | 2 +- .../test-diff-suppr/libtest48-soname-abixml-suppr-3.txt | 2 +- .../test-diff-suppr/libtest48-soname-abixml-suppr-4.txt | 2 +- .../data/test-diff-suppr/libtest48-soname-abixml-suppr.txt | 2 +- tests/data/test-diff-suppr/test0-type-suppr-0.suppr | 2 +- tests/data/test-diff-suppr/test0-type-suppr-3.suppr | 4 +--- tests/data/test-diff-suppr/test0-type-suppr-4.suppr | 5 ++--- tests/data/test-diff-suppr/test0-type-suppr-5.suppr | 7 +++---- tests/data/test-diff-suppr/test0-type-suppr-6.suppr | 6 ++---- tests/data/test-diff-suppr/test17-suppr-added-var-0.suppr | 2 +- tests/data/test-diff-suppr/test17-suppr-added-var-1.suppr | 2 +- tests/data/test-diff-suppr/test17-suppr-added-var-2.suppr | 2 +- tests/data/test-diff-suppr/test17-suppr-added-var-3.suppr | 2 +- .../test-diff-suppr/test20-suppr-removed-fn-sym-0.suppr | 2 +- .../test-diff-suppr/test20-suppr-removed-fn-sym-3.suppr | 4 ++-- .../test-diff-suppr/test20-suppr-removed-fn-sym-4.suppr | 2 +- tests/data/test-diff-suppr/test23-alias-filter-1.suppr | 2 +- tests/data/test-diff-suppr/test23-alias-filter-2.suppr | 2 +- tests/data/test-diff-suppr/test24-soname-suppr-10.txt | 2 +- tests/data/test-diff-suppr/test24-soname-suppr-11.txt | 2 +- tests/data/test-diff-suppr/test24-soname-suppr-12.txt | 2 +- tests/data/test-diff-suppr/test24-soname-suppr-2.txt | 2 +- tests/data/test-diff-suppr/test24-soname-suppr-3.txt | 2 +- tests/data/test-diff-suppr/test24-soname-suppr-4.txt | 2 +- tests/data/test-diff-suppr/test24-soname-suppr-6.txt | 2 +- tests/data/test-diff-suppr/test24-soname-suppr-8.txt | 2 +- tests/data/test-diff-suppr/test24-soname-suppr-9.txt | 2 +- tests/data/test-diff-suppr/test26-loc-suppr-1.suppr | 2 +- tests/data/test-diff-suppr/test26-loc-suppr-2.suppr | 2 +- tests/data/test-diff-suppr/test29-suppr-1.txt | 2 +- tests/data/test-diff-suppr/test29-suppr-5.txt | 2 +- tests/data/test-diff-suppr/test29-suppr-6.txt | 2 +- tests/data/test-diff-suppr/test29-suppr-7.txt | 2 +- tests/data/test-diff-suppr/test29-suppr-8.txt | 2 +- tests/data/test-diff-suppr/test33-suppr-1.txt | 2 +- .../data/test-diff-suppr/test38-char-class-in-ini.abignore | 2 +- tests/data/test-diff-suppr/test4-local-suppr-0.suppr | 2 +- tests/data/test-diff-suppr/test6-fn-suppr-1.suppr | 2 +- tests/data/test-diff-suppr/test7-var-suppr-9.suppr | 4 ++-- 41 files changed, 47 insertions(+), 53 deletions(-) diff --git a/tests/data/test-diff-suppr/libtest31.suppr b/tests/data/test-diff-suppr/libtest31.suppr index 57929eca..3fe933a6 100644 --- a/tests/data/test-diff-suppr/libtest31.suppr +++ b/tests/data/test-diff-suppr/libtest31.suppr @@ -1,3 +1,3 @@ [suppress_function] drop = yes - name_regexp = hidden::.* + name_regexp = ^hidden:: diff --git a/tests/data/test-diff-suppr/libtest32-0.suppr b/tests/data/test-diff-suppr/libtest32-0.suppr index b79bb965..04179b48 100644 --- a/tests/data/test-diff-suppr/libtest32-0.suppr +++ b/tests/data/test-diff-suppr/libtest32-0.suppr @@ -1,3 +1,3 @@ [suppress_function] - name_not_regexp = ^pub::.* + name_not_regexp = ^pub:: drop_artifact = true diff --git a/tests/data/test-diff-suppr/libtest48-soname-abixml-suppr-2.txt b/tests/data/test-diff-suppr/libtest48-soname-abixml-suppr-2.txt index c9b7ad46..7d99a709 100644 --- a/tests/data/test-diff-suppr/libtest48-soname-abixml-suppr-2.txt +++ b/tests/data/test-diff-suppr/libtest48-soname-abixml-suppr-2.txt @@ -1,2 +1,2 @@ [suppress_file] - soname_regexp = test48-soname-abixml-v.* + soname_regexp = test48-soname-abixml-v diff --git a/tests/data/test-diff-suppr/libtest48-soname-abixml-suppr-3.txt b/tests/data/test-diff-suppr/libtest48-soname-abixml-suppr-3.txt index c69c2504..64470ca4 100644 --- a/tests/data/test-diff-suppr/libtest48-soname-abixml-suppr-3.txt +++ b/tests/data/test-diff-suppr/libtest48-soname-abixml-suppr-3.txt @@ -1,2 +1,2 @@ [suppress_file] - file_name_regexp = ^libtest48-soname-abixml-v.*$ + file_name_regexp = (^|/)libtest48-soname-abixml-v diff --git a/tests/data/test-diff-suppr/libtest48-soname-abixml-suppr-4.txt b/tests/data/test-diff-suppr/libtest48-soname-abixml-suppr-4.txt index 1a205275..dd4235f9 100644 --- a/tests/data/test-diff-suppr/libtest48-soname-abixml-suppr-4.txt +++ b/tests/data/test-diff-suppr/libtest48-soname-abixml-suppr-4.txt @@ -1,2 +1,2 @@ [suppress_file] - file_name_regexp = ^libtest48-soname-abixml-v.*$ + file_name_regexp = (^|/)libtest48-soname-abixml-v diff --git a/tests/data/test-diff-suppr/libtest48-soname-abixml-suppr.txt b/tests/data/test-diff-suppr/libtest48-soname-abixml-suppr.txt index 08d61c0f..bc44c4fd 100644 --- a/tests/data/test-diff-suppr/libtest48-soname-abixml-suppr.txt +++ b/tests/data/test-diff-suppr/libtest48-soname-abixml-suppr.txt @@ -1,2 +1,2 @@ [suppress_file] - soname_regexp = test48-soname-abixml-v.* + soname_regexp = test48-soname-abixml-v diff --git a/tests/data/test-diff-suppr/test0-type-suppr-0.suppr b/tests/data/test-diff-suppr/test0-type-suppr-0.suppr index be876c77..151005e1 100644 --- a/tests/data/test-diff-suppr/test0-type-suppr-0.suppr +++ b/tests/data/test-diff-suppr/test0-type-suppr-0.suppr @@ -1,2 +1,2 @@ [suppress_type] - name_regexp = .*Private$ + name_regexp = Private$ diff --git a/tests/data/test-diff-suppr/test0-type-suppr-3.suppr b/tests/data/test-diff-suppr/test0-type-suppr-3.suppr index b84fcc41..eb63bc53 100644 --- a/tests/data/test-diff-suppr/test0-type-suppr-3.suppr +++ b/tests/data/test-diff-suppr/test0-type-suppr-3.suppr @@ -1,5 +1,3 @@ [suppress_file] - # # Do not load files test0-type-suppr-v0.o or test0-type-suppr-v1.o - # - file_name_regexp = (test0-type-suppr-v0.o|test0-type-suppr-v1.o) + file_name_regexp = (^|/)(test0-type-suppr-v0\\.o|test0-type-suppr-v1\\.o)$ diff --git a/tests/data/test-diff-suppr/test0-type-suppr-4.suppr b/tests/data/test-diff-suppr/test0-type-suppr-4.suppr index 32552acb..5d122b4e 100644 --- a/tests/data/test-diff-suppr/test0-type-suppr-4.suppr +++ b/tests/data/test-diff-suppr/test0-type-suppr-4.suppr @@ -1,5 +1,4 @@ [suppress_file] - # Do not load files foo.o. This is practically going to allow the + # Do not load files *foo.o*. This is practically going to allow the # loading of files test0-type-suppr-v0.o and test0-type-suppr-v1.o. - file_name_regexp = foo.* - + file_name_regexp = foo\\.o diff --git a/tests/data/test-diff-suppr/test0-type-suppr-5.suppr b/tests/data/test-diff-suppr/test0-type-suppr-5.suppr index 1fa3b1ce..0a06e8d0 100644 --- a/tests/data/test-diff-suppr/test0-type-suppr-5.suppr +++ b/tests/data/test-diff-suppr/test0-type-suppr-5.suppr @@ -1,6 +1,5 @@ [suppress_file] - # Avoid loading files which name does *NOT* match the regexp name - # foo.* This is practically going to forbid the loading of files + # Avoid loading files which name does *NOT* match *foo.o*. + # This is practically going to forbid the loading of files # test0-type-suppr-v0.o and test0-type-suppr-v1.o - file_name_not_regexp = foo.* - + file_name_not_regexp = foo\\.o diff --git a/tests/data/test-diff-suppr/test0-type-suppr-6.suppr b/tests/data/test-diff-suppr/test0-type-suppr-6.suppr index ee297fff..c0c5d078 100644 --- a/tests/data/test-diff-suppr/test0-type-suppr-6.suppr +++ b/tests/data/test-diff-suppr/test0-type-suppr-6.suppr @@ -1,5 +1,3 @@ [suppress_file] - # Avoid loading files which name does *NOT* match the regexp name - # foo.* This is practically going to forbid the loading of files - # test0-type-suppr-v0.o and test0-type-suppr-v1.o - file_name_not_regexp = (test0-type-suppr-v0.o|test0-type-suppr-v1.o) + # Only load files test0-type-suppr-v0.o or test0-type-suppr-v1.o + file_name_not_regexp = (^|/)(test0-type-suppr-v0\\.o|test0-type-suppr-v1\\.o)$ diff --git a/tests/data/test-diff-suppr/test17-suppr-added-var-0.suppr b/tests/data/test-diff-suppr/test17-suppr-added-var-0.suppr index 0ecaea27..9f24f89f 100644 --- a/tests/data/test-diff-suppr/test17-suppr-added-var-0.suppr +++ b/tests/data/test-diff-suppr/test17-suppr-added-var-0.suppr @@ -1,2 +1,2 @@ [suppress_variable] - name_regexp = .*var.$ + name_regexp = var.$ diff --git a/tests/data/test-diff-suppr/test17-suppr-added-var-1.suppr b/tests/data/test-diff-suppr/test17-suppr-added-var-1.suppr index d0321556..0024c66b 100644 --- a/tests/data/test-diff-suppr/test17-suppr-added-var-1.suppr +++ b/tests/data/test-diff-suppr/test17-suppr-added-var-1.suppr @@ -1,3 +1,3 @@ [suppress_variable] - name_regexp = .*var.$ + name_regexp = var.$ change_kind = added-variable diff --git a/tests/data/test-diff-suppr/test17-suppr-added-var-2.suppr b/tests/data/test-diff-suppr/test17-suppr-added-var-2.suppr index 42f55bbc..fabf4e25 100644 --- a/tests/data/test-diff-suppr/test17-suppr-added-var-2.suppr +++ b/tests/data/test-diff-suppr/test17-suppr-added-var-2.suppr @@ -1,3 +1,3 @@ [suppress_variable] - name_regexp = .*var.$ + name_regexp = var.$ change_kind = variable-subtype-change diff --git a/tests/data/test-diff-suppr/test17-suppr-added-var-3.suppr b/tests/data/test-diff-suppr/test17-suppr-added-var-3.suppr index 7ad5cacb..3f2a565c 100644 --- a/tests/data/test-diff-suppr/test17-suppr-added-var-3.suppr +++ b/tests/data/test-diff-suppr/test17-suppr-added-var-3.suppr @@ -1,3 +1,3 @@ [suppress_variable] - name_regexp = .*var.$ + name_regexp = var.$ change_kind = all diff --git a/tests/data/test-diff-suppr/test20-suppr-removed-fn-sym-0.suppr b/tests/data/test-diff-suppr/test20-suppr-removed-fn-sym-0.suppr index 61f4a6a7..f86ea294 100644 --- a/tests/data/test-diff-suppr/test20-suppr-removed-fn-sym-0.suppr +++ b/tests/data/test-diff-suppr/test20-suppr-removed-fn-sym-0.suppr @@ -1,3 +1,3 @@ [suppress_function] - symbol_name_regexp = _Z3.* + symbol_name_regexp = ^_Z3 change_kind = deleted-function diff --git a/tests/data/test-diff-suppr/test20-suppr-removed-fn-sym-3.suppr b/tests/data/test-diff-suppr/test20-suppr-removed-fn-sym-3.suppr index a32db428..0c2e2c21 100644 --- a/tests/data/test-diff-suppr/test20-suppr-removed-fn-sym-3.suppr +++ b/tests/data/test-diff-suppr/test20-suppr-removed-fn-sym-3.suppr @@ -1,3 +1,3 @@ [suppress_function] - symbol_name_regexp = _Z.* - change_kind = all \ No newline at end of file + symbol_name_regexp = ^_Z + change_kind = all diff --git a/tests/data/test-diff-suppr/test20-suppr-removed-fn-sym-4.suppr b/tests/data/test-diff-suppr/test20-suppr-removed-fn-sym-4.suppr index 21387c5c..a0562842 100644 --- a/tests/data/test-diff-suppr/test20-suppr-removed-fn-sym-4.suppr +++ b/tests/data/test-diff-suppr/test20-suppr-removed-fn-sym-4.suppr @@ -1,2 +1,2 @@ [suppress_function] - symbol_name_regexp = _Z.* + symbol_name_regexp = ^_Z diff --git a/tests/data/test-diff-suppr/test23-alias-filter-1.suppr b/tests/data/test-diff-suppr/test23-alias-filter-1.suppr index c0ffa797..3c0788c5 100644 --- a/tests/data/test-diff-suppr/test23-alias-filter-1.suppr +++ b/tests/data/test-diff-suppr/test23-alias-filter-1.suppr @@ -1,3 +1,3 @@ [suppress_function] - name_regexp = ^__private_.* + name_regexp = ^__private_ allow_other_aliases = yes diff --git a/tests/data/test-diff-suppr/test23-alias-filter-2.suppr b/tests/data/test-diff-suppr/test23-alias-filter-2.suppr index e8660292..c7d4220e 100644 --- a/tests/data/test-diff-suppr/test23-alias-filter-2.suppr +++ b/tests/data/test-diff-suppr/test23-alias-filter-2.suppr @@ -1,3 +1,3 @@ [suppress_function] - name_regexp = ^__private_.* + name_regexp = ^__private_ allow_other_aliases = no diff --git a/tests/data/test-diff-suppr/test24-soname-suppr-10.txt b/tests/data/test-diff-suppr/test24-soname-suppr-10.txt index 004952fe..75103163 100644 --- a/tests/data/test-diff-suppr/test24-soname-suppr-10.txt +++ b/tests/data/test-diff-suppr/test24-soname-suppr-10.txt @@ -1,3 +1,3 @@ [suppress_type] - file_name_not_regexp = libtest24-soname.*\\.so + file_name_not_regexp = (^|/)libtest24-soname.*\\.so diff --git a/tests/data/test-diff-suppr/test24-soname-suppr-11.txt b/tests/data/test-diff-suppr/test24-soname-suppr-11.txt index 0f5db1d1..d1baf90c 100644 --- a/tests/data/test-diff-suppr/test24-soname-suppr-11.txt +++ b/tests/data/test-diff-suppr/test24-soname-suppr-11.txt @@ -1,3 +1,3 @@ [suppress_function] - file_name_not_regexp = libtest24-soname-wrong-name.*\\.so + file_name_not_regexp = (^|/)libtest24-soname-wrong-name.*\\.so diff --git a/tests/data/test-diff-suppr/test24-soname-suppr-12.txt b/tests/data/test-diff-suppr/test24-soname-suppr-12.txt index 59a14335..3e6c4e97 100644 --- a/tests/data/test-diff-suppr/test24-soname-suppr-12.txt +++ b/tests/data/test-diff-suppr/test24-soname-suppr-12.txt @@ -1,2 +1,2 @@ [suppress_function] - file_name_not_regexp = libtest24-soname.*\\.so + file_name_not_regexp = (^|/)libtest24-soname.*\\.so diff --git a/tests/data/test-diff-suppr/test24-soname-suppr-2.txt b/tests/data/test-diff-suppr/test24-soname-suppr-2.txt index 439321d8..65b50fbb 100644 --- a/tests/data/test-diff-suppr/test24-soname-suppr-2.txt +++ b/tests/data/test-diff-suppr/test24-soname-suppr-2.txt @@ -1,4 +1,4 @@ [suppress_type] - file_name_regexp = .*/libtest24-soname-v0.so$ + file_name_regexp = (^|/)libtest24-soname-v0\\.so$ name = S reached_through = reference_or_pointer diff --git a/tests/data/test-diff-suppr/test24-soname-suppr-3.txt b/tests/data/test-diff-suppr/test24-soname-suppr-3.txt index 1e23370e..f72fd141 100644 --- a/tests/data/test-diff-suppr/test24-soname-suppr-3.txt +++ b/tests/data/test-diff-suppr/test24-soname-suppr-3.txt @@ -1,4 +1,4 @@ [suppress_type] - file_name_regexp = .*/libtest24-soname-v1.so$ + file_name_regexp = (^|/)libtest24-soname-v1\\.so$ name = S reached_through = reference_or_pointer diff --git a/tests/data/test-diff-suppr/test24-soname-suppr-4.txt b/tests/data/test-diff-suppr/test24-soname-suppr-4.txt index 1893ae6e..29a0b6ec 100644 --- a/tests/data/test-diff-suppr/test24-soname-suppr-4.txt +++ b/tests/data/test-diff-suppr/test24-soname-suppr-4.txt @@ -1,4 +1,4 @@ [suppress_type] - file_name_regexp = ^libtest24-soname-.so$ + file_name_regexp = (^|/)libtest24-soname-\\.so$ name = S reached_through = reference_or_pointer diff --git a/tests/data/test-diff-suppr/test24-soname-suppr-6.txt b/tests/data/test-diff-suppr/test24-soname-suppr-6.txt index aae7f346..d10956ea 100644 --- a/tests/data/test-diff-suppr/test24-soname-suppr-6.txt +++ b/tests/data/test-diff-suppr/test24-soname-suppr-6.txt @@ -1,2 +1,2 @@ [suppress_function] - file_name_regexp = libtest24-soname.*\\.so + file_name_regexp = (^|/)libtest24-soname.*\\.so diff --git a/tests/data/test-diff-suppr/test24-soname-suppr-8.txt b/tests/data/test-diff-suppr/test24-soname-suppr-8.txt index 15292cd4..53028b91 100644 --- a/tests/data/test-diff-suppr/test24-soname-suppr-8.txt +++ b/tests/data/test-diff-suppr/test24-soname-suppr-8.txt @@ -1,2 +1,2 @@ [suppress_type] - file_name_regexp = libtest24-soname.*\\.so + file_name_regexp = (^|/)libtest24-soname.*\\.so diff --git a/tests/data/test-diff-suppr/test24-soname-suppr-9.txt b/tests/data/test-diff-suppr/test24-soname-suppr-9.txt index c5dc2562..23d15d4d 100644 --- a/tests/data/test-diff-suppr/test24-soname-suppr-9.txt +++ b/tests/data/test-diff-suppr/test24-soname-suppr-9.txt @@ -1,3 +1,3 @@ [suppress_type] - file_name_not_regexp = libtest24-soname-wrong-name.*\\.so + file_name_not_regexp = (^|/)libtest24-soname-wrong-name.*\\.so$ diff --git a/tests/data/test-diff-suppr/test26-loc-suppr-1.suppr b/tests/data/test-diff-suppr/test26-loc-suppr-1.suppr index b0c0675f..734bbe1d 100644 --- a/tests/data/test-diff-suppr/test26-loc-suppr-1.suppr +++ b/tests/data/test-diff-suppr/test26-loc-suppr-1.suppr @@ -1,2 +1,2 @@ [suppress_type] - source_location_not_regexp = test26-loc.*\\.h + source_location_not_regexp = (^|/)test26-loc.*\\.h$ diff --git a/tests/data/test-diff-suppr/test26-loc-suppr-2.suppr b/tests/data/test-diff-suppr/test26-loc-suppr-2.suppr index 282702c6..576d87c6 100644 --- a/tests/data/test-diff-suppr/test26-loc-suppr-2.suppr +++ b/tests/data/test-diff-suppr/test26-loc-suppr-2.suppr @@ -1,2 +1,2 @@ [suppress_type] - source_location_not_regexp = test26-loc.*\\.cc + source_location_not_regexp = (^|/)test26-loc.*\\.cc$ diff --git a/tests/data/test-diff-suppr/test29-suppr-1.txt b/tests/data/test-diff-suppr/test29-suppr-1.txt index 14012181..19a270f5 100644 --- a/tests/data/test-diff-suppr/test29-suppr-1.txt +++ b/tests/data/test-diff-suppr/test29-suppr-1.txt @@ -1,2 +1,2 @@ [suppress_variable] - file_name_regexp = libtest29-soname.*\\.so + file_name_regexp = (^|/)libtest29-soname.*\\.so$ diff --git a/tests/data/test-diff-suppr/test29-suppr-5.txt b/tests/data/test-diff-suppr/test29-suppr-5.txt index c195ede5..2d6efeb6 100644 --- a/tests/data/test-diff-suppr/test29-suppr-5.txt +++ b/tests/data/test-diff-suppr/test29-suppr-5.txt @@ -1,3 +1,3 @@ [suppress_variable] - file_name_not_regexp = ^libtest29-soname-wrong.*\\.so$ + file_name_not_regexp = (^|/)libtest29-soname-wrong.*\\.so$ diff --git a/tests/data/test-diff-suppr/test29-suppr-6.txt b/tests/data/test-diff-suppr/test29-suppr-6.txt index 55cfbc76..4d8c8d1b 100644 --- a/tests/data/test-diff-suppr/test29-suppr-6.txt +++ b/tests/data/test-diff-suppr/test29-suppr-6.txt @@ -1,3 +1,3 @@ [suppress_variable] - file_name_not_regexp = .*libtest29-soname.*\\.so$ + file_name_not_regexp = (^|/)libtest29-soname.*\\.so$ diff --git a/tests/data/test-diff-suppr/test29-suppr-7.txt b/tests/data/test-diff-suppr/test29-suppr-7.txt index ba799b3e..5c0aa653 100644 --- a/tests/data/test-diff-suppr/test29-suppr-7.txt +++ b/tests/data/test-diff-suppr/test29-suppr-7.txt @@ -1,2 +1,2 @@ [suppress_type] - file_name_not_regexp = ^libtest29-soname-wrong.*\\.so$ + file_name_not_regexp = (^|/)libtest29-soname-wrong.*\\.so$ diff --git a/tests/data/test-diff-suppr/test29-suppr-8.txt b/tests/data/test-diff-suppr/test29-suppr-8.txt index 6c86f5b8..cc8b20e6 100644 --- a/tests/data/test-diff-suppr/test29-suppr-8.txt +++ b/tests/data/test-diff-suppr/test29-suppr-8.txt @@ -1,2 +1,2 @@ [suppress_type] - file_name_not_regexp = .*libtest29-soname.*\\.so$ + file_name_not_regexp = (^|/)libtest29-soname.*\\.so$ diff --git a/tests/data/test-diff-suppr/test33-suppr-1.txt b/tests/data/test-diff-suppr/test33-suppr-1.txt index 32d46796..069e345d 100644 --- a/tests/data/test-diff-suppr/test33-suppr-1.txt +++ b/tests/data/test-diff-suppr/test33-suppr-1.txt @@ -1,4 +1,4 @@ [suppress_type] type_kind = class - source_location_not_regexp = test33-v\[0-9\]*\\.h + source_location_not_regexp = (^|/)test33-v[0-9]*\\.h$ drop = true diff --git a/tests/data/test-diff-suppr/test38-char-class-in-ini.abignore b/tests/data/test-diff-suppr/test38-char-class-in-ini.abignore index 07f3f91f..9318d513 100644 --- a/tests/data/test-diff-suppr/test38-char-class-in-ini.abignore +++ b/tests/data/test-diff-suppr/test38-char-class-in-ini.abignore @@ -1,4 +1,4 @@ [suppress_function] - filename_regexp = ^test38-char-class-in-ini-v[[:digit:]].* + file_name_regexp = (^|/)test38-char-class-in-ini-v[[:digit:]] symbol_name_regexp = bar change_kind = added-function diff --git a/tests/data/test-diff-suppr/test4-local-suppr-0.suppr b/tests/data/test-diff-suppr/test4-local-suppr-0.suppr index b7c6271b..d917d350 100644 --- a/tests/data/test-diff-suppr/test4-local-suppr-0.suppr +++ b/tests/data/test-diff-suppr/test4-local-suppr-0.suppr @@ -1,3 +1,3 @@ [suppress_type] # Types whose name start with "private" should not be flagged - name_regexp = ^private.* + name_regexp = ^private diff --git a/tests/data/test-diff-suppr/test6-fn-suppr-1.suppr b/tests/data/test-diff-suppr/test6-fn-suppr-1.suppr index 0bead6d7..f6a361db 100644 --- a/tests/data/test-diff-suppr/test6-fn-suppr-1.suppr +++ b/tests/data/test-diff-suppr/test6-fn-suppr-1.suppr @@ -1,2 +1,2 @@ [suppress_function] - symbol_version_regexp = VERSION_1\.* + symbol_version_regexp = ^VERSION_1 diff --git a/tests/data/test-diff-suppr/test7-var-suppr-9.suppr b/tests/data/test-diff-suppr/test7-var-suppr-9.suppr index cbe8b0bc..5d0bdd70 100644 --- a/tests/data/test-diff-suppr/test7-var-suppr-9.suppr +++ b/tests/data/test-diff-suppr/test7-var-suppr-9.suppr @@ -1,7 +1,7 @@ [suppress_function] # This one shouldn't catch anything, but it must be parsed fine. - symbol_version_regexp = ^VERSION_\[0-9\]\\.\[0-9\]$ + symbol_version_regexp = ^VERSION_[0-9]\\.[0-9]$ [suppress_variable] # This one should be parsed fine too. - symbol_version_regexp = ^VERSION_\[0-9\]\\.\[0-9\]$ \ No newline at end of file + symbol_version_regexp = ^VERSION_[0-9]\\.[0-9]$ From patchwork Mon Apr 20 16:41:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Giuliano Procida X-Patchwork-Id: 39104 From: gprocida@google.com (Giuliano Procida) Date: Mon, 20 Apr 2020 17:41:51 +0100 Subject: [PATCH 2/3] test35-leaf.suppr: fix regex typo. In-Reply-To: <20200420164153.5213-1-gprocida@google.com> References: <20200420164153.5213-1-gprocida@google.com> Message-ID: <20200420164153.5213-2-gprocida@google.com> Bad regexes are silently ignored. This will be fixed in a later commit. * tests/data/test-diff-suppr/test35-leaf.suppr: Fix typo in regex, "*." -> ".*". Signed-off-by: Giuliano Procida Reviewed-by: Matthias Maennich --- tests/data/test-diff-suppr/test35-leaf.suppr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/data/test-diff-suppr/test35-leaf.suppr b/tests/data/test-diff-suppr/test35-leaf.suppr index b4ec73c8..b49293ec 100644 --- a/tests/data/test-diff-suppr/test35-leaf.suppr +++ b/tests/data/test-diff-suppr/test35-leaf.suppr @@ -4,5 +4,5 @@ # member named 'member0'. That would be the type named # leaf_to_filter. - name_regexp = *. + name_regexp = .* has_data_member_inserted_between = {offset_after(member0), end} From patchwork Mon Apr 20 16:41:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Giuliano Procida X-Patchwork-Id: 39105 From: gprocida@google.com (Giuliano Procida) Date: Mon, 20 Apr 2020 17:41:53 +0100 Subject: [PATCH 3/3] test24-soname-suppr*txt: Fix suppression syntax. In-Reply-To: <20200420164153.5213-1-gprocida@google.com> References: <20200420164153.5213-1-gprocida@google.com> Message-ID: <20200420164153.5213-3-gprocida@google.com> The property name "reached_through" should have been "accessed_through". * tests/data/test-diff-suppr/test24-soname-suppr-0.txt: Fix typo, change "reached_through" to "accessed_through". * tests/data/test-diff-suppr/test24-soname-suppr-1.txt: Ditto. * tests/data/test-diff-suppr/test24-soname-suppr-2.txt: Ditto. * tests/data/test-diff-suppr/test24-soname-suppr-3.txt: Ditto. * tests/data/test-diff-suppr/test24-soname-suppr-4.txt: Ditto. Signed-off-by: Giuliano Procida --- tests/data/test-diff-suppr/test24-soname-suppr-0.txt | 2 +- tests/data/test-diff-suppr/test24-soname-suppr-1.txt | 2 +- tests/data/test-diff-suppr/test24-soname-suppr-2.txt | 2 +- tests/data/test-diff-suppr/test24-soname-suppr-3.txt | 2 +- tests/data/test-diff-suppr/test24-soname-suppr-4.txt | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/data/test-diff-suppr/test24-soname-suppr-0.txt b/tests/data/test-diff-suppr/test24-soname-suppr-0.txt index 2fb72ef3..19125bc7 100644 --- a/tests/data/test-diff-suppr/test24-soname-suppr-0.txt +++ b/tests/data/test-diff-suppr/test24-soname-suppr-0.txt @@ -2,4 +2,4 @@ soname_regexp = ^libtest24-soname$ name = S type_kind = struct - reached_through = reference_or_pointer + accessed_through = reference_or_pointer diff --git a/tests/data/test-diff-suppr/test24-soname-suppr-1.txt b/tests/data/test-diff-suppr/test24-soname-suppr-1.txt index 34ec72c0..a59000a5 100644 --- a/tests/data/test-diff-suppr/test24-soname-suppr-1.txt +++ b/tests/data/test-diff-suppr/test24-soname-suppr-1.txt @@ -1,4 +1,4 @@ [suppress_type] soname_regexp = ^libtest24-soname-$ name = S - reached_through = reference_or_pointer + accessed_through = reference_or_pointer diff --git a/tests/data/test-diff-suppr/test24-soname-suppr-2.txt b/tests/data/test-diff-suppr/test24-soname-suppr-2.txt index 65b50fbb..2c4b1fc9 100644 --- a/tests/data/test-diff-suppr/test24-soname-suppr-2.txt +++ b/tests/data/test-diff-suppr/test24-soname-suppr-2.txt @@ -1,4 +1,4 @@ [suppress_type] file_name_regexp = (^|/)libtest24-soname-v0\\.so$ name = S - reached_through = reference_or_pointer + accessed_through = reference_or_pointer diff --git a/tests/data/test-diff-suppr/test24-soname-suppr-3.txt b/tests/data/test-diff-suppr/test24-soname-suppr-3.txt index f72fd141..e1c299ac 100644 --- a/tests/data/test-diff-suppr/test24-soname-suppr-3.txt +++ b/tests/data/test-diff-suppr/test24-soname-suppr-3.txt @@ -1,4 +1,4 @@ [suppress_type] file_name_regexp = (^|/)libtest24-soname-v1\\.so$ name = S - reached_through = reference_or_pointer + accessed_through = reference_or_pointer diff --git a/tests/data/test-diff-suppr/test24-soname-suppr-4.txt b/tests/data/test-diff-suppr/test24-soname-suppr-4.txt index 29a0b6ec..01cd9f0b 100644 --- a/tests/data/test-diff-suppr/test24-soname-suppr-4.txt +++ b/tests/data/test-diff-suppr/test24-soname-suppr-4.txt @@ -1,4 +1,4 @@ [suppress_type] file_name_regexp = (^|/)libtest24-soname-\\.so$ name = S - reached_through = reference_or_pointer + accessed_through = reference_or_pointer