changelog shortlog graph tags branches changeset files revisions annotate raw help

Mercurial > core / lisp/lib/vc/tests.lisp

changeset 389: 95b861dff3d8
parent: 9b573fc6bc40
child: 88a6edf5291b
author: Richard Westhaver <ellis@rwest.io>
date: Fri, 31 May 2024 23:28:35 -0400
permissions: -rw-r--r--
description: box,skel,vc,obj upgrades, moved XDB to demo/examples/db
1 (defpackage :vc/tests
2  (:use :cl :std :rt :vc/proto :vc/git :vc/hg))
3 
4 (in-package :vc/tests)
5 (defsuite :vc)
6 (in-suite :vc)
7 (eval-always
8 (defmacro with-temp-repo (kind &body body)
9  `(let ((repo ,(make-repo ".")))
10  (setf (vc-repo-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* (vc::vc-repo-path repo)))
17  ,@body))))
18 
19 (deftest git ()
20  (with-temp-repo :git
21  (is (streamp (sb-ext:process-output (run-git-command "status" nil :stream))))))
22 
23 (deftest hg ()
24  (with-temp-repo :hg
25  (is (streamp (sb-ext:process-output (run-hg-command "status" nil :stream))))))
26 
27 (deftest vc ()
28  (with-temp-repo vc::*default-vc-kind* (is repo)))