summaryrefslogtreecommitdiff
path: root/test/test-helper.el
blob: 606e75a73a2fc4a820dcbaa58ba9b9b5c80370c6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
;;; test-helper.el --- Tests for restart-emacs             -*- lexical-binding: t; -*-

;;; Commentary:
;;; Helpers to write tests for restart-emacs

;;; Code:

;; Setup load-path, some of this is redundant when tests are run from the
;; command line
(let ((project-dir (locate-dominating-file (or (buffer-file-name) load-file-name)
                                           ".cask")))
  (if (not project-dir)
      (user-error "Could not locate project root")
    (let ((default-directory (expand-file-name (concat ".cask/" emacs-version) project-dir)))
      (normal-top-level-add-subdirs-to-load-path))

    (add-to-list 'load-path project-dir)))

(provide 'test-helper)
;;; test-helper.el ends here