public inbox for libabigail@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 1/3] test-diff-suppr: Improve regexes in tests.
@ 2020-04-20 16:41 Giuliano Procida
  2020-04-20 16:41 ` [PATCH 2/3] test35-leaf.suppr: fix regex typo Giuliano Procida
                   ` (3 more replies)
  0 siblings, 4 replies; 14+ messages in thread
From: Giuliano Procida @ 2020-04-20 16:41 UTC (permalink / raw)
  To: libabigail; +Cc: dodji, kernel-team, gprocida, maennich

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 <gprocida@google.com>
---
 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<typo>-soname-abixml-v.*
+  soname_regexp = test48<typo>-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<typo>-soname-abixml-v.*$
+  file_name_regexp = (^|/)libtest48<typo>-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-<wrong-file-name>.so$
+  file_name_regexp = (^|/)libtest24-soname-<wrong-file-name>\\.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]$
-- 
2.26.1.301.g55bc3eb7cb9-goog


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH 2/3] test35-leaf.suppr: fix regex typo.
  2020-04-20 16:41 [PATCH 1/3] test-diff-suppr: Improve regexes in tests Giuliano Procida
@ 2020-04-20 16:41 ` Giuliano Procida
  2020-04-21 10:20   ` Matthias Maennich
  2020-04-22 13:56   ` Dodji Seketeli
  2020-04-20 16:41 ` [PATCH 3/3] test24-soname-suppr*txt: Fix suppression syntax Giuliano Procida
                   ` (2 subsequent siblings)
  3 siblings, 2 replies; 14+ messages in thread
From: Giuliano Procida @ 2020-04-20 16:41 UTC (permalink / raw)
  To: libabigail; +Cc: dodji, kernel-team, gprocida, maennich

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 <gprocida@google.com>
---
 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}
-- 
2.26.1.301.g55bc3eb7cb9-goog


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH 3/3] test24-soname-suppr*txt: Fix suppression syntax.
  2020-04-20 16:41 [PATCH 1/3] test-diff-suppr: Improve regexes in tests Giuliano Procida
  2020-04-20 16:41 ` [PATCH 2/3] test35-leaf.suppr: fix regex typo Giuliano Procida
@ 2020-04-20 16:41 ` Giuliano Procida
  2020-04-20 17:20   ` Giuliano Procida
  2020-04-21 10:19 ` [PATCH 1/3] test-diff-suppr: Improve regexes in tests Matthias Maennich
  2020-04-22 13:48 ` Dodji Seketeli
  3 siblings, 1 reply; 14+ messages in thread
From: Giuliano Procida @ 2020-04-20 16:41 UTC (permalink / raw)
  To: libabigail; +Cc: dodji, kernel-team, gprocida, maennich

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 <gprocida@google.com>
---
 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-<wrong-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-<wrong-file-name>\\.so$
   name = S
-  reached_through = reference_or_pointer
+  accessed_through = reference_or_pointer
-- 
2.26.1.301.g55bc3eb7cb9-goog


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 3/3] test24-soname-suppr*txt: Fix suppression syntax.
  2020-04-20 16:41 ` [PATCH 3/3] test24-soname-suppr*txt: Fix suppression syntax Giuliano Procida
@ 2020-04-20 17:20   ` Giuliano Procida
  2020-04-20 17:23     ` [PATCH 3/3 v2] " Giuliano Procida
  0 siblings, 1 reply; 14+ messages in thread
From: Giuliano Procida @ 2020-04-20 17:20 UTC (permalink / raw)
  To: libabigail; +Cc: Dodji Seketeli, kernel-team, Matthias Männich

v2 of this on the way - more typos found

On Mon, 20 Apr 2020 at 17:42, Giuliano Procida <gprocida@google.com> wrote:
>
> 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 <gprocida@google.com>
> ---
>  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-<wrong-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-<wrong-file-name>\\.so$
>    name = S
> -  reached_through = reference_or_pointer
> +  accessed_through = reference_or_pointer
> --
> 2.26.1.301.g55bc3eb7cb9-goog
>

^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH 3/3 v2] test24-soname-suppr*txt: Fix suppression syntax.
  2020-04-20 17:20   ` Giuliano Procida
