;;;; 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
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:
(define (pass-if name condition)
((if condition pass fail) name))
+
+\f
+;;;; 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))