From 3ff8836e64d8fd5ea2f934425ba6b7cd4cdf148e Mon Sep 17 00:00:00 2001 From: Rob Browning Date: Tue, 4 Jul 2023 12:22:58 -0500 Subject: [PATCH] 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 (_ #(#(#(# #) #) #)) In ice-9/ports.scm: 450:11 1 (call-with-input-file "../../libguile/.#strings.c" # ?) 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)