;ELC ;;; Compiled ;;; in Emacs version 28.0.50 ;;; with all optimizations. (require 'erlang) #@153 *Name of directories which to search for source files matching an EUnit test file. The first directory in the list will be used, if there is no match. (defvar erlang-eunit-src-candidate-dirs '("../src" ".") (#$ . -106)) #@152 *Name of directories which to search for EUnit test files matching a source file. The first directory in the list will be used, if there is no match. (defvar erlang-eunit-test-candidate-dirs '("../test" ".") (#$ . -334)) #@151 *Set to non-nil to automtically save unsaved buffers before running tests. This is useful, reducing the save-compile-load-test cycle to one keychord. (defvar erlang-eunit-autosave nil (#$ . -563)) #@69 Info about the most recent running of an EUnit test representation. (defvar erlang-eunit-recent-info '((mode) (module) (test) (cover)) (#$ . 766)) #@39 *Patterns for matching Erlang errors. (defvar erlang-error-regexp-alist '(("^\\([^:( \n]+\\)[:(][ ]*\\([0-9]+\\)[:) ]" 1 2)) (#$ . -919)) #@84 Switch to the src file if the EUnit test file is the current buffer and vice versa (defalias 'erlang-eunit-toggle-src-and-test-file-other-window #[nil "\301!\203\n\302!\207\303!\207" [buffer-file-name erlang-eunit-test-file-p erlang-eunit-open-src-file-other-window erlang-eunit-open-test-file-other-window] 2 (#$ . 1066) nil]) #@58 Open the EUnit test file which corresponds to a src file (defalias 'erlang-eunit-open-test-file-other-window #[(src-file-path) "\301\302!!\207" [src-file-path find-file-other-window erlang-eunit-test-filename] 3 (#$ . 1404)]) #@63 Open the src file which corresponds to the an EUnit test file (defalias 'erlang-eunit-open-src-file-other-window #[(test-file-path) "\301\302!!\207" [test-file-path find-file-other-window erlang-eunit-src-filename] 3 (#$ . 1637)]) (defalias 'erlang-eunit-test-filename #[(file-path) "\302!\203\207\303 \"\207" [file-path erlang-eunit-test-candidate-dirs erlang-eunit-test-file-p erlang-eunit-rewrite-filename] 3]) (defalias 'erlang-eunit-src-filename #[(file-path) "\302!\203\207\303 \"\207" [file-path erlang-eunit-src-candidate-dirs erlang-eunit-src-file-p erlang-eunit-rewrite-filename] 3]) (defalias 'erlang-eunit-rewrite-filename #[(orig-file-path candidate-dirs) "\302 \"\206\f\303 @\"\207" [orig-file-path candidate-dirs erlang-eunit-locate-buddy erlang-eunit-buddy-file-path] 3]) (defalias 'erlang-eunit-locate-buddy #[(orig-file-path candidate-dirs) "\205\303 @\"\304\n!\203\n\202\305 A\")\207" [candidate-dirs orig-file-path buddy-file-path erlang-eunit-buddy-file-path file-readable-p erlang-eunit-locate-buddy] 3]) (defalias 'erlang-eunit-buddy-file-path #[(orig-file-path buddy-dir-name) "\304!\305\306 \n\"!\307!\306\n \"+\207" [orig-file-path orig-dir-name buddy-dir-name buddy-base-name file-name-directory file-truename filename-join erlang-eunit-buddy-basename] 4]) (defalias 'erlang-eunit-buddy-basename #[(file-path) "\302!\303!\203 \304P\202\305!\205 \306P)\207" [file-path src-module-name erlang-eunit-source-module-name erlang-eunit-src-file-p "_tests.erl" erlang-eunit-test-file-p ".erl"] 2]) (defalias 'erlang-eunit-src-file-p #[(file-path) "\301!?\207" [file-path erlang-eunit-test-file-p] 2]) (defalias 'erlang-eunit-test-file-p #[(file-path) "\301\302\"\207" [file-path erlang-eunit-string-match-p "^\\(.+\\)_tests.erl$"] 3]) (defalias 'erlang-eunit-source-module-name #[(file-path) "\302!\303\304 \"\203 \305\224\305\225O\202 )\207" [file-path module-name erlang-eunit-module-name string-match "^\\(.+\\)_tests$" 1] 3 nil nil]) (defalias 'erlang-eunit-module-name #[(file-path) "\301\302!!\207" [file-path file-name-sans-extension file-name-nondirectory] 3 nil nil]) (defalias 'erlang-eunit-string-match-p #[(regexp string &optional start) "\305\306!\203 \n\307\310#)\207\311 \312\216\310 \n#*\207" [regexp string start inhibit-changing-match-data save-match-data-internal fboundp string-match-p t string-match match-data #[nil "\301\302\"\207" [save-match-data-internal set-match-data evaporate] 3]] 7]) (defalias 'filename-join #[(dir file) "\302\234\303U\204\304\305 \306\"!@\303U\203 P\207 \307Q\207" [file dir 0 47 last append nil "/"] 4]) (defalias 'erlang-eunit-recent #[(key) " \236A\207" [key erlang-eunit-recent-info] 2]) (defalias 'erlang-eunit-record-recent #[(mode module test) "\301\236 \241\210\302\236\n\241\210\303\236 \241\207" [erlang-eunit-recent-info mode module test] 2]) (defalias 'erlang-eunit-record-recent-compile #[(under-cover) "\302\236 \241\207" [erlang-eunit-recent-info under-cover cover] 2]) (defalias 'erlang-eunit-opts #[nil "\203\301\207\302\207" [current-prefix-arg ", [verbose]" ""] 1]) (defalias 'erlang-eunit-current-test #[nil "\212\300\301!\210\302\301!\210\303 )\207" [erlang-end-of-function 1 erlang-beginning-of-function erlang-name-of-function] 2]) (defalias 'erlang-eunit-simple-test-p #[(test-name) "\301\302\"\205\303\207" [test-name erlang-eunit-string-match-p "^\\(.+\\)_test$" t] 3]) (defalias 'erlang-eunit-test-generator-p #[(test-name) "\301\302\"\205\303\207" [test-name erlang-eunit-string-match-p "^\\(.+\\)_test_$" t] 3]) (defalias 'erlang-eunit-run-test #[(module-name test-name) "\303!\203\304\305 \306 $\202$\307!\203 \304\310 \306 $\202$\304\311\"\312\313 #\210\314\n!)\207" [test-name module-name command erlang-eunit-simple-test-p format "eunit:test({%s, %s}%s)." erlang-eunit-opts erlang-eunit-test-generator-p "eunit:test({generator, %s, %s}%s)." "%% WARNING: '%s' is not a test function" erlang-eunit-record-recent test-mode erlang-eunit-inferior-erlang-send-command] 5]) (defalias 'erlang-eunit-run-module-tests #[(module-name) "\302\303\304 #\305\306\307#\210\310 !)\207" [module-name command format "eunit:test(%s%s)." erlang-eunit-opts erlang-eunit-record-recent module-mode nil erlang-eunit-inferior-erlang-send-command] 4]) #@157 Compile the source and test files and repeat the most recent EUnit test run. With prefix arg, compiles for debug and runs tests with the verbose flag set. (defalias 'erlang-eunit-compile-and-run-recent #[nil "\301\302!\211\303\267\202$\304\305\301\306!\301\307!D\"\202'\304\310\301\306!C\301\311!#\202'\312\313!)\207" [#1=#:temp erlang-eunit-recent mode #s(hash-table size 3 test eq rehash-size 1.5 rehash-threshold 0.8125 purecopy t data (quote 10 test-mode 10 module-mode 23)) erlang-eunit-compile-and-test erlang-eunit-run-test module test erlang-eunit-run-module-tests cover error "EUnit has not yet been run. Please run a test first."] 6 (#$ . 5965) nil]) #@31 Cover compile current module. (defalias 'erlang-eunit-cover-compile #[nil "\304\305C\"\306\307 !!\310\311\n\"\312 \210\313 \205\314 !+\207" [erlang-compile-extra-opts buffer-file-name module-name compile-command append debug_info erlang-add-quotes-if-needed erlang-eunit-module-name format "cover:compile_beam(%s)." erlang-compile erlang-eunit-last-compilation-successful-p erlang-eunit-inferior-erlang-send-command] 3 (#$ . 6638) nil]) #@383 Analyze the data collected by cover tool for the module in the current buffer. Assumes that the module has been cover compiled prior to this call. This function will do two things: print the number of covered and uncovered functions in the erlang shell and display a new buffer called * coverage* which shows the source code along with the coverage analysis results. (defalias 'erlang-eunit-analyze-coverage #[nil "\306\307!!\310\311!\312\313 \n#\312\314 \"\315 !\210\212\316\312\314 \"!\211q\210\317\320\n\317\211\211\321%\210\322 \323U\203=\324 !\210\202A\325 !\210*\326\n!,\207" [buffer-file-name module-name tmp-filename analyze-command buf-name buf erlang-add-quotes-if-needed erlang-eunit-module-name make-temp-file "cover" format "cover:analyze_to_file(%s, \"%s\"). " "*%s coverage*" erlang-eunit-inferior-erlang-send-command get-buffer-create nil insert-file-contents t buffer-size 0 kill-buffer view-buffer delete-file buffer-read-only] 7 (#$ . 7088) nil]) #@146 Compile the source and test files and run the current EUnit test. With prefix arg, compiles for debug and runs tests with the verbose flag set. (defalias 'erlang-eunit-compile-and-run-current-test #[nil "\303\304!!\305 \306\307\n D\"*\207" [buffer-file-name test-name module-name erlang-add-quotes-if-needed erlang-eunit-module-name erlang-eunit-current-test erlang-eunit-compile-and-test erlang-eunit-run-test] 4 (#$ . 8086) nil]) #@153 Compile the source and test files and run all EUnit tests in the module. With prefix arg, compiles for debug and runs tests with the verbose flag set. (defalias 'erlang-eunit-compile-and-run-module-tests #[nil "\302\303!!\304\305 C\")\207" [buffer-file-name module-name erlang-add-quotes-if-needed erlang-eunit-source-module-name erlang-eunit-compile-and-test erlang-eunit-run-module-tests] 3 (#$ . 8529) nil]) #@574 Compile the source and test files and run the EUnit test suite. If under-cover is set to t, the module under test is compile for code coverage analysis. If under-cover is left out or not set, coverage analysis is disabled. The result of the code coverage is both printed to the erlang shell (the number of covered vs uncovered functions in a module) and written to a buffer called * coverage* (which shows the source code for the module and the number of times each line is covered). With prefix arg, compiles for debug and runs tests with the verbose flag set. (defalias 'erlang-eunit-compile-and-test #[(test-fun test-args &optional under-cover) "\306!\210\307 !\310 !\311\f!\210\311K\312\216\311\313M\210\314 \"\205F\315\n!\203,\314\n!\202-\316\205F\317\"\205F\205Fr\320 !q\210\321 ),\207" [under-cover buffer-file-name test-filename src-filename erlang-eunit-autosave #1=#:old erlang-eunit-record-recent-compile erlang-eunit-src-filename erlang-eunit-test-filename save-some-buffers #[nil "\301M\207" [#1# save-some-buffers] 2] ignore erlang-eunit-compile-file file-readable-p t apply find-file-noselect erlang-eunit-analyze-coverage test-fun test-args] 3 (#$ . 8950)]) #@170 Compile the source and test files and run the EUnit test suite and measure code coverage. With prefix arg, compiles for debug and runs tests with the verbose flag set. (defalias 'erlang-eunit-compile-and-run-module-tests-under-cover #[nil "\302\303!!\304\305 C\306#)\207" [buffer-file-name module-name erlang-add-quotes-if-needed erlang-eunit-source-module-name erlang-eunit-compile-and-test erlang-eunit-run-module-tests t] 4 (#$ . 10159) nil]) (defalias 'erlang-eunit-compile-file #[(file-path &optional under-cover) "\303!\203r\304!q\210 \203\305 \210\202\306 \210\307 )\207\310\311\"\312\310\313\n\"!\210\314\n!)\207" [file-path under-cover msg file-readable-p find-file-noselect erlang-eunit-cover-compile erlang-compile erlang-eunit-last-compilation-successful-p format "Could not read %s" erlang-eunit-inferior-erlang-send-command "%% WARNING: %s" error] 4]) (defalias 'erlang-eunit-last-compilation-successful-p #[nil "rq\210 b\210\303\304\305\306\n\"\")\207" [inferior-erlang-buffer compilation-parsing-end erlang-error-regexp-alist erlang-eunit-all-list-elems-fulfill-p #[(re) "\303\211 \203%\304\nd\303#\203\305 \204\306\211\211\202\303\306\211\204*\207" [result continue re t re-search-forward erlang-eunit-is-compilation-warning nil] 5] mapcar #[(e) "@\207" [e] 1]] 5]) (defalias 'erlang-eunit-is-compilation-warning #[nil "\300\301\302 \303 {\"\207" [erlang-eunit-string-match-p "[0-9]+: Warning:" line-beginning-position line-end-position] 4]) (defalias 'erlang-eunit-all-list-elems-fulfill-p #[(pred list) "\303 \203\203\n @!\204\304 A\211\204)\207" [matches-p list pred t nil] 3]) #@41 Evaluate a command in an erlang buffer. (defalias 'erlang-eunit-inferior-erlang-send-command #[(command) "\301 \210\302!\210\303\304!\210\305 \207" [command inferior-erlang-prepare-for-input inferior-erlang-send-command sit-for 0 inferior-erlang-wait-prompt] 2 (#$ . 11807) "P"]) (defconst erlang-eunit-key-bindings '(("t" erlang-eunit-toggle-src-and-test-file-other-window) ("k" erlang-eunit-compile-and-run-module-tests) ("j" erlang-eunit-compile-and-run-current-test) ("l" erlang-eunit-compile-and-run-recent) ("c" erlang-eunit-compile-and-run-module-tests-under-cover) ("v" erlang-eunit-cover-compile) ("a" erlang-eunit-analyze-coverage))) (defalias 'erlang-eunit-add-key-bindings #[nil "\303\211\205\n@\304 @ A@\"\210\nA\211\204\303*\207" [erlang-eunit-key-bindings binding --dolist-tail-- nil erlang-eunit-bind-key] 4]) (defalias 'erlang-eunit-bind-key #[(key function) "\302!\210\303 \"\207" [key function erlang-eunit-ensure-keymap-for-key local-set-key] 3]) (defalias 'erlang-eunit-ensure-keymap-for-key #[(key-seq) "\303\304\305\"!\306\n\205+ \307\310\n@\"P\nA\311\312\313 \"!\204 \314 \315 \"\210\202 *\207" [key-seq prefix-seq prefix-keys butlast append nil "" make-string 1 keymapp lookup-key current-local-map local-set-key make-sparse-keymap] 4]) (byte-code "\300\301\302\"\210\303\304!\207" [add-hook erlang-mode-hook erlang-eunit-add-key-bindings provide erlang-eunit] 3)