C code passes all tests

This commit is contained in:
2024-08-09 11:54:22 +03:00
parent b574944656
commit e7b5f4fec7

View File

@@ -66,16 +66,19 @@
"---actual output---" "---actual output---"
output)))) output))))
;; delete generated .asm .o and executable file ;; delete generated .asm .o and executable file
(delete-file (probe-file (change-file-type abs-path "asm"))) (case target
(delete-file (probe-file (change-file-type abs-path "o"))) (: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))))) (delete-file (probe-file (drop-file-type abs-path)))))
successful)) successful))
(defun run-tests (&optional (ignore-err nil)) (defun run-tests (&key (ignore-err nil) (target :nasm))
(loop for success? (loop for success?
in (mapcar (lambda (file) (if (not ignore-err) in (mapcar (lambda (file) (if (not ignore-err)
(run-test file) (run-test file :target target)
(ignore-errors (run-test file)))) (ignore-errors
(run-test file :target target))))
(remove-if-not (lambda (file) (remove-if-not (lambda (file)
(string= "lorth" (pathname-type file))) (string= "lorth" (pathname-type file)))
(cl-fad:list-directory (cl-fad:list-directory