@ 2020-04-20 17:23     ` Giuliano Procida
  2020-04-21 10:24       ` Matthias Maennich
  2020-04-22 15:05       ` Dodji Seketeli
  0 siblings, 2 replies; 14+ messages in thread
From: Giuliano Procida @ 2020-04-20 17:23 UTC (permalink / raw)
  To: libabigail; +Cc: dodji, kernel-team, gprocida, maennich

The property name "reached_through" should have been
"accessed_through" and the property value "reference_or_pointer"
should have been "reference-or-pointer".

This patch fixes these issues.

	* 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 <gprocida@google.com>
---
 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..4229dddb 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..7e6a8b2d 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-<wrong-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..f21dea13 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..e17c4e3f 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..4f970490 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-<wrong-file-name>\\.so$
   name = S
-  reached_through = reference_or_pointer
+  accessed_through = reference-or-pointer
-- 
2.26.1.301.g55bc3eb7cb9-goog


^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 1/3] test-diff-suppr: Improve regexes in tests.
  2020-04-20 16:41 [PATCH 1/3] test-diff-suppr: Improve regexes in tests Giuliano Procida
  2020-04-20 16:41 ` [PATCH 2/3] test35-leaf.suppr: fix regex typo Giuliano Procida
  2020-04-20 16:41 ` [PATCH 3/3] test24-soname-suppr*txt: Fix suppression syntax Giuliano Procida
@ 2020-04-21 10:19 ` Matthias Maennich
  2020-04-21 10:57   ` Giuliano Procida
  2020-04-22 13:48 ` Dodji Seketeli
  3 siblings, 1 reply; 14+ messages in thread
From: Matthias Maennich @ 2020-04-21 10:19 UTC (permalink / raw)
  To: Giuliano Procida; +Cc: libabigail, dodji, kernel-team

Hi Giuliano!

On Mon, Apr 20, 2020 at 05:41:50PM +0100, Giuliano Procida wrote:
>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 <gprocida@google.com>
>---
> 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<typo>-soname-abixml-v.*
>+  soname_regexp = test48<typo>-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<typo>-soname-abixml-v.*$
>+  file_name_regexp = (^|/)libtest48<typo>-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)$

Maybe
    file_name_regexp = (^|/)test0-type-suppr-v(0|1)\\.o$

But while I was at it, changing this to

    file_name_regexp = (^|/)test0-type-suppr-v0\\.o$

did not make the test fail. Shouldn't it?

>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)$

As above.

Other than that this looks good to me.

Reviewed-by: Matthias Maennich <maennich@google.com>

Cheers,
Matthias

>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-<wrong-file-name>.so$
>+  file_name_regexp = (^|/)libtest24-soname-<wrong-file-name>\\.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]$
>-- 
>2.26.1.301.g55bc3eb7cb9-goog
>

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 2/3] test35-leaf.suppr: fix regex typo.
  2020-04-20 16:41 ` [PATCH 2/3] test35-leaf.suppr: fix regex typo Giuliano Procida
@ 2020-04-21 10:20   ` Matthias Maennich
  2020-04-22 13:56   ` Dodji Seketeli
  1 sibling, 0 replies; 14+ messages in thread
From: Matthias Maennich @ 2020-04-21 10:20 UTC (permalink / raw)
  To: Giuliano Procida; +Cc: libabigail, dodji, kernel-team

On Mon, Apr 20, 2020 at 05:41:51PM +0100, Giuliano Procida wrote:
>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, "*." -> ".*".
>

Reviewed-by: Matthias Maennich <maennich@google.com>

Cheers,
Matthias
>Signed-off-by: Giuliano Procida <gprocida@google.com>
>---
> 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}
>-- 
>2.26.1.301.g55bc3eb7cb9-goog
>

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 3/3 v2] test24-soname-suppr*txt: Fix suppression syntax.
  2020-04-20 17:23     ` [PATCH 3/3 v2] " Giuliano Procida
@ 2020-04-21 10:24       ` Matthias Maennich
  2020-04-22 15:05       ` Dodji Seketeli
  1 sibling, 0 replies; 14+ messages in thread
From: Matthias Maennich @ 2020-04-21 10:24 UTC (permalink / raw)
  To: Giuliano Procida; +Cc: libabigail, dodji, kernel-team

On Mon, Apr 20, 2020 at 06:23:38PM +0100, Giuliano Procida wrote:
>The property name "reached_through" should have been
>"accessed_through" and the property value "reference_or_pointer"
>should have been "reference-or-pointer".
>
>This patch fixes these issues.
>
>	* 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 <gprocida@google.com>

Reviewed-by: Matthias Maennich <maennich@google.com>

Cheers,
Matthias

>---
> 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..4229dddb 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..7e6a8b2d 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-<wrong-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..f21dea13 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..e17c4e3f 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..4f970490 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-<wrong-file-name>\\.so$
>   name = S
>-  reached_through = reference_or_pointer
>+  accessed_through = reference-or-pointer
>-- 
>2.26.1.301.g55bc3eb7cb9-goog
>

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 1/3] test-diff-suppr: Improve regexes in tests.
  2020-04-21 10:19 ` [PATCH 1/3] test-diff-suppr: Improve regexes in tests Matthias Maennich
@ 2020-04-21 10:57   ` Giuliano Procida
  0 siblings, 0 replies; 14+ messages in thread
