Skip to content

Commit e4b1f08

Browse files
committed
WIP - run tests against clojure-ts-mode
Includes top level "main" tests, plus an additional clojure-ts-mode-test. When the clojure-ts-mode one is pulled in clojure-ts-mode should then be "required" and all calls to clojure-mode should redirect to clojure-ts-mode via major-mode-remap-alist.
1 parent ecabc30 commit e4b1f08

File tree

3 files changed

+39
-7
lines changed

3 files changed

+39
-7
lines changed

.github/workflows/test.yml

+5
Original file line numberDiff line numberDiff line change
@@ -82,3 +82,8 @@ jobs:
8282
# be GH connectivity runner issues. We attempt to address this
8383
# problem by rerunning the tests more than once.
8484
eldev -p -dtTC test --test-type integration || eldev -p -dtTC test --test-type integration
85+
86+
- name: Test clojure-ts-mode integration
87+
if: startsWith (matrix.emacs_version, '29')
88+
run: |
89+
eldev -p -dtTC test --test-type clojure-ts-mode || eldev -p -dtTC test --test-type clojure-ts-mode

Eldev

+18-7
Original file line numberDiff line numberDiff line change
@@ -10,33 +10,44 @@
1010

1111
(eldev-add-loading-roots 'test "test/utils")
1212
(eldev-add-extra-dependencies 'runtime '(:package logview :optional t))
13-
(eldev-add-extra-dependencies 'runtime '(:package clojure-ts-mode :optional t))
1413

1514
(defvar cider-test-type 'main)
1615
(setf eldev-standard-excludes `(:or ,eldev-standard-excludes
1716
;; Avoid including files in test "projects".
1817
(eldev-pcase-exhaustive cider-test-type
19-
(`main "./test/*/")
20-
(`integration '("./test/" "!./test/integration"))
21-
(`all '("./test/*/" "!./test/integration")))
18+
(`main "./test/*/")
19+
(`integration '("./test/" "!./test/integration"))
20+
(`clojure-ts-mode '("./test/*/" "!./test/clojure-ts-mode"))
21+
(`all '("./test/*/" "!./test/integration")))
2222
"test/integration/projects"
2323
;; This file is _supposed_ to be excluded
2424
;; from automated testing.
2525
"test/cider-tests--no-auto.el"))
2626

2727
(eldev-defoption cider-test-selection (type)
28-
"Select tests to run; type can be `main', `integration' or `all'"
28+
"Select tests to run; type can be `main', `integration', `clojure-ts-mode' or `all'"
2929
:options (-T --test-type)
3030
:for-command test
3131
:value TYPE
3232
:default-value cider-test-type
33-
(unless (memq (intern type) '(main integration all))
33+
(unless (memq (intern type) '(main integration clojure-ts-mode all))
3434
(signal 'eldev-wrong-option-usage `("unknown test type `%s'" ,type)))
3535
(setf cider-test-type (intern type)))
3636

37+
(defun use-clojure-ts-mode ()
38+
"Set clojure-ts-mode as a eldev dependency.
39+
Only require it when running `clojure-ts-mode' test type,
40+
otherwise during regular test runs all calls to clojure-mode would be
41+
redirected to execute clojure-ts-mode thanks to entries it adds in the
42+
`major-mode-remap-alist'."
43+
(let ((need-clojure-ts-mode (eq cider-test-type 'clojure-ts-mode)))
44+
(eldev-add-extra-dependencies
45+
'runtime '(:package clojure-ts-mode :optional (not need-clojure-ts-mode)))))
46+
3747
(add-hook 'eldev-test-hook
3848
(lambda ()
39-
(eldev-verbose "Using cider tests of type `%s'" cider-test-type)))
49+
(eldev-verbose "Using cider tests of type `%s'" cider-test-type)
50+
(use-clojure-ts-mode)))
4051
(add-hook 'eldev-executing-command-hook
4152
(lambda (command)
4253
(unless (eq command 'test)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
;;; Commentary:
2+
3+
;; This file is part of CIDER
4+
5+
;;; Code:
6+
7+
(require 'buttercup)
8+
(require 'clojure-ts-mode)
9+
10+
(describe "clojure-ts-mode"
11+
(it "passes"
12+
(expect (= 1 1))))
13+
14+
(provide 'clojure-ts-mode-tests)
15+
16+
;;; clojure-ts-mode-tests.el ends here

0 commit comments

Comments
 (0)