diff options
Diffstat (limited to 'test/tests.lisp')
-rw-r--r-- | test/tests.lisp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/test/tests.lisp b/test/tests.lisp index 2dfb4cb..6096bf4 100644 --- a/test/tests.lisp +++ b/test/tests.lisp @@ -34,7 +34,7 @@ (collect (read-line str))) (t (finish))))))) -(defun run-test (path) +(defun run-test (path &key (target :nasm)) "File must begin with 2 comments: First must be TEST Second must eval to the expected result" @@ -49,8 +49,11 @@ (return-from run-test 'not-test)) (let ((expected-output (eval (read-form-comment str)))) (generate-program (parse-tokens (lex-stream str)) - :path (change-file-type abs-path "asm") - :compile t :silence t) + :path (change-file-type abs-path (case target + (:nasm "asm") + (:c "c"))) + :compile t :silence t + :target target) (let ((output (run (list (drop-file-type abs-path)) :output :string :silence t))) (format t "testing ~a... " (pathname-name path)) |