Skip to content

Commit

Permalink
Merge branch 'test-package-install'
Browse files Browse the repository at this point in the history
  • Loading branch information
yasuyk committed Oct 16, 2016
2 parents abebc92 + 811e6d3 commit d2911b7
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@
.elc*
elpa
test/fixture/*
test/test-package-install.log
test/test-checkdoc.log
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ install:
script:
# Run your tests
- emacs --version
- make test
- make travis-ci
1 change: 1 addition & 0 deletions Cask
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
(depends-on "helm")

(development
(depends-on "cask")
(depends-on "f")
(depends-on "ert") ; Unit test library
(depends-on "ert-runner") ; Unit test runner
Expand Down
23 changes: 19 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,15 @@ SRC ?= helm-git-grep.el
FIXTURE_GIT_VERSION ?= v1.0.0
FIXTURE_GIT_WORK_DIR ?= test/fixture/git
TEST_CHECKDOC_EL ?= test/test-checkdoc.el
TEST_CHECKDOC_LOG ?= test/test-checkdoc.log
TEST_PACKAGE_INSTALL_EL ?= test/test-package-install.el
TEST_PACKAGE_INSTALL_LOG ?= test/test-package-install.log
LOADPATH = -L .
ELPA_DIR = $(shell EMACS=$(EMACS) $(CASK) package-directory)

TMP = .tmp

.PHONY : test
test: test-checkdoc unit-tests
test: test-checkdoc test-package-install unit-tests

.PHONY : unit-tests
# `clean-elc` task needs to remove byte-compiled files to collect coverage by undercover.el.
Expand All @@ -37,10 +40,22 @@ print-deps:
.PHONY : test-checkdoc
test-checkdoc: elpa
@echo "-- test ckeckdoc --"
@$(CASK) exec $(EMACS) -batch -Q $(LOADPATH) -l $(TEST_CHECKDOC_EL) 2>&1 | [ $$(wc -l) -gt 0 ] && exit 1 || exit 0
$(CASK) exec $(EMACS) -batch -Q $(LOADPATH) -l $(TEST_CHECKDOC_EL) 2>&1 | tee $(TEST_CHECKDOC_LOG)
@cat $(TEST_CHECKDOC_LOG) | [ $$(wc -l) -gt 0 ] && exit 1 || exit 0

.PHONY : test-package-install
test-package-install: elpa clean-package-install
@echo "-- test install package --"
$(CASK) exec $(EMACS) -batch -Q $(LOADPATH) -l $(TEST_PACKAGE_INSTALL_EL) 2>&1 | tee $(TEST_PACKAGE_INSTALL_LOG)
@grep Error $(TEST_PACKAGE_INSTALL_LOG) && exit 1 || exit 0

.PHONY : clean-package-install
clean-package-install:
rm -rf $(ELPA_DIR)/helm-git-grep*
rm -rf $(TEST_PACKAGE_INSTALL_LOG)

.PHONY : travis-ci
travis-ci: print-deps test
travis-ci: print-deps test-package-install unit-tests

.PHONY : elpa
elpa: $(ELPA_DIR)
Expand Down
5 changes: 5 additions & 0 deletions test/test-package-install.el
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
(require 'cask)
(cask-initialize ".")
(setq byte-compile-error-on-warn t)
(require 'package)
(package-install-file "helm-git-grep.el")

0 comments on commit d2911b7

Please sign in to comment.