From b574944656e3a0fa469a728ec7ed4483befb73de Mon Sep 17 00:00:00 2001 From: mRnea Date: Fri, 9 Aug 2024 11:41:14 +0300 Subject: added ops for C codegen --- test/tests.lisp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'test/tests.lisp') 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)) -- cgit v1.2.3