Coverage report: /home/ellis/comp/core/lib/vc/tests.lisp

KindCoveredAll%
expression414 28.6
branch00nil
Key
Not instrumented
Conditionalized out
Executed
Not executed
 
Both branches taken
One branch taken
Neither branch taken
1
 (defpackage :vc/tests
2
   (:use :cl :std :rt :vc/proto :vc/git :vc/hg :vc :io/zstd :io/flate))
3
 
4
 (in-package :vc/tests)
5
 (defsuite :vc)
6
 (in-suite :vc)
7
 
8
 (defmacro with-temp-repo (kind &body body)
9
   `(let ((repo ,(make-repo ".")))
10
      (setf (path repo) (merge-pathnames (format nil "~A" (gensym "repo")) "/tmp/"))
11
      (case ,kind
12
        (:hg (sb-mop::change-class repo 'hg-repo))
13
        (:git (sb-mop::change-class repo 'git-repo))
14
        (t nil))
15
      (vc-init repo)
16
      (let ((*default-pathname-defaults* (path repo)))
17
        ,@body)))
18
 
19
 (deftest git-simple ()
20
   (with-temp-repo :git
21
     (is (streamp (sb-ext:process-output (run-git-command "status" nil :stream))))))
22
 
23
 (deftest hg-simple ()
24
   (with-temp-repo :hg
25
     (is (streamp (sb-ext:process-output (run-hg-command "status" nil :stream))))))
26
 
27
 (deftest vc-simple ()
28
   (with-temp-repo *default-vc-kind* (is repo)))
29
 
30
 ;; TODO 2024-08-22: 
31
 (deftest vc-mirror-update (:skip t)
32
   "This test replicates a nushell script we've used for a very long time - 'use
33
 vc.nu; vc mirrors update;'"
34
   (with-temp-repo :hg
35
     (vc-id repo)))
36
 
37
 (deftest vc-iterator (:skip t)
38
   "Test iteration over a set of VC-REPOs.")
39
 
40
 (deftest vc-bundle ()
41
   (with-temp-repo :hg
42
     (let ((out #p"/tmp/bundle.hg.zst"))
43
       (isequal out (vc-bundle repo out :type "zstd-v2"))
44
       (delete-file out))))