aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--init.scm5
-rw-r--r--tests.scm14
2 files changed, 19 insertions, 0 deletions
diff --git a/init.scm b/init.scm
index af38620..3769ed0 100644
--- a/init.scm
+++ b/init.scm
@@ -701,6 +701,11 @@
,@(cdr form)
(current-environment))))
+(define-macro (export name . expressions)
+ `(define ,name
+ (begin
+ ,@expressions)))
+
;;;;; I/O
(define (input-output-port? p)
diff --git a/tests.scm b/tests.scm
index 490f95a..eee8ce5 100644
--- a/tests.scm
+++ b/tests.scm
@@ -226,6 +226,7 @@
(define (dirname path)
(let ((i (string-rindex path #\/)))
(if i (substring path 0 i) ".")))
+(assert (string=? "foo/bar" (dirname "foo/bar/baz")))
;; Helper for (pipe).
(define :read-end car)
@@ -739,6 +740,19 @@
(loop (pool::add (test::run-sync))
(cdr tests'))))))
+;; Run tests either in sequence or in parallel, depending on the
+;; number of tests and the command line flags.
+(define (run-tests tests)
+ (if (and (flag "--parallel" *args*)
+ (> (length tests) 1))
+ (run-tests-parallel tests)
+ (run-tests-sequential tests)))
+
+;; Load all tests from the given path.
+(define (load-tests . path)
+ (load (apply in-srcdir `(,@path "all-tests.scm")))
+ all-tests)
+
;; Helper to create environment caches from test functions. SETUP
;; must be a test implementing the producer side cache protocol.
;; Returns a promise containing the arguments that must be passed to a