[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 02/02: test-bad-identifiers: ignore *.[hc] dotfiles
From: |
Rob Browning |
Subject: |
[Guile-commits] 02/02: test-bad-identifiers: ignore *.[hc] dotfiles |
Date: |
Sun, 14 Apr 2024 17:07:24 -0400 (EDT) |
rlb pushed a commit to branch main
in repository guile.
commit 3ff8836e64d8fd5ea2f934425ba6b7cd4cdf148e
Author: Rob Browning <rlb@defaultvalue.org>
AuthorDate: Tue Jul 4 12:22:58 2023 -0500
test-bad-identifiers: ignore *.[hc] dotfiles
When generating the list of test files, ignore any whose names begin
with a dot. If nothing else, this avoids crashing on the symlinks that
Emacs creates for files with pending changes. In that case it creates a
symlink to nowhere until the content is saved or reverted, and those
symlinks produce test failures like this:
Backtrace:
3 (primitive-load "/home/rlb/src/guile/utf8-debug/test-su?")
In ice-9/eval.scm:
619:8 2 (_ #(#(#(#<directory (guile-user) 7f0239b32c80> #) #) #))
In ice-9/ports.scm:
450:11 1 (call-with-input-file "../../libguile/.#strings.c" #<p?> ?)
In unknown file:
0 (open-file "../../libguile/.#strings.c" "r" #:encoding # ?)
ERROR: In procedure open-file:
In procedure open-file: No such file or directory:
"../../libguile/.#strings.c"
FAIL: test-bad-identifiers
* test-suite/standalone/test-bad-identifiers: ignore files with names
beginning with a dot.
---
test-suite/standalone/test-bad-identifiers | 13 +++++--------
1 file changed, 5 insertions(+), 8 deletions(-)
diff --git a/test-suite/standalone/test-bad-identifiers
b/test-suite/standalone/test-bad-identifiers
index e7af5a1d1..518ac7494 100755
--- a/test-suite/standalone/test-bad-identifiers
+++ b/test-suite/standalone/test-bad-identifiers
@@ -44,14 +44,11 @@ exec guile -q -s "$0" "$@"
acc
(cons (in-vicinity dir new) acc)))))))
-(define (directory-files-matching dir pattern)
- (let ((file-name-regexp (make-regexp pattern)))
- (filter (lambda (fn)
- (regexp-exec file-name-regexp fn))
- (directory-files dir))))
-
-(let loop ((file-names (directory-files-matching "../../libguile"
- "\\.[ch]$")))
+(let loop ((file-names (filter (lambda (fn)
+ (and (or (string-suffix? ".h" fn)
+ (string-suffix? ".c" fn))
+ (not (string-prefix? "." (basename
fn)))))
+ (directory-files "../../libguile"))))
(or (null? file-names)
(begin
(with-input-from-file (car file-names)