vc-tests.el 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611
  1. ;;; vc-tests.el --- Tests of different backends of vc.el
  2. ;; Copyright (C) 2014-2017 Free Software Foundation, Inc.
  3. ;; Author: Michael Albinus <michael.albinus@gmx.de>
  4. ;; This program is free software: you can redistribute it and/or
  5. ;; modify it under the terms of the GNU General Public License as
  6. ;; published by the Free Software Foundation, either version 3 of the
  7. ;; License, or (at your option) any later version.
  8. ;;
  9. ;; This program is distributed in the hope that it will be useful, but
  10. ;; WITHOUT ANY WARRANTY; without even the implied warranty of
  11. ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. ;; General Public License for more details.
  13. ;;
  14. ;; You should have received a copy of the GNU General Public License
  15. ;; along with this program. If not, see `http://www.gnu.org/licenses/'.
  16. ;;; Commentary:
  17. ;; For every supported VC on the machine, different test cases are
  18. ;; generated automatically.
  19. ;; Functions to be tested (see Commentary of vc.el). Mandatory
  20. ;; functions are marked with `*', optional functions are marked with `-':
  21. ;; BACKEND PROPERTIES
  22. ;;
  23. ;; * revision-granularity DONE
  24. ;; STATE-QUERYING FUNCTIONS
  25. ;;
  26. ;; * registered (file) DONE
  27. ;; * state (file) DONE
  28. ;; - dir-status (dir update-function)
  29. ;; - dir-status-files (dir files default-state update-function)
  30. ;; - dir-extra-headers (dir)
  31. ;; - dir-printer (fileinfo)
  32. ;; - status-fileinfo-extra (file)
  33. ;; * working-revision (file) DONE
  34. ;; - latest-on-branch-p (file)
  35. ;; * checkout-model (files) DONE
  36. ;; - mode-line-string (file)
  37. ;; STATE-CHANGING FUNCTIONS
  38. ;;
  39. ;; * create-repo (backend) DONE
  40. ;; * register (files &optional comment) DONE
  41. ;; - responsible-p (file)
  42. ;; - receive-file (file rev)
  43. ;; - unregister (file) DONE
  44. ;; * checkin (files comment)
  45. ;; * find-revision (file rev buffer)
  46. ;; * checkout (file &optional rev)
  47. ;; * revert (file &optional contents-done)
  48. ;; - rollback (files)
  49. ;; - merge-file (file rev1 rev2)
  50. ;; - merge-branch ()
  51. ;; - merge-news (file)
  52. ;; - pull (prompt)
  53. ;; - steal-lock (file &optional revision)
  54. ;; - modify-change-comment (files rev comment)
  55. ;; - mark-resolved (files)
  56. ;; - find-admin-dir (file)
  57. ;; HISTORY FUNCTIONS
  58. ;;
  59. ;; * print-log (files buffer &optional shortlog start-revision limit)
  60. ;; * log-outgoing (backend remote-location)
  61. ;; * log-incoming (backend remote-location)
  62. ;; - log-view-mode ()
  63. ;; - show-log-entry (revision)
  64. ;; - comment-history (file)
  65. ;; - update-changelog (files)
  66. ;; * diff (files &optional async rev1 rev2 buffer)
  67. ;; - revision-completion-table (files)
  68. ;; - annotate-command (file buf &optional rev)
  69. ;; - annotate-time ()
  70. ;; - annotate-current-time ()
  71. ;; - annotate-extract-revision-at-line ()
  72. ;; - region-history (FILE BUFFER LFROM LTO)
  73. ;; - region-history-mode ()
  74. ;; TAG SYSTEM
  75. ;;
  76. ;; - create-tag (dir name branchp)
  77. ;; - retrieve-tag (dir name update)
  78. ;; MISCELLANEOUS
  79. ;;
  80. ;; - make-version-backups-p (file)
  81. ;; - root (file)
  82. ;; - ignore (file &optional directory)
  83. ;; - ignore-completion-table
  84. ;; - previous-revision (file rev)
  85. ;; - next-revision (file rev)
  86. ;; - log-edit-mode ()
  87. ;; - check-headers ()
  88. ;; - delete-file (file)
  89. ;; - rename-file (old new)
  90. ;; - find-file-hook ()
  91. ;; - extra-menu ()
  92. ;; - extra-dir-menu ()
  93. ;; - conflicted-files (dir)
  94. ;;; Code:
  95. (require 'ert)
  96. (require 'vc)
  97. (declare-function w32-application-type "w32proc")
  98. ;; The working horses.
  99. (defvar vc-test--cleanup-hook nil
  100. "Functions for cleanup at the end of an ert test.
  101. Don't set it globally, the functions shall be let-bound.")
  102. (defun vc-test--revision-granularity-function (backend)
  103. "Run the `vc-revision-granularity' backend function."
  104. (vc-call-backend backend 'revision-granularity))
  105. (defun vc-test--create-repo-function (backend)
  106. "Run the `vc-create-repo' backend function.
  107. For backends which dont support it, it is emulated."
  108. (cond
  109. ((eq backend 'CVS)
  110. (let ((tmp-dir
  111. (expand-file-name
  112. (make-temp-name "vc-test") temporary-file-directory)))
  113. (make-directory (expand-file-name "module" tmp-dir) 'parents)
  114. (make-directory (expand-file-name "CVSROOT" tmp-dir) 'parents)
  115. (if (not (fboundp 'w32-application-type))
  116. (shell-command-to-string (format "cvs -Q -d:local:%s co module"
  117. tmp-dir))
  118. (let ((cvs-prog (executable-find "cvs"))
  119. (tdir tmp-dir))
  120. ;; If CVS executable is an MSYS program, reformat the file
  121. ;; name of TMP-DIR to have the /d/foo/bar form supported by
  122. ;; MSYS programs. (FIXME: What about Cygwin cvs.exe?)
  123. (if (eq (w32-application-type cvs-prog) 'msys)
  124. (setq tdir
  125. (concat "/" (substring tmp-dir 0 1) (substring tmp-dir 2))))
  126. (shell-command-to-string (format "cvs -Q -d:local:%s co module"
  127. tdir))))
  128. (rename-file "module/CVS" default-directory)
  129. (delete-directory "module" 'recursive)
  130. ;; We must cleanup the "remote" CVS repo as well.
  131. (add-hook 'vc-test--cleanup-hook
  132. `(lambda () (delete-directory ,tmp-dir 'recursive)))))
  133. ((eq backend 'Arch)
  134. (let ((archive-name (format "%s--%s" user-mail-address (random))))
  135. (when (string-match
  136. "no arch user id set" (shell-command-to-string "tla my-id"))
  137. (shell-command-to-string
  138. (format "tla my-id \"<%s>\"" user-mail-address)))
  139. (shell-command-to-string
  140. (format "tla make-archive %s %s" archive-name default-directory))
  141. (shell-command-to-string
  142. (format "tla my-default-archive %s" archive-name))))
  143. ((eq backend 'Mtn)
  144. (let ((archive-name "foo.mtn"))
  145. (shell-command-to-string
  146. (format
  147. "mtn db init --db=%s"
  148. (expand-file-name archive-name default-directory)))
  149. (shell-command-to-string
  150. (format "mtn --db=%s --branch=foo setup ." archive-name))))
  151. (t (vc-create-repo backend))))
  152. (defun vc-test--create-repo (backend)
  153. "Create a test repository in `default-directory', a temporary directory."
  154. (let ((vc-handled-backends `(,backend))
  155. (default-directory
  156. (file-name-as-directory
  157. (expand-file-name
  158. (make-temp-name "vc-test") temporary-file-directory)))
  159. vc-test--cleanup-hook)
  160. (unwind-protect
  161. (progn
  162. ;; Cleanup.
  163. (add-hook
  164. 'vc-test--cleanup-hook
  165. `(lambda () (delete-directory ,default-directory 'recursive)))
  166. ;; Check the revision granularity.
  167. (should (memq (vc-test--revision-granularity-function backend)
  168. '(file repository)))
  169. ;; Create empty repository.
  170. (make-directory default-directory)
  171. (should (file-directory-p default-directory))
  172. (vc-test--create-repo-function backend)
  173. (should (eq (vc-responsible-backend default-directory) backend)))
  174. ;; Save exit.
  175. (ignore-errors (run-hooks 'vc-test--cleanup-hook)))))
  176. ;; FIXME: Why isn't there `vc-unregister'?
  177. (defun vc-test--unregister-function (backend file)
  178. "Run the `vc-unregister' backend function.
  179. For backends which don't support it, `vc-not-supported' is signaled."
  180. ;; CVS, SVN, SCCS, SRC and Mtn are not supported, and will signal
  181. ;; `vc-not-supported'.
  182. (prog1
  183. (vc-call-backend backend 'unregister file)
  184. (vc-file-clearprops file)))
  185. (defmacro vc-test--run-maybe-unsupported-function (func &rest args)
  186. "Run FUNC with ARGS as arguments.
  187. Catch the `vc-not-supported' error."
  188. `(let (err)
  189. (condition-case err
  190. (funcall ,func ,@args)
  191. (vc-not-supported 'vc-not-supported)
  192. (t (signal (car err) (cdr err))))))
  193. (defun vc-test--register (backend)
  194. "Register and unregister a file.
  195. This checks also `vc-backend' and `vc-responsible-backend'."
  196. (let ((vc-handled-backends `(,backend))
  197. (default-directory
  198. (file-name-as-directory
  199. (expand-file-name
  200. (make-temp-name "vc-test") temporary-file-directory)))
  201. vc-test--cleanup-hook)
  202. (unwind-protect
  203. (progn
  204. ;; Cleanup.
  205. (add-hook
  206. 'vc-test--cleanup-hook
  207. `(lambda () (delete-directory ,default-directory 'recursive)))
  208. ;; Create empty repository.
  209. (make-directory default-directory)
  210. (vc-test--create-repo-function backend)
  211. ;; For file oriented backends CVS, RCS and SVN the backend is
  212. ;; returned, and the directory is registered already.
  213. (should (if (vc-backend default-directory)
  214. (vc-registered default-directory)
  215. (not (vc-registered default-directory))))
  216. (should (eq (vc-responsible-backend default-directory) backend))
  217. (let ((tmp-name1 (expand-file-name "foo" default-directory))
  218. (tmp-name2 "bla"))
  219. ;; Register files. Check for it.
  220. (write-region "foo" nil tmp-name1 nil 'nomessage)
  221. (should (file-exists-p tmp-name1))
  222. (should-not (vc-backend tmp-name1))
  223. (should (eq (vc-responsible-backend tmp-name1) backend))
  224. (should-not (vc-registered tmp-name1))
  225. (write-region "bla" nil tmp-name2 nil 'nomessage)
  226. (should (file-exists-p tmp-name2))
  227. (should-not (vc-backend tmp-name2))
  228. (should (eq (vc-responsible-backend tmp-name2) backend))
  229. (should-not (vc-registered tmp-name2))
  230. (vc-register (list backend (list tmp-name1 tmp-name2)))
  231. (should (file-exists-p tmp-name1))
  232. (should (eq (vc-backend tmp-name1) backend))
  233. (should (eq (vc-responsible-backend tmp-name1) backend))
  234. (should (vc-registered tmp-name1))
  235. (should (file-exists-p tmp-name2))
  236. (should (eq (vc-backend tmp-name2) backend))
  237. (should (eq (vc-responsible-backend tmp-name2) backend))
  238. (should (vc-registered tmp-name2))
  239. ;; `vc-backend' accepts also a list of files,
  240. ;; `vc-responsible-backend' doesn't.
  241. (should (vc-backend (list tmp-name1 tmp-name2)))
  242. ;; Unregister the files.
  243. (unless (eq (vc-test--run-maybe-unsupported-function
  244. 'vc-test--unregister-function backend tmp-name1)
  245. 'vc-not-supported)
  246. (should-not (vc-backend tmp-name1))
  247. (should-not (vc-registered tmp-name1)))
  248. (unless (eq (vc-test--run-maybe-unsupported-function
  249. 'vc-test--unregister-function backend tmp-name2)
  250. 'vc-not-supported)
  251. (should-not (vc-backend tmp-name2))
  252. (should-not (vc-registered tmp-name2)))
  253. ;; The files shall still exist.
  254. (should (file-exists-p tmp-name1))
  255. (should (file-exists-p tmp-name2))))
  256. ;; Save exit.
  257. (ignore-errors (run-hooks 'vc-test--cleanup-hook)))))
  258. (defun vc-test--state (backend)
  259. "Check the different states of a file."
  260. (let ((vc-handled-backends `(,backend))
  261. (default-directory
  262. (file-name-as-directory
  263. (expand-file-name
  264. (make-temp-name "vc-test") temporary-file-directory)))
  265. vc-test--cleanup-hook)
  266. (unwind-protect
  267. (progn
  268. ;; Cleanup.
  269. (add-hook
  270. 'vc-test--cleanup-hook
  271. `(lambda () (delete-directory ,default-directory 'recursive)))
  272. ;; Create empty repository.
  273. (make-directory default-directory)
  274. (vc-test--create-repo-function backend)
  275. (let ((tmp-name (expand-file-name "foo" default-directory)))
  276. ;; Check state of a nonexistent file.
  277. (message "vc-state2 %s" (vc-state tmp-name))
  278. (should (null (vc-state tmp-name)))
  279. ;; Write a new file. Check state.
  280. (write-region "foo" nil tmp-name nil 'nomessage)
  281. (message "vc-state3 %s" (vc-state tmp-name))
  282. (should (null (vc-state tmp-name)))
  283. ;; Register a file. Check state.
  284. (vc-register
  285. (list backend (list (file-name-nondirectory tmp-name))))
  286. ;; FIXME: nil is definitely wrong.
  287. ;; nil: SRC
  288. ;; added: Bzr CVS Git Hg Mtn SVN
  289. ;; up-to-date: RCS SCCS
  290. (message "vc-state4 %s" (vc-state tmp-name))
  291. (should (memq (vc-state tmp-name) '(nil added up-to-date)))
  292. ;; Unregister the file. Check state.
  293. (if (eq (vc-test--run-maybe-unsupported-function
  294. 'vc-test--unregister-function backend tmp-name)
  295. 'vc-not-supported)
  296. (message "vc-state5 unsupported")
  297. ;; nil: Bzr Git Hg RCS
  298. ;; unsupported: CVS Mtn SCCS SRC SVN
  299. (message "vc-state5 %s" (vc-state tmp-name))
  300. (should (null (vc-state tmp-name))))))
  301. ;; Save exit.
  302. (ignore-errors (run-hooks 'vc-test--cleanup-hook)))))
  303. (defun vc-test--working-revision (backend)
  304. "Check the working revision of a repository."
  305. (let ((vc-handled-backends `(,backend))
  306. (default-directory
  307. (file-name-as-directory
  308. (expand-file-name
  309. (make-temp-name "vc-test") temporary-file-directory)))
  310. vc-test--cleanup-hook)
  311. (unwind-protect
  312. (progn
  313. ;; Cleanup.
  314. (add-hook
  315. 'vc-test--cleanup-hook
  316. `(lambda () (delete-directory ,default-directory 'recursive)))
  317. ;; Create empty repository. Check working revision of
  318. ;; repository, should be nil.
  319. (make-directory default-directory)
  320. (vc-test--create-repo-function backend)
  321. ;; FIXME: Is the value for SVN correct?
  322. ;; nil: Bzr CVS Git Hg Mtn RCS SCCS SRC
  323. ;; "0": SVN
  324. (message
  325. "vc-working-revision1 %s" (vc-working-revision default-directory))
  326. (should (member (vc-working-revision default-directory) '(nil "0")))
  327. (let ((tmp-name (expand-file-name "foo" default-directory)))
  328. ;; Check initial working revision, should be nil until
  329. ;; it's registered.
  330. (message "vc-working-revision2 %s" (vc-working-revision tmp-name))
  331. (should-not (vc-working-revision tmp-name))
  332. ;; Write a new file. Check working revision.
  333. (write-region "foo" nil tmp-name nil 'nomessage)
  334. (message "vc-working-revision3 %s" (vc-working-revision tmp-name))
  335. (should-not (vc-working-revision tmp-name))
  336. ;; Register a file. Check working revision.
  337. (vc-register
  338. (list backend (list (file-name-nondirectory tmp-name))))
  339. ;; XXX: nil is fine, at least in Git's case, because
  340. ;; `vc-register' only makes the file `added' in this case.
  341. ;; nil: Git Mtn
  342. ;; "0": Bzr CVS Hg SRC SVN
  343. ;; "1.1": RCS SCCS
  344. (message "vc-working-revision4 %s" (vc-working-revision tmp-name))
  345. (should (member (vc-working-revision tmp-name) '(nil "0" "1.1")))
  346. ;; TODO: Call `vc-checkin', and check the resulting
  347. ;; working revision. None of the return values should be
  348. ;; nil then.
  349. ;; Unregister the file. Check working revision.
  350. (if (eq (vc-test--run-maybe-unsupported-function
  351. 'vc-test--unregister-function backend tmp-name)
  352. 'vc-not-supported)
  353. (message "vc-working-revision5 unsupported")
  354. ;; nil: Bzr Git Hg RCS
  355. ;; unsupported: CVS Mtn SCCS SRC SVN
  356. (message "vc-working-revision5 %s" (vc-working-revision tmp-name))
  357. (should-not (vc-working-revision tmp-name)))))
  358. ;; Save exit.
  359. (ignore-errors (run-hooks 'vc-test--cleanup-hook)))))
  360. (defun vc-test--checkout-model (backend)
  361. "Check the checkout model of a repository."
  362. (let ((vc-handled-backends `(,backend))
  363. (default-directory
  364. (file-name-as-directory
  365. (expand-file-name
  366. (make-temp-name "vc-test") temporary-file-directory)))
  367. vc-test--cleanup-hook)
  368. (unwind-protect
  369. (progn
  370. ;; Cleanup.
  371. (add-hook
  372. 'vc-test--cleanup-hook
  373. `(lambda () (delete-directory ,default-directory 'recursive)))
  374. ;; Create empty repository. Check repository checkout model.
  375. (make-directory default-directory)
  376. (vc-test--create-repo-function backend)
  377. ;; Surprisingly, none of the backends returns 'announce.
  378. ;; implicit: Bzr CVS Git Hg Mtn SRC SVN
  379. ;; locking: RCS SCCS
  380. (message
  381. "vc-checkout-model1 %s"
  382. (vc-checkout-model backend default-directory))
  383. (should (memq (vc-checkout-model backend default-directory)
  384. '(announce implicit locking)))
  385. (let ((tmp-name (expand-file-name "foo" default-directory)))
  386. ;; Check checkout model of a nonexistent file.
  387. ;; implicit: Bzr CVS Git Hg Mtn SRC SVN
  388. ;; locking: RCS SCCS
  389. (message
  390. "vc-checkout-model2 %s" (vc-checkout-model backend tmp-name))
  391. (should (memq (vc-checkout-model backend tmp-name)
  392. '(announce implicit locking)))
  393. ;; Write a new file. Check checkout model.
  394. (write-region "foo" nil tmp-name nil 'nomessage)
  395. ;; implicit: Bzr CVS Git Hg Mtn SRC SVN
  396. ;; locking: RCS SCCS
  397. (message
  398. "vc-checkout-model3 %s" (vc-checkout-model backend tmp-name))
  399. (should (memq (vc-checkout-model backend tmp-name)
  400. '(announce implicit locking)))
  401. ;; Register a file. Check checkout model.
  402. (vc-register
  403. (list backend (list (file-name-nondirectory tmp-name))))
  404. ;; implicit: Bzr CVS Git Hg Mtn SRC SVN
  405. ;; locking: RCS SCCS
  406. (message
  407. "vc-checkout-model4 %s" (vc-checkout-model backend tmp-name))
  408. (should (memq (vc-checkout-model backend tmp-name)
  409. '(announce implicit locking)))
  410. ;; Unregister the file. Check checkout model.
  411. (if (eq (vc-test--run-maybe-unsupported-function
  412. 'vc-test--unregister-function backend tmp-name)
  413. 'vc-not-supported)
  414. (message "vc-checkout-model5 unsupported")
  415. ;; implicit: Bzr Git Hg
  416. ;; locking: RCS
  417. ;; unsupported: CVS Mtn SCCS SRC SVN
  418. (message
  419. "vc-checkout-model5 %s" (vc-checkout-model backend tmp-name))
  420. (should (memq (vc-checkout-model backend tmp-name)
  421. '(announce implicit locking))))))
  422. ;; Save exit.
  423. (ignore-errors (run-hooks 'vc-test--cleanup-hook)))))
  424. ;; Create the test cases.
  425. (defun vc-test--rcs-enabled ()
  426. (executable-find "rcs"))
  427. (defun vc-test--cvs-enabled ()
  428. (executable-find "cvs"))
  429. (defvar vc-svn-program)
  430. (defun vc-test--svn-enabled ()
  431. (executable-find vc-svn-program))
  432. (defun vc-test--sccs-enabled ()
  433. (executable-find "sccs"))
  434. (defvar vc-src-program)
  435. (defun vc-test--src-enabled ()
  436. (executable-find vc-src-program))
  437. (defvar vc-bzr-program)
  438. (defun vc-test--bzr-enabled ()
  439. (executable-find vc-bzr-program))
  440. (defvar vc-git-program)
  441. (defun vc-test--git-enabled ()
  442. (executable-find vc-git-program))
  443. (defvar vc-hg-program)
  444. (defun vc-test--hg-enabled ()
  445. (executable-find vc-hg-program))
  446. (defvar vc-mtn-program)
  447. (defun vc-test--mtn-enabled ()
  448. (executable-find vc-mtn-program))
  449. ;; Obsoleted.
  450. (defvar vc-arch-program)
  451. (defun vc-test--arch-enabled ()
  452. (executable-find vc-arch-program))
  453. ;; Create the test cases.
  454. (dolist (backend vc-handled-backends)
  455. (let ((backend-string (downcase (symbol-name backend))))
  456. (require (intern (format "vc-%s" backend-string)))
  457. (eval
  458. ;; Check, whether the backend is supported.
  459. `(when (funcall ',(intern (format "vc-test--%s-enabled" backend-string)))
  460. (ert-deftest
  461. ,(intern (format "vc-test-%s00-create-repo" backend-string)) ()
  462. ,(format "Check `vc-create-repo' for the %s backend."
  463. backend-string)
  464. (vc-test--create-repo ',backend))
  465. (ert-deftest
  466. ,(intern (format "vc-test-%s01-register" backend-string)) ()
  467. ,(format
  468. "Check `vc-register' and `vc-registered' for the %s backend."
  469. backend-string)
  470. (skip-unless
  471. (ert-test-passed-p
  472. (ert-test-most-recent-result
  473. (ert-get-test
  474. ',(intern
  475. (format "vc-test-%s00-create-repo" backend-string))))))
  476. (vc-test--register ',backend))
  477. (ert-deftest
  478. ,(intern (format "vc-test-%s02-state" backend-string)) ()
  479. ,(format "Check `vc-state' for the %s backend." backend-string)
  480. (skip-unless
  481. (ert-test-passed-p
  482. (ert-test-most-recent-result
  483. (ert-get-test
  484. ',(intern
  485. (format "vc-test-%s01-register" backend-string))))))
  486. (vc-test--state ',backend))
  487. (ert-deftest
  488. ,(intern (format "vc-test-%s03-working-revision" backend-string)) ()
  489. ,(format "Check `vc-working-revision' for the %s backend."
  490. backend-string)
  491. (skip-unless
  492. (ert-test-passed-p
  493. (ert-test-most-recent-result
  494. (ert-get-test
  495. ',(intern
  496. (format "vc-test-%s01-register" backend-string))))))
  497. (vc-test--working-revision ',backend))
  498. (ert-deftest
  499. ,(intern (format "vc-test-%s04-checkout-model" backend-string)) ()
  500. ,(format "Check `vc-checkout-model' for the %s backend."
  501. backend-string)
  502. (skip-unless
  503. (ert-test-passed-p
  504. (ert-test-most-recent-result
  505. (ert-get-test
  506. ',(intern
  507. (format "vc-test-%s01-register" backend-string))))))
  508. (vc-test--checkout-model ',backend))))))
  509. (provide 'vc-tests)
  510. ;;; vc-tests.el ends here