Add function RUN-TESTS-IN-HOST to run tests in the host implementation
authorDavid Vázquez <davazp@gmail.com>
Fri, 26 Apr 2013 14:32:05 +0000 (15:32 +0100)
committerDavid Vázquez <davazp@gmail.com>
Fri, 26 Apr 2013 14:32:05 +0000 (15:32 +0100)
jscl.lisp
tests-report.lisp
tests.lisp

index ef84f41..3a70e2e 100644 (file)
--- a/jscl.lisp
+++ b/jscl.lisp
                            (directory "tests/*.lisp")
                            (directory "tests-report.lisp"))) 
       (ls-compile-file input out))))
+
+
+;;; Run the tests in the host Lisp implementation. It is a quick way
+;;; to improve the level of trust of the tests.
+(defun run-tests-in-host ()
+  (dolist (input (append (directory "tests.lisp")
+                         (directory "tests/*.lisp")
+                         (directory "tests-report.lisp")))
+    (load input)))
index 529f1ad..d4a5275 100644 (file)
@@ -1,6 +1,6 @@
 (write-line "")
 (write-string "Finished. The execution took ")
-(write-string (prin1-to-string (/ (- (get-internal-real-time) *timestamp*) internal-time-units-per-second)))
+(write-string (prin1-to-string (/ (- (get-internal-real-time) *timestamp*) internal-time-units-per-second 1.0)))
 (write-line " seconds.")
 
 (cond
index 7707756..5c8251b 100644 (file)
@@ -1,6 +1,6 @@
 (defvar *passed-tests* 0)
 (defvar *failed-tests* 0)
-(defvar *timestamp* (get-internal-real-time))
+(defvar *timestamp*)
 
 (defmacro test (condition)
   `(cond
@@ -13,3 +13,5 @@
 
 (write-line "Running tests...")
 (write-line "")
+
+(setq *timestamp* (get-internal-real-time))