Coverage report: /home/ellis/comp/core/lib/syn/tests/gen/c.lisp

KindCoveredAll%
expression010 0.0
branch00nil
Key
Not instrumented
Conditionalized out
Executed
Not executed
 
Both branches taken
One branch taken
Neither branch taken
1
 ;;; c.lisp --- SYN/GEN/C Tests
2
 
3
 ;; 
4
 
5
 ;;; Code:
6
 (in-package :syn/tests/gen)
7
 (defpackage :syn/tests/gen/c
8
   (:use :cl :syn/tests/gen :syn/gen :gen/c)
9
   (:import-from :rt :deftest :is :iseql :isequal :in-suite :defsuite)
10
   (:import-from :cli/tools/cc :run-cc)
11
   (:export
12
    #:*gen-c-test-files*))
13
 
14
 (in-package :syn/tests/gen/c)
15
 (defsuite :syn/gen/c)
16
 (in-suite :syn/gen/c)
17
 
18
 (defvar *gen-c-test-files* (asdf:system-relative-pathname :syn "tests/gen/c/"))
19
 
20
 (deftest simple ()
21
   "Test a set of simple GEN/C forms."
22
   (with-codegen :c
23
     (with-gen-test (merge-pathnames "simple.sxp" *gen-c-test-files*)
24
       (gen-c %in %out)
25
       (is (probe-file %out))
26
       (run-cc (namestring %out) (format nil "-o~A" %bin))
27
       (is (probe-file %bin))
28
       (isequal
29
        (format nil "Hello, World!~%")
30
        (with-output-to-string (s)
31
          (sb-ext:run-program %bin nil :output s :wait t)))
32
       ;; (delete-file %out)
33
       (std:println %out)
34
       (delete-file %bin))))