Mercurial > core / lisp/lib/skel/tests.lisp
changeset 630: |
f4a464cc1628 |
parent: |
5bd0eb9fa1fa
|
child: |
bbd9024f2fe2 |
author: |
Richard Westhaver <ellis@rwest.io> |
date: |
Wed, 28 Aug 2024 22:08:42 -0400 |
permissions: |
-rw-r--r-- |
description: |
skel/vm work, added json benchmark |
1 ;;; skel/tests.lisp --- skel tests 2 (defpackage :skel/tests 3 (:use :cl :skel :rt :log :obj :dat/sxp) 4 (:import-from :uiop :file-exists-p)) 6 (in-package :skel/tests) 13 (setq %tmp (format nil "/tmp/~A.~A" (gensym) ext))) 15 (defun do-tmp-path (file &rest body) 17 (when (file-exists-p file) (delete-file file)))) 19 (deftest header-comments () 20 "Make sure header comments are generated correctly. 22 This covers variations of make-source-header-comment, make-source-file-header, 23 make-shebang-comment, and make-shebang-file-header." 24 (is (eq (type-of (make-shebang-file-header 25 (make-shebang-comment "/dev/null"))) 27 (is (eq (type-of (make-source-file-header 28 (make-source-header-comment 31 :description "nothing to see here" 32 :opts '("Definitely-Not_Emacs: T;")))) 36 "Ensure skelfiles are created and loaded correctly and that they signal 37 the appropriate restarts." 38 (do-tmp-path (tmp-path "sk") 40 (make-instance 'sk-project :name "nada" :path "test" :vc :hg) :path %tmp :if-exists :supersede)) 41 (ignore-errors (delete-file %tmp)) 42 (setf %tmp (tmp-path "sk")) 43 (is (init-skelfile %tmp)) 44 (is (load-skelfile %tmp)) 45 (is (build-ast (sk-read-file (make-instance 'sk-project) %tmp))))) 48 "Ensure skelrc files are created and loaded correctly." 49 (do-tmp-path (tmp-path "skrc"))) 52 "Make sure makefiles are making out ok." 53 (do-tmp-path (tmp-path "mk") 54 (flet ((mk (&optional path) (make-instance 'makefile :name (gensym) 55 :path (or path (pathname %tmp)) :description "barfood")) 56 (src (path) (list path)) 57 (cmd (body) (make-instance 'sk-command :body body)) 58 (rule (tr sr) (make-sk-rule tr sr nil))) 59 (is (null (sk-write-file (mk) :if-exists :supersede :path (tmp-path "mk")))) 60 (let* ((tr1 (tmp-path "t1")) 62 (sr (src (tmp-path "s1"))) 66 (is (push-mk-rule r1 mk1)) 67 (is (push-mk-rule r2 mk1)) 68 (is (push-mk-directive 69 (cmd "ifeq ($(DEBUG),1) echo foo 72 (is (push-mk-var '(a b) mk1)) 73 (is (push-mk-var '(b c) mk1)) 75 (is (null (sk-write-file mk1 :if-exists :supersede :path (pathname (tmp-path "mk"))))) 81 (is (sb-lockless::split-ordered-list-p *skel-scope*)) 82 (is (sb-vm:arena-p *skel-arena*)) 86 (let ((sk (make-instance 'sk-project :components '((:lisp "test") 87 (:lisp-system "test")))))