From beb200c35809c4577d919dbe828b1ec41ecdee3a Mon Sep 17 00:00:00 2001 From: USAMI Kenta Date: Mon, 17 Jun 2019 19:55:47 +0900 Subject: [PATCH 1/4] Add Lisp header to tests/e2e/test-sanity.el --- tests/e2e/test-sanity.el | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/tests/e2e/test-sanity.el b/tests/e2e/test-sanity.el index 9c8f34f..dd7e0de 100644 --- a/tests/e2e/test-sanity.el +++ b/tests/e2e/test-sanity.el @@ -1,3 +1,30 @@ +;;; test-sanity.el --- Behavior-Driven test for phpactor -*- lexical-binding: t; -*- + +;; Copyright (C) 2018 Friends of Emacs-PHP development + +;; Author: Mikael Kermorgant +;; Keywords: maint + +;; This program is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; This program is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with this program. If not, see . + +;;; Commentary: + +;; A BDD test code based on Buttercup. +;; https://github.com/jorgenschaefer/emacs-buttercup + +;;; Code: +(require 'buttercup) (require 'phpactor) (defun buffer-string* (buffer) @@ -42,3 +69,6 @@ (expect 'php-project-get-root-dir :to-have-been-called) ) )) + +(provide 'test-sanity) +;;; test-sanity.el ends here From 96119cab4a2f423f53cc6dd9e06d60705f480966 Mon Sep 17 00:00:00 2001 From: USAMI Kenta Date: Mon, 17 Jun 2019 19:56:39 +0900 Subject: [PATCH 2/4] Add "test" target to Makfile --- Makefile | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Makefile b/Makefile index ca47562..15d6099 100644 --- a/Makefile +++ b/Makefile @@ -17,6 +17,13 @@ $(AUTOLOADS): $(ELCS) (normal-top-level-add-subdirs-to-load-path) \ (package-generate-autoloads \"phpactor\" default-directory))" +test: clean $(ELCS) + $(EMACS) -Q -batch -L . --eval \ + "(let ((default-directory (expand-file-name \".cask\" default-directory))) \ + (normal-top-level-add-subdirs-to-load-path) \ + (require 'buttercup))" \ + -f buttercup-run-discover + clean: rm -f $(ELCS) $(AUTOLOADS) From b959a0b841d11a67f5f7daccf0ecd0e3afb8f514 Mon Sep 17 00:00:00 2001 From: USAMI Kenta Date: Mon, 17 Jun 2019 19:59:37 +0900 Subject: [PATCH 3/4] Make display-warning as :debug instead :warning --- Makefile | 1 + tests/e2e/test-sanity.el | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 15d6099..fca64ec 100644 --- a/Makefile +++ b/Makefile @@ -22,6 +22,7 @@ test: clean $(ELCS) "(let ((default-directory (expand-file-name \".cask\" default-directory))) \ (normal-top-level-add-subdirs-to-load-path) \ (require 'buttercup))" \ + --eval "(setq warning-minimum-log-level :debug)" \ -f buttercup-run-discover clean: diff --git a/tests/e2e/test-sanity.el b/tests/e2e/test-sanity.el index dd7e0de..1ba8bdf 100644 --- a/tests/e2e/test-sanity.el +++ b/tests/e2e/test-sanity.el @@ -38,13 +38,13 @@ (describe "var: `phpactor-install-directory'" (it "should have some value" - (display-warning 'buttercup (format "phpactor install folder is : %s" phpactor-install-directory)) + (display-warning 'buttercup (format "phpactor install folder is : %s" phpactor-install-directory) :debug) (expect phpactor-install-directory :not :to-be nil) )) (describe ": `phpactor--lisp-directory'" ;; I prefer having a test as I'm not that really fine with it being nil (it "should have some value" - (display-warning 'buttercup (format "phpactor lisp folder is : %s" phpactor--lisp-directory)) + (display-warning 'buttercup (format "phpactor lisp folder is : %s" phpactor--lisp-directory) :debug) (expect phpactor--lisp-directory :not :to-be nil) )) From f3a7549a2bf4277dcc453f3aec9fa54b4a760e0e Mon Sep 17 00:00:00 2001 From: USAMI Kenta Date: Thu, 20 Jun 2019 16:54:57 +0900 Subject: [PATCH 4/4] Add cask install to make --- Makefile | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index fca64ec..1c5b4b7 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,5 @@ EMACS ?= emacs +CASK ?= cask ELS = phpactor.el company-phpactor.el AUTOLOADS = phpactor-autoloads.el ELCS = $(ELS:.el=.elc) @@ -6,7 +7,7 @@ ELCS = $(ELS:.el=.elc) %.elc: %.el $(EMACS) -Q -batch -L . -f package-initialize -f batch-byte-compile $< -all: clean autoloads $(ELCS) +all: .cask $(ELCS) autoloads autoloads: $(AUTOLOADS) @@ -17,7 +18,10 @@ $(AUTOLOADS): $(ELCS) (normal-top-level-add-subdirs-to-load-path) \ (package-generate-autoloads \"phpactor\" default-directory))" -test: clean $(ELCS) +.cask: Cask + $(CASK) install + +test: .cask $(ELCS) $(EMACS) -Q -batch -L . --eval \ "(let ((default-directory (expand-file-name \".cask\" default-directory))) \ (normal-top-level-add-subdirs-to-load-path) \