diff --git a/ansi-tests/ansi-aux.lsp b/ansi-tests/ansi-aux.lsp
index 1ac7beaefe7467709aa938c170d39c4ff60c69cc..b09b97f5fc3f40cae02a57ccde545456787239c8 100644
--- a/ansi-tests/ansi-aux.lsp
+++ b/ansi-tests/ansi-aux.lsp
@@ -1366,6 +1366,13 @@ the condition to go uncaught if it cannot be classified."
 	  (unuse-package package using-package)))
       (delete-package package))))
 
+(defun delete-all-versions (pathspec)
+  "Replace the versions field of the pathname specified by pathspec with
+   :wild, and delete all the files this refers to."
+  (let* ((wild-pathname (make-pathname :version :wild :defaults (pathname pathspec)))
+	 (truenames (directory wild-pathname)))
+    (mapc #'delete-file truenames)))    
+
 (defconstant +fail-count-limit+ 20)
 
 (defmacro test-with-package-iterator (package-list-expr &rest symbol-types)