From 09908481b496f796b9961cb7125b3a95b97abebb Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20V=C3=A1zquez?= Date: Fri, 26 Apr 2013 15:32:05 +0100 Subject: [PATCH] Add function RUN-TESTS-IN-HOST to run tests in the host implementation --- jscl.lisp | 9 +++++++++ tests-report.lisp | 2 +- tests.lisp | 4 +++- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/jscl.lisp b/jscl.lisp index ef84f41..3a70e2e 100644 --- a/jscl.lisp +++ b/jscl.lisp @@ -80,3 +80,12 @@ (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))) diff --git a/tests-report.lisp b/tests-report.lisp index 529f1ad..d4a5275 100644 --- a/tests-report.lisp +++ b/tests-report.lisp @@ -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 diff --git a/tests.lisp b/tests.lisp index 7707756..5c8251b 100644 --- a/tests.lisp +++ b/tests.lisp @@ -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)) -- 1.7.10.4