1 (defconst context-coloring-test-directory
2 (file-name-directory (or load-file-name buffer-file-name))
3 "This file's directory.")
5 (defun context-coloring-test-resolve-path (path)
6 "Resolve PATH from this file's directory."
7 (expand-file-name path context-coloring-test-directory))
9 (defconst context-coloring-coverage-output-file-prefix
10 (format-time-string "%s"))
12 (defconst context-coloring-coverage-output-file
13 (context-coloring-test-resolve-path
14 (concat "./coverage/" context-coloring-coverage-output-file-prefix ".json")))
16 (defconst context-coloring-coverage-report-file
17 (context-coloring-test-resolve-path
18 (concat "./coverage/" context-coloring-coverage-output-file-prefix ".txt")))
20 (defconst context-coloring-test-coverage-parser
21 (concat "node " (context-coloring-test-resolve-path "./parse-coverage.js")))
24 (setq undercover-force-coverage t)
25 (make-directory (context-coloring-test-resolve-path "./coverage/") t)
26 (undercover "context-coloring.el"
27 (:report-file context-coloring-coverage-output-file))
32 (let* ((output-buffer (get-buffer-create "*parsed coverage*")))
33 (call-process-shell-command
34 context-coloring-test-coverage-parser
35 context-coloring-coverage-output-file
37 (with-current-buffer output-buffer
38 (princ (buffer-substring-no-properties (point-min) (point-max)))
39 (write-file context-coloring-coverage-report-file))))
42 (require 'context-coloring)