[PATCH] test: remove directory names from paths in exceptions

Subject: [PATCH] test: remove directory names from paths in exceptions

Date: Sun, 5 Dec 2021 09:56:03 -0400

To: notmuch@notmuchmail.org

Cc:

From: David Bremner


These cause failures when building out of tree.
---
 test/T562-lib-database.sh  | 4 ++--
 test/T563-lib-directory.sh | 4 ++--
 test/test-lib.sh           | 2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/test/T562-lib-database.sh b/test/T562-lib-database.sh
index d9f5d18e..2314efd2 100755
--- a/test/T562-lib-database.sh
+++ b/test/T562-lib-database.sh
@@ -80,7 +80,7 @@ cat <<EOF > EXPECTED
 == stdout ==
 0
 == stderr ==
-A Xapian exception occurred at lib/database.cc:XXX: Database has been closed
+A Xapian exception occurred at database.cc:XXX: Database has been closed
 EOF
 test_expect_equal_file EXPECTED OUTPUT
 
@@ -145,7 +145,7 @@ cat <<EOF > EXPECTED
 == stdout ==
 1
 == stderr ==
-A Xapian exception occurred at lib/database.cc:XXX: Database has been closed
+A Xapian exception occurred at database.cc:XXX: Database has been closed
 EOF
 test_expect_equal_file EXPECTED OUTPUT
 
diff --git a/test/T563-lib-directory.sh b/test/T563-lib-directory.sh
index ad390c1c..ebd7fcb2 100755
--- a/test/T563-lib-directory.sh
+++ b/test/T563-lib-directory.sh
@@ -51,7 +51,7 @@ cat <<EOF > EXPECTED
 == stdout ==
 1
 == stderr ==
-A Xapian exception occurred at lib/directory.cc:XXX: Database has been closed
+A Xapian exception occurred at directory.cc:XXX: Database has been closed
 EOF
 test_expect_equal_file EXPECTED OUTPUT
 
@@ -68,7 +68,7 @@ cat <<EOF > EXPECTED
 == stdout ==
 1
 == stderr ==
-A Xapian exception occurred at lib/directory.cc:XXX: Database has been closed
+A Xapian exception occurred at directory.cc:XXX: Database has been closed
 EOF
 test_expect_equal_file EXPECTED OUTPUT
 
diff --git a/test/test-lib.sh b/test/test-lib.sh
index e476a69b..6bc0b723 100644
--- a/test/test-lib.sh
+++ b/test/test-lib.sh
@@ -529,7 +529,7 @@ notmuch_debug_sanitize () {
 }
 
 notmuch_exception_sanitize () {
-    perl -pe 's/(A Xapian exception occurred at .*[.]cc?):([0-9]*)/\1:XXX/'
+    perl -pe 's,(A Xapian exception occurred at) .*?([^/]*[.]cc?):([0-9]*),\1 \2:XXX,'
 }
 
 notmuch_search_sanitize () {
-- 
2.33.0

_______________________________________________
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-leave@notmuchmail.org

Thread: