diff options
author | mRnea <akannemre@gmail.com> | 2024-08-09 11:41:14 +0300 |
---|---|---|
committer | mRnea <akannemre@gmail.com> | 2024-08-09 11:41:14 +0300 |
commit | b574944656e3a0fa469a728ec7ed4483befb73de (patch) | |
tree | 7099c19d9fdeff4e6a23d7a68ff0fc811a6b3c03 /test | |
parent | 1056b74b115f2a0a5cdb6b05fffc6eb476fb1f3c (diff) |
added ops for C codegen
Diffstat (limited to 'test')
-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)) |