commit | author | age
|
5cb5f7
|
1 |
;ELC |
C |
2 |
;;; Compiled |
|
3 |
;;; in Emacs version 26.1 |
|
4 |
;;; with all optimizations. |
|
5 |
|
|
6 |
;;; This file uses dynamic docstrings, first added in Emacs 19.29. |
|
7 |
|
|
8 |
;;; This file does not contain utf-8 non-ASCII characters, |
|
9 |
;;; and so can be loaded in Emacs versions earlier than 23. |
|
10 |
|
|
11 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
|
12 |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
|
13 |
|
|
14 |
|
|
15 |
(byte-code "\300\301!\210\300\302!\210\300\303!\207" [require flycheck ert macroexp] 2) |
|
16 |
#@37 Whether ERT supports test skipping. |
|
17 |
(defconst flycheck-ert-ert-can-skip (fboundp 'ert-skip) (#$ . 496)) |
|
18 |
(byte-code "\301\302!\204 \303\302\304\"\210\204% \302\305\306\"\210\303\307\310\"\210\303\311\312\313B\"\210\303\314\315\"\210\301\207" [flycheck-ert-ert-can-skip fboundp define-error defalias #[770 "\211\204 \300\262\211:\203 \301\302\303\304\"\"\202 \211\305NB\306\305\307\310B!!#\210\2052 \306\311#\207" [error apply append mapcar #[257 "\211\300N\206 \301\302\"B\207" [error-conditions error "Unknown signal `%s'"] 5 "\n\n(fn PARENT)"] error-conditions put delete-dups copy-sequence error-message] 11 "Define NAME as a new error signal.\nMESSAGE is a string that will be output to the echo area if such an error\nis signaled without being caught by a `condition-case'.\nPARENT is either a signal or a list of signals from which it inherits.\nDefaults to `error'.\n\n(fn NAME MESSAGE &optional PARENT)"] flycheck-ert-skipped "Test skipped" ert-skip #[257 "\300\301\"\207" [signal flycheck-ert-skipped] 4 "\n\n(fn DATA)"] skip-unless macro #[257 "\300\301D\302\303\304DEE\207" [unless ignore-errors signal 'flycheck-ert-skipped quote] 7 "\n\n(fn FORM)"] ert-test-skipped-p #[257 "\301!>\205 \301!>\204 \302\303\304D\"\210\211\305H@\306=\207" [cl-struct-ert-test-failed-tags type-of signal wrong-type-argument ert-test-failed 3 flycheck-ert-skipped] 5 "\n\n(fn RESULT)"]] 4) |
|
19 |
#@57 The directory to get resources from in this test suite. |
|
20 |
(defvar flycheck-ert--resource-directory nil (#$ . 1912)) |
|
21 |
#@226 Eval BODY within a temporary buffer. |
|
22 |
|
|
23 |
Like `with-temp-buffer', but resets the modification state of the |
|
24 |
temporary buffer to make sure that it is properly killed even if |
|
25 |
it has a backing file and is modified. |
|
26 |
|
|
27 |
(fn &rest BODY) |
|
28 |
(defalias 'flycheck-ert-with-temp-buffer '(macro . #[128 "\300\301\302!\303BBD\207" [with-temp-buffer unwind-protect macroexp-progn ((set-buffer-modified-p nil) (set-visited-file-name nil 'no-query))] 5 (#$ . 2033)])) |
|
29 |
(byte-code "\300\301\302\303#\300\207" [function-put flycheck-ert-with-temp-buffer lisp-indent-function 0] 4) |
|
30 |
#@159 Create a buffer from FILE-NAME and eval BODY. |
|
31 |
|
|
32 |
BODY is evaluated with `current-buffer' being a buffer with the |
|
33 |
contents FILE-NAME. |
|
34 |
|
|
35 |
(fn FILE-NAME &rest BODY) |
|
36 |
(defalias 'flycheck-ert-with-file-buffer '(macro . #[385 "\300\301DC\302\303\304\305\306\307BBBBBF\207" [let file-name (unless (file-exists-p file-name) (error "%s does not exist" file-name)) flycheck-ert-with-temp-buffer (insert-file-contents file-name 'visit) (set-visited-file-name file-name 'no-query) (cd (file-name-directory file-name)) (set-buffer-modified-p nil)] 11 (#$ . 2594)])) |
|
37 |
(byte-code "\300\301\302\303#\300\207" [function-put flycheck-ert-with-file-buffer lisp-indent-function 1] 4) |
|
38 |
#@129 Execute BODY and kill the help buffer afterwards. |
|
39 |
|
|
40 |
Use this macro to test functions that create a Help buffer. |
|
41 |
|
|
42 |
(fn &rest BODY) |
|
43 |
(defalias 'flycheck-ert-with-help-buffer '(macro . #[128 "\300\301!\302BB\207" [unwind-protect macroexp-progn ((when (buffer-live-p (get-buffer (help-buffer))) (kill-buffer (help-buffer))))] 4 (#$ . 3262)])) |
|
44 |
(byte-code "\300\301\302\303#\300\207" [function-put flycheck-ert-with-help-buffer lisp-indent-function 0] 4) |
|
45 |
#@126 Execute BODY with Global Flycheck Mode enabled. |
|
46 |
|
|
47 |
After BODY, restore the old state of Global Flycheck Mode. |
|
48 |
|
|
49 |
(fn &rest BODY) |
|
50 |
(defalias 'flycheck-ert-with-global-mode '(macro . #[128 "\300\301\302\303\304BB\305BBE\207" [let ((old-state global-flycheck-mode)) unwind-protect progn (global-flycheck-mode 1) ((global-flycheck-mode (if old-state 1 -1)))] 7 (#$ . 3716)])) |
|
51 |
(byte-code "\300\301\302\303#\300\207" [function-put flycheck-ert-with-global-mode lisp-indent-function 0] 4) |
|
52 |
#@286 Add ENV to `process-environment' in BODY. |
|
53 |
|
|
54 |
Execute BODY with a `process-environment' which contains all |
|
55 |
variables from ENV added. |
|
56 |
|
|
57 |
ENV is an alist, where each cons cell `(VAR . VALUE)' is a |
|
58 |
environment variable VAR to be added to `process-environment' |
|
59 |
with VALUE. |
|
60 |
|
|
61 |
(fn ENV &rest BODY) |
|
62 |
(defalias 'flycheck-ert-with-env '(macro . #[385 "\300\301\302\303D\304BBBBB\207" [let ((process-environment (copy-sequence process-environment))) pcase-dolist `(,var \, value) ((setenv var value))] 7 (#$ . 4201)])) |
|
63 |
(byte-code "\300\301\302\303#\300\207" [function-put flycheck-ert-with-env lisp-indent-function 1] 4) |
|
64 |
#@152 Determine the absolute file name of a RESOURCE-FILE. |
|
65 |
|
|
66 |
Relative file names are expanded against |
|
67 |
`flycheck-ert--resource-directory'. |
|
68 |
|
|
69 |
(fn RESOURCE-FILE) |
|
70 |
(defalias 'flycheck-ert-resource-filename #[257 "\301\"\207" [flycheck-ert--resource-directory expand-file-name] 4 (#$ . 4813)]) |
|
71 |
#@186 Create a temp buffer from a RESOURCE-FILE and execute BODY. |
|
72 |
|
|
73 |
The absolute file name of RESOURCE-FILE is determined with |
|
74 |
`flycheck-ert-resource-filename'. |
|
75 |
|
|
76 |
(fn RESOURCE-FILE &rest BODY) |
|
77 |
(defalias 'flycheck-ert-with-resource-buffer '(macro . #[385 "\300\301DBB\207" [flycheck-ert-with-file-buffer flycheck-ert-resource-filename] 5 (#$ . 5102)])) |
|
78 |
(byte-code "\300\301\302\303#\300\207" [function-put flycheck-ert-with-resource-buffer lisp-indent-function 1] 4) |
|
79 |
#@165 Initialize a test suite with RESOURCE-DIR. |
|
80 |
|
|
81 |
RESOURCE-DIR is the directory, `flycheck-ert-resource-filename' |
|
82 |
should use to lookup resource files. |
|
83 |
|
|
84 |
(fn RESOURCE-DIR) |
|
85 |
(defalias 'flycheck-ert-initialize #[257 "\203 \303\304!\210\305\306\211\"\211\204 \303\307!\210 ?\205W \211\211\205U \211@\310!\n>\2041 \311\312\313D\"\210\211\314H\310!\n>\204C \311\312\313D\"\210\211\314\315\316BBI\266A\266\202\202 \262\207" [flycheck-ert--resource-directory flycheck-ert-ert-can-skip cl-struct-ert-test-tags error "Test suite already initialized" ert-select-tests t "No tests defined. Call `flycheck-ert-initialize' after defining all tests!" type-of signal wrong-type-argument ert-test 5 or ((satisfies ert-test-skipped-p))] 11 (#$ . 5569)]) |
|
86 |
#@963 Define a test case for a syntax CHECKER for LANGUAGE. |
|
87 |
|
|
88 |
CHECKER is a symbol or a list of symbols denoting syntax checkers |
|
89 |
being tested by the test. The test case is skipped, if any of |
|
90 |
these checkers cannot be used. LANGUAGE is a symbol or a list of |
|
91 |
symbols denoting the programming languages supported by the |
|
92 |
syntax checkers. This is currently only used for tagging the |
|
93 |
test appropriately. |
|
94 |
|
|
95 |
NAME is a symbol denoting the local name of the test. The test |
|
96 |
itself is ultimately named |
|
97 |
`flycheck-define-checker/CHECKER/NAME'. If CHECKER is a list, |
|
98 |
the first checker in the list is used for naming the test. |
|
99 |
|
|
100 |
Optionally, the keyword arguments `:tags' and `:expected-result' |
|
101 |
may be given. They have the same meaning as in `ert-deftest.', |
|
102 |
and are added to the tags and result expectations set up by this |
|
103 |
macro. |
|
104 |
|
|
105 |
The remaining forms KEYS-AND-BODY denote the body of the test |
|
106 |
case, including assertions and setup code. |
|
107 |
|
|
108 |
(fn CHECKER LANGUAGE NAME &rest KEYS-AND-BODY) |
|
109 |
(defalias 'flycheck-ert-def-checker-test '(macro . #[899 "\204 \300\301!\210\204 \300\302!\2109\203 C\202 \211@9\203' C\202( \303\304\"\303\305\"\2066 \306\307\310\311#!\312!\211A@@\313\314\315\316\317\316\"\206U \320\321\322\323\322 #D\317\n\321\"E\322\303\324\"\"BBBBBBB\207" [error "No syntax checkers specified" "No languages specified" mapcar #[257 "\300\301\302\"!\207" [intern format "language-%s"] 5 "\n\n(fn L)"] #[257 "\300\301\302\"!\207" [intern format "checker-%s"] 5 "\n\n(fn C)"] default intern format "flycheck-define-checker/%s/%s" ert--parse-keys-and-body (syntax-checker external-tool) ert-deftest nil :expected-result plist-get :passed :tags append quote #[257 "\300\301\302\303\304D\305BBD\306\307\304DDDED\207" [skip-unless or not flycheck-checker-get quote ('command) executable-find flycheck-checker-executable] 8 "\n\n(fn C)"]] 27 (#$ . 6320)])) |
|
110 |
(byte-code "\300\301\302\303#\300\207" [function-put flycheck-ert-def-checker-test lisp-indent-function 3] 4) |
|
111 |
#@93 Whether RESULT denotes a timed-out test. |
|
112 |
|
|
113 |
RESULT is an ERT test result object. |
|
114 |
|
|
115 |
(fn RESULT) |
|
116 |
(defalias 'flycheck-ert-syntax-check-timed-out-p #[257 "\301!>\205 \301!>\204 \302\303\304D\"\210\211\305H@\306=\207" [cl-struct-ert-test-failed-tags type-of signal wrong-type-argument ert-test-failed 3 flycheck-ert-syntax-check-timed-out] 5 (#$ . 8309)]) |
|
117 |
#@46 Non-nil if the current checker has finished. |
|
118 |
(defvar flycheck-ert-syntax-checker-finished nil (#$ . 8670)) |
|
119 |
(byte-code "\300\301!\210\302\303\304\"\207" [make-variable-buffer-local flycheck-ert-syntax-checker-finished add-hook flycheck-after-syntax-check-hook #[0 "\301\211\207" [flycheck-ert-syntax-checker-finished t] 2]] 3) |
|
120 |
#@161 Time to wait until a checker is finished in seconds. |
|
121 |
|
|
122 |
After this time has elapsed, the checker is considered to have |
|
123 |
failed, and the test aborted with failure. |
|
124 |
(defconst flycheck-ert-checker-wait-time 10 (#$ . 9004)) |
|
125 |
(define-error 'flycheck-ert-syntax-check-timed-out "Syntax check timed out.") |
|
126 |
#@64 Wait until the syntax check in the current buffer is finished. |
|
127 |
(defalias 'flycheck-ert-wait-for-syntax-checker #[0 "\302 \204 \302 Z W\203 \303\304!\210\202 \302 Z W\204' \305 \210\306\307\310\"\210\210\310\211\207" [flycheck-ert-syntax-checker-finished flycheck-ert-checker-wait-time float-time sleep-for 1 flycheck-stop signal flycheck-ert-syntax-check-timed-out nil] 4 (#$ . 9305)]) |
|
128 |
#@44 Like `flycheck-buffer', but synchronously. |
e75a20
|
129 |
(defalias 'flycheck-ert-buffer-sync #[0 "\303\304C\3051 \306\307 )C0\202 \310\240\210\211@AD\262\311C\303C\312\313\314\315\316$\317\"\320$\216\321\242\"\240)\204D \322\242!\210\266\323 \210\324 \210\325\326!C\303C\312\313\327\315\316\"\330\"\331$\216\n\206g \240)\204q \322\242!\210\266\332C\3331~ \3030\202\211 \310\240\210\211@AD\262\334C\303C\312\313\314\315\316$\335\"\320$\216\321\242\"\240)\203\260 \322\242!\210\266\336 \207" [flycheck-ert-syntax-checker-finished signal-hook-function flycheck-current-syntax-check nil not (error) ert--should-signal-hook flycheck-running-p signal #1=#:ert-form-evaluation-aborted-155 make-byte-code 0 "\303\304C\305\300\242\301BD\244\306\302\242\307\"?\205 \310\302\242D\244\311\312N\211\205% \313\314\301\"D\262\244\240\210\315\303\242!\207" vconcat vector [(should (not (flycheck-running-p))) :form eql #1# :value not ert-explainer :explanation apply ert--signal-should-execution] 7 apply ert-fail flycheck-mode flycheck-buffer gensym "ert-form-evaluation-aborted-" "\301\302\303\304\305\300\242\257\240\210\306\301\242!\207" [(should #2=(or flycheck-current-syntax-check flycheck-ert-syntax-checker-finished)) :form #2# :value ert--signal-should-execution] 6 flycheck-deferred-check-p (error) #3=#:ert-form-evaluation-aborted-162 [(should-not (flycheck-deferred-check-p)) :form eql #3# :value flycheck-deferred-check-p ert-explainer :explanation apply ert--signal-should-execution] flycheck-ert-wait-for-syntax-checker] 13 (#$ . 9704)]) |
5cb5f7
|
130 |
#@92 Clear the current buffer. |
C |
131 |
|
|
132 |
Raise an assertion error if the buffer is not clear afterwards. |
e75a20
|
133 |
(defalias 'flycheck-ert-ensure-clear #[0 "\302 \210\303C\3041 \305 )C0\202 \306\240\210\211@AD\262\307C\310C\311\312\313\314\315$\316\"\317$\216\320\242\"\240)\204D \321\242!\210\266\303C\3221[ \305\323\324\325ed\"\")C0\202f \306\240\210\211@AD\262\326C\310C\311\312\313\314\315$\327\"\317$\216\320\242\"\240)\204\215 \321\242!\210\210\211\242\262\207" [signal-hook-function flycheck-current-errors flycheck-clear not (error) ert--should-signal-hook signal #1=#:ert-form-evaluation-aborted-167 nil make-byte-code 0 "\303\304C\305\300\242\301BD\244\306\302\242\307\"?\205 \310\302\242D\244\311\312N\211\205% \313\314\301\"D\262\244\240\210\315\303\242!\207" vconcat vector [(should (not flycheck-current-errors)) :form eql #1# :value not ert-explainer :explanation apply ert--signal-should-execution] 7 apply ert-fail (error) -any\? #[257 "\300\301\"\207" [overlay-get flycheck-overlay] 4 "\n\n(fn OV)"] overlays-in #2=#:ert-form-evaluation-aborted-172 [(should (not (-any\? (lambda (ov) (overlay-get ov 'flycheck-overlay)) (overlays-in (point-min) (point-max))))) :form eql #2# :value not ert-explainer :explanation apply ert--signal-should-execution]] 13 (#$ . 11282)]) |
5cb5f7
|
134 |
#@67 Return a copy ERR with the `group' property set to nil. |
C |
135 |
|
|
136 |
(fn ERR) |
|
137 |
(defalias 'flycheck-error-without-group #[257 "\301!\302!>\204 \303\304\305D\"\210\211\211\306\307I\266\211\207" [cl-struct-flycheck-error-tags copy-flycheck-error type-of signal wrong-type-argument flycheck-error 9 nil] 6 (#$ . 12590)]) |
|
138 |
#@108 Test that ERROR has a proper overlay in the current buffer. |
|
139 |
|
|
140 |
ERROR is a Flycheck error object. |
|
141 |
|
|
142 |
(fn ERROR) |
e75a20
|
143 |
(defalias 'flycheck-ert-should-overlay #[257 "\302\303\304\305\306\307!\310\"\311\312%\313\314\315 T\"\"\316!\203' e\212eb\210\317 )B\202+ \320\321\"\322!>\204: \323\324\325D\"\210\326H\327!\211\330N\331!\332!\333E\334\335!C\336C\303\314\337\306\307\"\340\"\341$\216\n\240)\204o \342\242!\210\266\343C\3441\202 \345)\346D0\202\215 \323\240\210\211@AD\262\347C\336C\303\314\350\306\307$\351\"\326$\216\352\242\"\240)\204\264 \342\242!\210\266\353C\3541\313 \345\355 !@)D0\202\326 \323\240\210\211@AD\262\356C\336C\303\314\350\306\307$\357\"\326$\216\352\242\"\240)\204\375 \342\242!\210\266\353C\3601\345\361 !A)D0\202\323\240\210\211@AD\262\362C\336C\303\314\350\306\307$\363\"\326$\216\352\242\"\240)\204F\342\242!\210\266\364C\3651\\\345\343 \330\")D0\202g\323\240\210\211@AD\262\366C\336C\303\314\350\306\307$\367\"\326$\216\352\242\"\240)\204\216\342\242!\210\266\370C\3711\250\345\372\314\373\343\f\374\"#)D0\202\263\323\240\210\211@AD\262\375C\336C\303\314\350\306\307$\376\"\326$\216\352\242\"\240)\204\332\342\242!\210\266\364C\3771\363\345\343 \201@ \")D0\202\376\323\240\210\211@AD\262\201A C\336C\303\314\350\306\307$\201B \"\326$\216\352\242\"\240)\204)\342\242!\210\266\370C\201C 1J\345\201D \343\n\325\"!\201D !)D0\202U\323\240\210\211@AD\262\201E C\336C\303\314\350\306\307$\201F \"\326$\216\352\242\"\240)\204\200\342\242!\210\210\211\242\262\266\202\207" [cl-struct-flycheck-error-tags signal-hook-function -first make-byte-code 257 "\301\302\303\"!\301\300!\232\207" vconcat vector [flycheck-error-without-group overlay-get flycheck-error] 5 "\n\n(fn OV)" flycheck-overlays-in 0 buffer-size flycheck-relevant-error-other-file-p point-at-eol flycheck-error-region-for-mode symbols type-of signal wrong-type-argument flycheck-error 7 flycheck-error-level-overlay-category face flycheck-error-level-fringe-bitmap flycheck-error-level-fringe-face left-fringe gensym "ert-form-evaluation-aborted-" nil "\301\302\303\304\305\300\242\257\240\210\306\301\242!\207" [(should overlay) :form overlay :value ert--signal-should-execution] 6 ert-fail overlay-get (error) ert--should-signal-hook flycheck-overlay #1=#:ert-form-evaluation-aborted-179 "\303\304C\305\300\242\301BD\244\306\302\242\307\"?\205 \310\302\242D\244\311\312N\211\205% \313\314\301\"D\262\244\240\210\315\303\242!\207" [(should (overlay-get overlay 'flycheck-overlay)) :form eql #1# :value overlay-get ert-explainer :explanation apply ert--signal-should-execution] apply = (error) overlay-start #2=#:ert-form-evaluation-aborted-184 [(should (= (overlay-start overlay) (car region))) :form eql #2# :value = ert-explainer :explanation apply ert--signal-should-execution] (error) overlay-end #3=#:ert-form-evaluation-aborted-189 [(should (= (overlay-end overlay) (cdr region))) :form eql #3# :value = ert-explainer :explanation apply ert--signal-should-execution] eq (error) #4=#:ert-form-evaluation-aborted-194 [(should (eq (overlay-get overlay 'face) face)) :form eql #4# :value eq ert-explainer :explanation apply ert--signal-should-execution] equal (error) get-char-property display before-string #5=#:ert-form-evaluation-aborted-199 [(should (equal (get-char-property 0 'display (overlay-get overlay 'before-string)) fringe-icon)) :form eql #5# :value equal ert-explainer :explanation apply ert--signal-should-execution] (error) category #6=#:ert-form-evaluation-aborted-204 [(should (eq (overlay-get overlay 'category) category)) :form eql #6# :value eq ert-explainer :explanation apply ert--signal-should-execution] (error) flycheck-error-without-group #7=#:ert-form-evaluation-aborted-209 [(should (equal (flycheck-error-without-group (overlay-get overlay 'flycheck-error)) (flycheck-error-without-group error))) :form eql #7# :value equal ert-explainer :explanation apply ert--signal-should-execution]] 22 (#$ . 12907)]) |
5cb5f7
|
144 |
#@539 Test that the current buffers has ERRORS. |
C |
145 |
|
|
146 |
ERRORS is a list of errors expected to be present in the current |
|
147 |
buffer. Each error is given as a list of arguments to |
|
148 |
`flycheck-error-new-at'. |
|
149 |
|
|
150 |
If ERRORS are omitted, test that there are no errors at all in |
|
151 |
the current buffer. |
|
152 |
|
|
153 |
With ERRORS, test that each error in ERRORS is present in the |
|
154 |
current buffer, and that the number of errors in the current |
|
155 |
buffer is equal to the number of given ERRORS. In other words, |
|
156 |
check that the buffer has all ERRORS, and no other errors. |
|
157 |
|
|
158 |
(fn &rest ERRORS) |
e75a20
|
159 |
(defalias 'flycheck-ert-should-errors #[128 "\302\303\304\305\"\"\306C\3071 \310\302\311\"\302\311 \")D0\202( \312\240\210\211@AD\262\313C\314C\315\316\317\320\321$\322\"\323$\216\304\242\"\240)\204O \324\242!\210\266\325\315\326\327\320\321!\330\"\331\332% #\210\333\334\"\266\335C\3361~ \310G\337ed\"G)D0\202\211 \312\240\210\211@AD\262\340C\314C\315\316\317\320\321$\341\"\323$\216\304\242\"\240)\204\260 \324\242!\210\210\211\242\262\207" [signal-hook-function flycheck-current-errors mapcar apply-partially apply flycheck-error-new-at equal (error) ert--should-signal-hook flycheck-error-without-group signal #1=#:ert-form-evaluation-aborted-214 nil make-byte-code 0 "\303\304C\305\300\242\301BD\244\306\302\242\307\"?\205 \310\302\242D\244\311\312N\211\205% \313\314\301\"D\262\244\240\210\315\303\242!\207" vconcat vector [(should (equal (mapcar #'flycheck-error-without-group expected) (mapcar #'flycheck-error-without-group flycheck-current-errors))) :form eql #1# :value equal ert-explainer :explanation apply ert--signal-should-execution] 7 ert-fail cl-mapcar 514 "\302C\3031 \304\305\306\307\300\"\"\305\306\307!\")D0\202& |