forked from clojure-emacs/cider
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Eldev
51 lines (42 loc) · 2.17 KB
/
Eldev
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
; -*- mode: emacs-lisp; lexical-binding: t; no-byte-compile: t -*-
(eldev-require-version "0.6")
(eldev-use-package-archive 'gnu)
;; For compatibility; e.g. with MELPA Stable one test fails.
(eldev-use-package-archive 'melpa-unstable)
(eldev-use-plugin 'autoloads)
(eldev-add-loading-roots 'test "test/utils")
(defvar cider-test-type 'main)
(setf eldev-standard-excludes `(:or ,eldev-standard-excludes
;; Avoid including files in test "projects".
(eldev-pcase-exhaustive cider-test-type
(`main "./test/*/")
(`integration '("./test/" "!./test/integration"))
(`all '("./test/*/" "!./test/integration")))
"test/integration/projects"
;; This file is _supposed_ to be excluded
;; from automated testing.
"test/cider-tests--no-auto.el"))
(eldev-defoption cider-test-selection (type)
"Select tests to run; type can be `main', `integration' or `all'"
:options (-T --test-type)
:for-command test
:value TYPE
:default-value cider-test-type
(unless (memq (intern type) '(main integration all))
(signal 'eldev-wrong-option-usage `("unknown test type `%s'" ,type)))
(setf cider-test-type (intern type)))
(add-hook 'eldev-test-hook
(lambda ()
(eldev-verbose "Using cider tests of type `%s'" cider-test-type)))
(add-hook 'eldev-executing-command-hook
(lambda (command)
(unless (eq command 'test)
;; So that e.g. byte-compilation works on all tests.
(setf cider-test-type 'all))))
;; CIDER cannot be compiled otherwise.
(setf eldev-build-load-before-byte-compiling t)
(setf eldev-lint-default '(elisp))
(with-eval-after-load 'elisp-lint
;; We will byte-compile with Eldev.
(setf elisp-lint-ignored-validators '("package-lint" "fill-column" "byte-compile")
enable-local-variables :safe))