diff options
author | Jim Blandy <jimb@red-bean.com> | 1999-06-15 08:39:39 +0000 |
---|---|---|
committer | Jim Blandy <jimb@red-bean.com> | 1999-06-15 08:39:39 +0000 |
commit | 474d9afb8b13a5d0b0d4ba153c781f43b00a2a65 (patch) | |
tree | 232e26981a21b76707dafc71773ac0fee1abf566 | |
parent | 73cb0a970485ac74dc5a39092f462556b5abc462 (diff) | |
download | guile-474d9afb8b13a5d0b0d4ba153c781f43b00a2a65.tar.gz |
* lib.scm: Import (test-suite paths).
(data-file): New exported function.
-rw-r--r-- | test-suite/lib.scm | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/test-suite/lib.scm b/test-suite/lib.scm index 87ab54da8..bcf6bd400 100644 --- a/test-suite/lib.scm +++ b/test-suite/lib.scm @@ -16,7 +16,8 @@ ;;;; the Free Software Foundation, Inc., 59 Temple Place, Suite 330, ;;;; Boston, MA 02111-1307 USA -(define-module (test-suite lib)) +(define-module (test-suite lib) + #:use-module (test-suite paths)) (export @@ -38,7 +39,10 @@ make-log-reporter full-reporter user-reporter - format-test-name) + format-test-name + + ;; Finding test input files. + data-file) ;;;; If you're using Emacs's Scheme mode: @@ -402,3 +406,14 @@ (define (pass-if name condition) ((if condition pass fail) name)) + + +;;;; Helping test cases find their files + +;;; Returns FILENAME, relative to the directory the test suite data +;;; files were installed in, and makes sure the file exists. +(define (data-file filename) + (let ((f (in-vicinity datadir filename))) + (or (file-exists? f) + (error "Test suite data file does not exist: " f)) + f)) |