diff options
author | Rob Browning <rlb@defaultvalue.org> | 2023-07-04 12:22:58 -0500 |
---|---|---|
committer | Rob Browning <rlb@defaultvalue.org> | 2024-04-14 15:59:31 -0500 |
commit | 3ff8836e64d8fd5ea2f934425ba6b7cd4cdf148e (patch) | |
tree | 28b5b944605d06b1d1ad503df37f48cc5935c904 | |
parent | 6bb6c89f891aaae078ca19a58b79b327ff182d02 (diff) | |
download | guile-3ff8836e64d8fd5ea2f934425ba6b7cd4cdf148e.tar.gz |
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.
-rwxr-xr-x | test-suite/standalone/test-bad-identifiers | 13 |
1 files 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) |