Mercurial > core / lisp/lib/skel/tests.lisp
changeset 698: |
96958d3eb5b0 |
parent: |
cc89b337384b
|
author: |
Richard Westhaver <ellis@rwest.io> |
date: |
Fri, 04 Oct 2024 22:04:59 -0400 |
permissions: |
-rw-r--r-- |
description: |
fixes |
1 ;;; skel/tests.lisp --- skel tests 2 (defpackage :skel/tests 3 (:use :cl :skel :rt :log :obj :dat/sxp :std/path) 4 (:import-from :uiop :file-exists-p)) 6 (in-package :skel/tests) 11 (defun tmp-path (ext) (make-pathname :name (namestring (tmpize-pathname (string (gensym "g")))) :type ext)) 13 (deftest header-comments () 14 "Make sure header comments are generated correctly. 16 This covers variations of make-source-header-comment, make-source-file-header, 17 make-shebang-comment, and make-shebang-file-header." 18 (is (eq (type-of (make-shebang-file-header 19 (make-shebang-comment "/dev/null"))) 21 (is (eq (type-of (make-source-file-header 22 (make-source-header-comment 25 :description "nothing to see here" 26 :opts '("Definitely-Not_Emacs: T;")))) 30 "Ensure skelfiles are created and loaded correctly and that they signal 31 the appropriate restarts." 32 (with-tmp-file (f :type "sk") 34 (make-instance 'sk-project :name "nada" :path "test" :vc :hg) :path *tmp* :if-exists :supersede)) 35 (is (load-skelfile *tmp*)) 36 (is (build-ast (sk-read-file (make-instance 'sk-project) *tmp*))))) 39 "Ensure skelrc files are created and loaded correctly." 40 (with-tmp-file (f :name "" :type "skelrc"))) 43 "Make sure makefiles are making out ok." 44 (with-tmp-file (f :name "" :type "mk") 45 (flet ((mk (&optional path) (make-instance 'makefile :name (gensym) 47 (when path (merge-pathnames path *tmp*)) 49 :description "barfood")) 50 (src (path) (list path)) 51 (cmd (&rest body) body) 52 (rule (tr sr) (make-sk-rule (file-namestring tr) sr))) 53 (is (null (sk-write-file (mk) :if-exists :supersede :path (tmp-path "mk")))) 54 (let* ((tr1 (tmp-path "t1")) 56 (sr (src (tmp-path "s1"))) 58 (r2 (rule (car sr) (src tr2))) 60 (is (push-mk-rule r1 mk1)) 61 (is (push-mk-rule r2 mk1)) 62 (is (push-mk-directive 63 (cmd "ifeq ($(DEBUG),1) echo foo 66 (is (push-mk-var '(a b) mk1)) 67 (is (push-mk-var '(b c) mk1)) 71 (sk-write-file mk1 :if-exists :supersede :path (merge-pathnames (tmp-path "mk") *tmp*)))))))) 76 (is (sb-lockless::split-ordered-list-p *skel-scope*)) 77 (is (sb-vm:arena-p *skel-arena*)) 81 (let ((sk (make-instance 'sk-project :components '((:lisp "test") 82 (:lisp-system "test")))))