From: Giuliano Procida @ 2020-04-21 10:57 UTC (permalink / raw)
  To: Matthias Maennich; +Cc: libabigail, Dodji Seketeli, kernel-team

I could simplify the regex, but it's correct as-is.

From https://sourceware.org/libabigail/manual/libabigail-concepts.html#suppress-file:

"... if the directive prevents it from loading either one of the
files, then no comparison is performed."

So it's working as intended, though perhaps not with full test coverage.

Regards,
Giuliano.

On Tue, 21 Apr 2020 at 11:19, Matthias Maennich <maennich@google.com> wrote:
>
> Hi Giuliano!
>
> On Mon, Apr 20, 2020 at 05:41:50PM +0100, Giuliano Procida wrote:
> >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 <gprocida@google.com>
> >---
> > 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<typo>-soname-abixml-v.*
> >+  soname_regexp = test48<typo>-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<typo>-soname-abixml-v.*$
> >+  file_name_regexp = (^|/)libtest48<typo>-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)$
>
> Maybe
>     file_name_regexp = (^|/)test0-type-suppr-v(0|1)\\.o$
>
> But while I was at it, changing this to
>
>     file_name_regexp = (^|/)test0-type-suppr-v0\\.o$
>
> did not make the test fail. Shouldn't it?
>
> >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)$
>
> As above.
>
> Other than that this looks good to me.
>
> Reviewed-by: Matthias Maennich <maennich@google.com>
>
> Cheers,
> Matthias
>
> >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-<wrong-file-name>.so$
> >+  file_name_regexp = (^|/)libtest24-soname-<wrong-file-name>\\.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]$
> >--
> >2.26.1.301.g55bc3eb7cb9-goog
> >

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 1/3] test-diff-suppr: Improve regexes in tests.
  2020-04-20 16:41 [PATCH 1/3] test-diff-suppr: Improve regexes in tests Giuliano Procida
                   ` (2 preceding siblings ...)
  2020-04-21 10:19 ` [PATCH 1/3] test-diff-suppr: Improve regexes in tests Matthias Maennich
@ 2020-04-22 13:48 ` Dodji Seketeli
  2020-04-22 19:11   ` Giuliano Procida
  3 siblings, 1 reply; 14+ messages in thread
From: Dodji Seketeli @ 2020-04-22 13:48 UTC (permalink / raw)
  To: Giuliano Procida; +Cc: libabigail, kernel-team, maennich

Hello Giuliano,

Giuliano Procida <gprocida@google.com> a écrit:

> The are some (mostly inconsequential) issues with regexes:
>
>   - Leading and trailing .* are redundant and can be removed.

They are redundant I agree, but that redundancy can be useful, I think.
The reason why I have put them in the test is that in the past, I have
tried different regular expression engines.  Some of them would
implement the quantifier in a greedy manner, rather than in a lazy
manner.  Whereas, what I find more useful is the lazy variant.  So that
writing ".*blah" would do what you would expect (rather than having to
write .*?blah)

So putting that in those tests explicitly will hopefully help us catch
potential issues if we are to switch to a different engine tomorrow.  So
I'd prefer keeping that redundancy in those tests.

[...]

>   - File name matches are full path

Are they?

It seems to me file_suppression::suppress_file() acts on the base name
of the file, rather than on its full path.

I might be missing something here, please tell me.

> so should start with (^|/) if trying to match a base name, assuming a
> Unix-like filesystem.

I'd need the above to be clarified to say for sure.

>     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.

They don't *need* to (in a string) I agree.  But it they are escaped,
that should work.  It's a way to test the init parser as well.  So I'd
keep the redundancy there as well.

[...]

Cheers,

-- 
		Dodji

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 2/3] test35-leaf.suppr: fix regex typo.
  2020-04-20 16:41 ` [PATCH 2/3] test35-leaf.suppr: fix regex typo Giuliano Procida
  2020-04-21 10:20   ` Matthias Maennich
