[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
05/05: gnu: clitest: Fix test failure with newer grep.
From: |
guix-commits |
Subject: |
05/05: gnu: clitest: Fix test failure with newer grep. |
Date: |
Sun, 30 Apr 2023 11:28:46 -0400 (EDT) |
mbakke pushed a commit to branch master
in repository guix.
commit a34348967e032acfab2aa0b512d318a70f5543dd
Author: Marius Bakke <marius@gnu.org>
AuthorDate: Sun Apr 30 23:16:54 2023 +0800
gnu: clitest: Fix test failure with newer grep.
* gnu/packages/patches/clitest-grep-compat.patch: New file.
* gnu/local.mk (dist_patch_DATA): Adjust accordingly.
* gnu/packages/check.scm (clitest)[source](patches): New field.
[arguments]: While at it, remove obsolete substitution.
---
gnu/local.mk | 1 +
gnu/packages/check.scm | 8 +-------
gnu/packages/patches/clitest-grep-compat.patch | 27 ++++++++++++++++++++++++++
3 files changed, 29 insertions(+), 7 deletions(-)
diff --git a/gnu/local.mk b/gnu/local.mk
index 1a84e5b499..68a02d10b5 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1000,6 +1000,7 @@ dist_patch_DATA =
\
%D%/packages/patches/classpath-aarch64-support.patch \
%D%/packages/patches/classpath-miscompilation.patch \
%D%/packages/patches/cling-use-shared-library.patch \
+ %D%/packages/patches/clitest-grep-compat.patch \
%D%/packages/patches/clog-fix-shared-build.patch \
%D%/packages/patches/clucene-pkgconfig.patch \
%D%/packages/patches/cmake-curl-certificates-3.24.patch \
diff --git a/gnu/packages/check.scm b/gnu/packages/check.scm
index e671972654..17c2b7284e 100644
--- a/gnu/packages/check.scm
+++ b/gnu/packages/check.scm
@@ -310,6 +310,7 @@ for C++ 11 and beyond implemented as a single-header
library.")
(method git-fetch)
(uri (git-reference (url home-page) (commit version)))
(file-name (git-file-name name version))
+ (patches (search-patches "clitest-grep-compat.patch"))
(sha256
(base32
"1p745mxiq3hgi3ywfljs5sa1psi06awwjxzw0j9c2xx1b09yqv4a"))))
@@ -325,13 +326,6 @@ for C++ 11 and beyond implemented as a single-header
library.")
(replace 'check
(lambda* (#:key tests? #:allow-other-keys)
(when tests?
- (substitute* "test.md"
- ;; One test looks for an error from grep in the form "grep:
foo",
- ;; but our grep returns the absolute file name on errors.
Adjust
- ;; the test to cope with that.
- (("sed 's/\\^e\\*grep: \\.\\*/")
- "sed 's/.*e*grep: .*/"))
-
(setenv "HOME" "/tmp")
(invoke "./clitest" "test.md"))))
(replace 'install
diff --git a/gnu/packages/patches/clitest-grep-compat.patch
b/gnu/packages/patches/clitest-grep-compat.patch
new file mode 100644
index 0000000000..8707c35e3e
--- /dev/null
+++ b/gnu/packages/patches/clitest-grep-compat.patch
@@ -0,0 +1,27 @@
+Suppress a warning from grep which causes tests to fail.
+
+Taken from upstream pull request:
+
+ https://github.com/aureliojargas/clitest/pull/54
+
+diff --git a/test/inline-match-egrep.sh b/test/inline-match-egrep.sh
+--- a/test/inline-match-egrep.sh
++++ b/test/inline-match-egrep.sh
+@@ -42,7 +42,7 @@ $ printf ' \t \t\t \n' #=> --egrep ^
$
+ # egrep regexes. You'll need to test in your system if that's the
+ # case. I recommend using a literal tab to avoid problems.
+
+-$ printf 'may\tfail' #=> --egrep ^may\tfail$
++$ printf 'may\tfail' #=> --egrep ^may\\tfail$
+ $ printf 'may\tfail' #=> --egrep ^may[\t]fail$
+ $ printf 'will\tmatch' #=> --egrep ^will match$
+
+@@ -51,7 +51,7 @@ $ printf 'will\tmatch' #=> --egrep ^will match$
+ # These tests will fail:
+
+ $ printf 'will\nfail' #=> --egrep will.*fail
+-$ printf 'will\nfail' #=> --egrep will\nfail
++$ printf 'will\nfail' #=> --egrep will\\nfail
+
+ # If one line of a multiline results matches, the test is OK
+