2016-11-11 11:51:49 +01:00
|
|
|
;;; test-helper.el --- PlantUML Mode test initialization -*- lexical-binding: t; -*-
|
|
|
|
|
|
|
|
;; Author: Carlo Sciolla (skuro)
|
|
|
|
;; Maintainer: Carlo Sciolla (skuro)
|
|
|
|
;; URL: https://github.com/skuro/plantuml-mode
|
|
|
|
|
|
|
|
;;; Commentary:
|
|
|
|
|
|
|
|
;;; Code:
|
|
|
|
|
|
|
|
(require 'f)
|
|
|
|
|
|
|
|
(defvar package-test-path
|
|
|
|
(f-dirname (f-this-file)))
|
|
|
|
|
|
|
|
(defvar package-code-path
|
|
|
|
(f-parent package-test-path))
|
|
|
|
|
2016-11-11 12:53:41 +01:00
|
|
|
(defvar plantuml-test-resources-path
|
|
|
|
(f-join package-code-path "test/resources"))
|
|
|
|
|
|
|
|
(defvar plantuml-test-jar-path
|
|
|
|
(f-join package-code-path "bin/plantuml.jar"))
|
|
|
|
|
|
|
|
(defun read-buffer (bufname)
|
|
|
|
(with-current-buffer (get-buffer bufname)
|
|
|
|
(buffer-string)))
|
|
|
|
|
|
|
|
(defun read-preview-buffer ()
|
|
|
|
(read-buffer plantuml-preview-buffer))
|
|
|
|
|
|
|
|
(defun read-test-file (path)
|
|
|
|
(f-read (f-join plantuml-test-resources-path path) 'utf-8))
|
|
|
|
|
2017-07-07 21:18:37 +02:00
|
|
|
(defun load-plantuml-mode ()
|
|
|
|
(require 'plantuml-mode (f-expand "plantuml-mode.el" package-code-path)))
|
|
|
|
|
2018-03-18 22:59:22 +01:00
|
|
|
(defun format-preview-output (s)
|
|
|
|
"Make the preview output as S more readable in test output."
|
|
|
|
(concat "\n" s))
|
|
|
|
|
2018-03-18 19:17:38 +01:00
|
|
|
;; enable code coverage
|
|
|
|
(when (require 'undercover nil t)
|
|
|
|
(undercover "plantuml-mode.el"))
|
|
|
|
|
2017-08-19 21:46:16 +02:00
|
|
|
(load-plantuml-mode)
|
|
|
|
|
2016-11-11 11:51:49 +01:00
|
|
|
;;; test-helper.el ends here
|