From e7b5f4fec78a09cc3ad8cf23e1f5a9b63638e187 Mon Sep 17 00:00:00 2001 From: mRnea Date: Fri, 9 Aug 2024 11:54:22 +0300 Subject: C code passes all tests --- test/tests.lisp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'test') diff --git a/test/tests.lisp b/test/tests.lisp index 6096bf4..e51aad2 100644 --- a/test/tests.lisp +++ b/test/tests.lisp @@ -66,16 +66,19 @@ "---actual output---" output)))) ;; delete generated .asm .o and executable file - (delete-file (probe-file (change-file-type abs-path "asm"))) - (delete-file (probe-file (change-file-type abs-path "o"))) + (case target + (:nasm (delete-file (probe-file (change-file-type abs-path "asm"))) + (delete-file (probe-file (change-file-type abs-path "o")))) + (:c (delete-file (probe-file (change-file-type abs-path "c"))))) (delete-file (probe-file (drop-file-type abs-path))))) successful)) -(defun run-tests (&optional (ignore-err nil)) +(defun run-tests (&key (ignore-err nil) (target :nasm)) (loop for success? in (mapcar (lambda (file) (if (not ignore-err) - (run-test file) - (ignore-errors (run-test file)))) + (run-test file :target target) + (ignore-errors + (run-test file :target target)))) (remove-if-not (lambda (file) (string= "lorth" (pathname-type file))) (cl-fad:list-directory -- cgit v1.2.3