From 19e3b5adc33d030a203c5766e5d325ef1596c714 Mon Sep 17 00:00:00 2001
From: pfdietz <pfdietz@localhost>
Date: Sun, 24 Apr 2005 18:09:42 +0000
Subject: [PATCH] Get rid of non-standard way to remove fasl files

---
 ansi-tests/doit.lsp    | 11 +++++++++--
 ansi-tests/gclload.lsp | 17 +++++++++++++++--
 2 files changed, 24 insertions(+), 4 deletions(-)

diff --git a/ansi-tests/doit.lsp b/ansi-tests/doit.lsp
index 62db62e7..3982aa24 100644
--- a/ansi-tests/doit.lsp
+++ b/ansi-tests/doit.lsp
@@ -4,9 +4,16 @@
 ;;; with arbitrary legal garbage.
 ;; (pushnew :ansi-tests-strict-initial-element *features*)
 
-#+allegro (run-shell-command "rm -f *.fasl")
 #+allegro (setq *enclose-printer-errors* nil)
-#+cmu (run-program "rm -f *.x86f")
+
+;;; Remove compiled files
+(let* ((fn (compile-file-pathname "doit.lsp"))
+       (type (pathname-type fn))
+       (dir-pathname (make-pathname :name :wild :type type))
+       (files (directory dir-pathname)))
+  (assert type)
+  (assert (not (string-equal type "lsp")))
+  (mapc #'delete-file files))
 
 (load "gclload1.lsp")
 (load "gclload2.lsp")
diff --git a/ansi-tests/gclload.lsp b/ansi-tests/gclload.lsp
index 40b7158d..087a2f18 100644
--- a/ansi-tests/gclload.lsp
+++ b/ansi-tests/gclload.lsp
@@ -4,9 +4,16 @@
 ;;; with arbitrary legal garbage.
 ;; (pushnew :ansi-tests-strict-initial-element *features*)
 
-#+allegro (run-shell-command "rm -f *.fasl")
 #+allegro (setq *enclose-printer-errors* nil)
-#+cmu (run-program "rm" '("-f" "*.x86f" "*.sparcf" "*.ppcf"))
+
+;;; Remove compiled files
+(let* ((fn (compile-file-pathname "doit.lsp"))
+       (type (pathname-type fn))
+       (dir-pathname (make-pathname :name :wild :type type))
+       (files (directory dir-pathname)))
+  (assert type)
+  (assert (not (string-equal type "lsp")))
+  (mapc #'delete-file files))
 
 (load "gclload1.lsp")
 (load "gclload2.lsp")
@@ -20,4 +27,10 @@
   (rt:disable-note :assume-no-gray-streams))
 
 (in-package :cl-test)
+
+;;; These two tests will misbehave if the tests are being
+;;; invoked from a file that is being loaded, so remove them
+(when *load-pathname*
+  (mapc #'regression-test:rem-test '(load-pathname.1 load-truename.1)))
+
 (time (regression-test:do-tests))
-- 
GitLab