@ 2020-04-22 13:56   ` Dodji Seketeli
  1 sibling, 0 replies; 14+ messages in thread
From: Dodji Seketeli @ 2020-04-22 13:56 UTC (permalink / raw)
  To: Giuliano Procida; +Cc: libabigail, kernel-team, maennich

Giuliano Procida <gprocida@google.com> a écrit:

> 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, "*." -> ".*".

Applied to master, thanks!

Cheers,

-- 
		Dodji

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 3/3 v2] test24-soname-suppr*txt: Fix suppression syntax.
  2020-04-20 17:23     ` [PATCH 3/3 v2] " Giuliano Procida
  2020-04-21 10:24       ` Matthias Maennich
@ 2020-04-22 15:05       ` Dodji Seketeli
  1 sibling, 0 replies; 14+ messages in thread
From: Dodji Seketeli @ 2020-04-22 15:05 UTC (permalink / raw)
  To: Giuliano Procida; +Cc: libabigail, kernel-team, maennich

Giuliano Procida <gprocida@google.com> a écrit:

> The property name "reached_through" should have been
> "accessed_through" and the property value "reference_or_pointer"
> should have been "reference-or-pointer".
>
> This patch fixes these issues.
>
> 	* 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.

Applied to master, thanks!

Cheers,

-- 
		Dodji

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 1/3] test-diff-suppr: Improve regexes in tests.
  2020-04-22 13:48 ` Dodji Seketeli
@ 2020-04-22 19:11   ` Giuliano Procida
  2020-05-01 15:56     ` Giuliano Procida
  0 siblings, 1 reply; 14+ messages in thread
From: Giuliano Procida @ 2020-04-22 19:11 UTC (permalink / raw)
  To: Dodji Seketeli; +Cc: libabigail, kernel-team, Matthias Männich

Hi there.

Thanks for the review.

On Wed, 22 Apr 2020 at 14:48, Dodji Seketeli <dodji@seketeli.org> wrote:
>
> Hello Giuliano,
>
> Giuliano Procida <gprocida@google.com> a écrit:
>
> > The are some (mostly inconsequential) issues with regexes:
> >
> >   - Leading and trailing .* are redundant and can be removed.
>
> They are redundant I agree, but that redundancy can be useful, I think.
> The reason why I have put them in the test is that in the past, I have
> tried different regular expression engines.  Some of them would
> implement the quantifier in a greedy manner, rather than in a lazy
> manner.  Whereas, what I find more useful is the lazy variant.  So that
> writing ".*blah" would do what you would expect (rather than having to
> write .*?blah)

If we only care about match existence (which is the case for
libabigail), greediness shouldn't matter, the engine should backtrack.
Do you mean possessive matching (I've just found this on Wikipedia,
it's not something I thought regex engines had)? That would be painful
to work with.

If you want more features (like being able to match foofoo for any
foo), you'll want PCRE. If you are thinking of embedding libabigail in
a server, you'll want RE2.

> So putting that in those tests explicitly will hopefully help us catch
> potential issues if we are to switch to a different engine tomorrow.  So
> I'd prefer keeping that redundancy in those tests.

Fair enough.

> [...]
>
> >   - File name matches are full path
>
> Are they?

Correction, some file name matches seem to be full path. This may be a
bug. I've found:

Path in XML
corpus_is_suppressed_by_soname_or_filename
suppression_matches_soname_or_filename
matches_binary_name (@param binary_name the full path to the binary)

ELF path
suppression_can_match
matches_binary_name (@param binary_name the full path to the binary)

I've not traced through the code, only looked at it. This change
breaks make check:

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 d11e632c..8ac78817 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
   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 00d3428a..e94a6477 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
   accessed_through = reference-or-pointer

> It seems to me file_suppression::suppress_file() acts on the base name
> of the file, rather than on its full path.
>
> I might be missing something here, please tell me.
>
> > so should start with (^|/) if trying to match a base name, assuming a
> > Unix-like filesystem.
>
> I'd need the above to be clarified to say for sure.
>
> >     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.
>
> They don't *need* to (in a string) I agree.  But it they are escaped,
> that should work.  It's a way to test the init parser as well.  So I'd
> keep the redundancy there as well.

I'd go as far to say "\." should be "\\.". In fact, changing all the
tests to this exposes a bug in the init printer (it doesn't re-escape
strings).

For the rest, I'm much less opinionated. :-)

> [...]
>
> Cheers,

Regards,
Giuliano.

> --
>                 Dodji
>
> --
> To unsubscribe from this group and stop receiving emails from it, send an email to kernel-team+unsubscribe@android.com.
>

^ permalink raw reply	[flat|nested] 14+ messages in thread

* Re: [PATCH 1/3] test-diff-suppr: Improve regexes in tests.
  2020-04-22 19:11   ` Giuliano Procida
