Skip to content

Commit aacb70e

Browse files
authored
Merge pull request #116 from emacs-php/make-for-test
Make for test
2 parents fcdbae4 + f3a7549 commit aacb70e

File tree

2 files changed

+45
-3
lines changed

2 files changed

+45
-3
lines changed

Makefile

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
EMACS ?= emacs
2+
CASK ?= cask
23
ELS = phpactor.el company-phpactor.el
34
AUTOLOADS = phpactor-autoloads.el
45
ELCS = $(ELS:.el=.elc)
56

67
%.elc: %.el
78
$(EMACS) -Q -batch -L . -f package-initialize -f batch-byte-compile $<
89

9-
all: clean autoloads $(ELCS)
10+
all: .cask $(ELCS) autoloads
1011

1112
autoloads: $(AUTOLOADS)
1213

@@ -17,6 +18,17 @@ $(AUTOLOADS): $(ELCS)
1718
(normal-top-level-add-subdirs-to-load-path) \
1819
(package-generate-autoloads \"phpactor\" default-directory))"
1920

21+
.cask: Cask
22+
$(CASK) install
23+
24+
test: .cask $(ELCS)
25+
$(EMACS) -Q -batch -L . --eval \
26+
"(let ((default-directory (expand-file-name \".cask\" default-directory))) \
27+
(normal-top-level-add-subdirs-to-load-path) \
28+
(require 'buttercup))" \
29+
--eval "(setq warning-minimum-log-level :debug)" \
30+
-f buttercup-run-discover
31+
2032
clean:
2133
rm -f $(ELCS) $(AUTOLOADS)
2234

tests/e2e/test-sanity.el

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,30 @@
1+
;;; test-sanity.el --- Behavior-Driven test for phpactor -*- lexical-binding: t; -*-
2+
3+
;; Copyright (C) 2018 Friends of Emacs-PHP development
4+
5+
;; Author: Mikael Kermorgant <mikael@kgtech.fi>
6+
;; Keywords: maint
7+
8+
;; This program is free software; you can redistribute it and/or modify
9+
;; it under the terms of the GNU General Public License as published by
10+
;; the Free Software Foundation, either version 3 of the License, or
11+
;; (at your option) any later version.
12+
13+
;; This program is distributed in the hope that it will be useful,
14+
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
15+
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16+
;; GNU General Public License for more details.
17+
18+
;; You should have received a copy of the GNU General Public License
19+
;; along with this program. If not, see <https://www.gnu.org/licenses/>.
20+
21+
;;; Commentary:
22+
23+
;; A BDD test code based on Buttercup.
24+
;; https://github.com/jorgenschaefer/emacs-buttercup
25+
26+
;;; Code:
27+
(require 'buttercup)
128
(require 'phpactor)
229

330
(defun buffer-string* (buffer)
@@ -11,13 +38,13 @@
1138

1239
(describe "var: `phpactor-install-directory'"
1340
(it "should have some value"
14-
(display-warning 'buttercup (format "phpactor install folder is : %s" phpactor-install-directory))
41+
(display-warning 'buttercup (format "phpactor install folder is : %s" phpactor-install-directory) :debug)
1542
(expect phpactor-install-directory :not :to-be nil)
1643
))
1744

1845
(describe ": `phpactor--lisp-directory'" ;; I prefer having a test as I'm not that really fine with it being nil
1946
(it "should have some value"
20-
(display-warning 'buttercup (format "phpactor lisp folder is : %s" phpactor--lisp-directory))
47+
(display-warning 'buttercup (format "phpactor lisp folder is : %s" phpactor--lisp-directory) :debug)
2148
(expect phpactor--lisp-directory :not :to-be nil)
2249
))
2350

@@ -42,3 +69,6 @@
4269
(expect 'php-project-get-root-dir :to-have-been-called)
4370
)
4471
))
72+
73+
(provide 'test-sanity)
74+
;;; test-sanity.el ends here

0 commit comments

Comments
 (0)