@ 2020-05-01 15:56     ` Giuliano Procida
  0 siblings, 0 replies; 14+ messages in thread
From: Giuliano Procida @ 2020-05-01 15:56 UTC (permalink / raw)
  To: Dodji Seketeli; +Cc: libabigail, kernel-team, Matthias Männich

Hi Dodji.

On Wed, 22 Apr 2020 at 20:11, Giuliano Procida <gprocida@google.com> wrote:
>
> Hi there.
>
> Thanks for the review.
>
> On Wed, 22 Apr 2020 at 14:48, Dodji Seketeli <dodji@seketeli.org> wrote:
> >
> > Hello Giuliano,
> >
> > Giuliano Procida <gprocida@google.com> a écrit:
> >
> > > The are some (mostly inconsequential) issues with regexes:
> > >
> > >   - Leading and trailing .* are redundant and can be removed.
> >
> > They are redundant I agree, but that redundancy can be useful, I think.
> > The reason why I have put them in the test is that in the past, I have
> > tried different regular expression engines.  Some of them would
> > implement the quantifier in a greedy manner, rather than in a lazy
> > manner.  Whereas, what I find more useful is the lazy variant.  So that
> > writing ".*blah" would do what you would expect (rather than having to
> > write .*?blah)
>
> If we only care about match existence (which is the case for
> libabigail), greediness shouldn't matter, the engine should backtrack.
> Do you mean possessive matching (I've just found this on Wikipedia,
> it's not something I thought regex engines had)? That would be painful
> to work with.
>
> If you want more features (like being able to match foofoo for any
> foo), you'll want PCRE. If you are thinking of embedding libabigail in
> a server, you'll want RE2.
>
> > So putting that in those tests explicitly will hopefully help us catch
> > potential issues if we are to switch to a different engine tomorrow.  So
> > I'd prefer keeping that redundancy in those tests.
>
> Fair enough.
>
> > [...]
> >
> > >   - File name matches are full path
> >
> > Are they?
>
> Correction, some file name matches seem to be full path. This may be a
> bug. I've found:

Have you had a chance to look at these cases where full path matching
is being done? Would you like a patch that makes it base name matching
instead?

Regards,
Giuliano.

> Path in XML
> corpus_is_suppressed_by_soname_or_filename
> suppression_matches_soname_or_filename
> matches_binary_name (@param binary_name the full path to the binary)
>
> ELF path
> suppression_can_match
> matches_binary_name (@param binary_name the full path to the binary)
>
> I've not traced through the code, only looked at it. This change
> breaks make check:
>
> 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 d11e632c..8ac78817 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
>    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 00d3428a..e94a6477 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
>    accessed_through = reference-or-pointer
>
> > It seems to me file_suppression::suppress_file() acts on the base name
> > of the file, rather than on its full path.
> >
> > I might be missing something here, please tell me.
> >
> > > so should start with (^|/) if trying to match a base name, assuming a
> > > Unix-like filesystem.
> >
> > I'd need the above to be clarified to say for sure.
> >
> > >     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.
> >
> > They don't *need* to (in a string) I agree.  But it they are escaped,
> > that should work.  It's a way to test the init parser as well.  So I'd
> > keep the redundancy there as well.
>
> I'd go as far to say "\." should be "\\.". In fact, changing all the
> tests to this exposes a bug in the init printer (it doesn't re-escape
> strings).
>
> For the rest, I'm much less opinionated. :-)
>
> > [...]
> >
> > Cheers,
>
> Regards,
> Giuliano.
>
> > --
> >                 Dodji
> >
> > --
> > To unsubscribe from this group and stop receiving emails from it, send an email to kernel-team+unsubscribe@android.com.
> >

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2020-05-01 15:57 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-20 16:41 [PATCH 1/3] test-diff-suppr: Improve regexes in tests Giuliano Procida
2020-04-20 16:41 ` [PATCH 2/3] test35-leaf.suppr: fix regex typo Giuliano Procida
2020-04-21 10:20   ` Matthias Maennich
2020-04-22 13:56   ` Dodji Seketeli
2020-04-20 16:41 ` [PATCH 3/3] test24-soname-suppr*txt: Fix suppression syntax Giuliano Procida
2020-04-20 17:20   ` Giuliano Procida
2020-04-20 17:23     ` [PATCH 3/3 v2] " Giuliano Procida
2020-04-21 10:24       ` Matthias Maennich
2020-04-22 15:05       ` Dodji Seketeli
2020-04-21 10:19 ` [PATCH 1/3] test-diff-suppr: Improve regexes in tests Matthias Maennich
2020-04-21 10:57   ` Giuliano Procida
2020-04-22 13:48 ` Dodji Seketeli
2020-04-22 19:11   ` Giuliano Procida
2020-05-01 15:56     ` Giuliano Procida

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).