branch: externals/pyim commit 3d39d731885eb9af91b27195d3dca1096e8ff700 Author: Feng Shu <tuma...@163.com> Commit: Feng Shu <tuma...@163.com>
Move test/Makefile to . --- .github/workflows/test.yml | 2 +- .gitignore | 1 + Makefile | 44 ++++++++++++++++++++++++++++++++++++++++++++ tests/Makefile | 36 ------------------------------------ tests/pyim-byte-compile.el | 2 +- 5 files changed, 47 insertions(+), 38 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c6afa6a02e..1533d0e808 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -20,4 +20,4 @@ jobs: run: emacs --version - name: Run tests - run: make -C tests test + run: make test diff --git a/.gitignore b/.gitignore index 5946b1e3d5..f80ed03e50 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,4 @@ TAGS tags +/.deps/ diff --git a/Makefile b/Makefile new file mode 100644 index 0000000000..3c1d1dae62 --- /dev/null +++ b/Makefile @@ -0,0 +1,44 @@ +# -*- Makefile -*- +SHELL = /bin/sh +EMACS ?= emacs + +.PHONY: test lint clean deps compile + +EMACS_BATCH_OPTS=--batch --quick --directory . --directory .deps +RM=@rm -rf + +XR_URL="https://git.savannah.gnu.org/cgit/emacs/elpa.git/plain/xr.el?h=externals/xr" +ASYNC_URL="https://git.savannah.gnu.org/cgit/emacs/elpa.git/plain/async.el?h=externals/async" +POPUP_URL="https://git.savannah.gnu.org/cgit/emacs/nongnu.git/plain/popup.el?h=elpa/popup" +POPON_URL="https://git.savannah.gnu.org/cgit/emacs/nongnu.git/plain/popon.el?h=elpa/popon" +POSFRAME_URL="https://git.savannah.gnu.org/cgit/emacs/elpa.git/plain/posframe.el?h=externals/posframe" + +## Download pyim-basedict V0.5.0 (commit: 7495c974ada99f9fed96d8e85d8b97dabce9532c) +BASEDICT_PYIM_URL="https://git.savannah.gnu.org/cgit/emacs/elpa.git/plain/pyim-basedict.pyim?h=externals/pyim-basedict&id=7495c974ada99f9fed96d8e85d8b97dabce9532c" +BASEDICT_URL="https://git.savannah.gnu.org/cgit/emacs/elpa.git/plain/pyim-basedict.el?h=externals/pyim-basedict&id=7495c974ada99f9fed96d8e85d8b97dabce9532c" + +clean: + $(RM) pyim-tests-temp-* + $(RM) *.elc + +deps: + @mkdir -p .deps; + @if [ ! -f .deps/xr.el ]; then curl -L $(XR_URL) > .deps/xr.el; fi; + @if [ ! -f .deps/async.el ]; then curl -L $(ASYNC_URL) > .deps/async.el; fi; + @if [ ! -f .deps/popup.el ]; then curl -L $(POPUP_URL) > .deps/popup.el; fi; + @if [ ! -f .deps/popon.el ]; then curl -L $(POPON_URL) > .deps/popon.el; fi; + @if [ ! -f .deps/pyim-basedict.pyim ]; then curl -L $(BASEDICT_PYIM_URL) > .deps/pyim-basedict.pyim; fi; + @if [ ! -f .deps/pyim-basedict.el ]; then curl -L $(BASEDICT_URL) > .deps/pyim-basedict.el; fi; + @if [ ! -f .deps/posframe.el ]; then curl -L $(POSFRAME_URL) > .deps/posframe.el; fi; + +lint: deps + @$(EMACS) $(EMACS_BATCH_OPTS) --load ./tests/pyim-elint.el 2>&1 | grep -vE "pyim-cregexp.el:[0-9]+:Warning: Empty varlist in let|pyim-indicator.el:[0-9]+:Error: Call to undefined function: posframe-show" | grep -E "([Ee]rror|[Ww]arning):" && exit 1 || exit 0 + +compile: deps + $(RM) *.elc + @$(EMACS) $(EMACS_BATCH_OPTS) --load ./tests/pyim-byte-compile.el 2>&1 | grep -E "([Ee]rror|[Ww]arning):" && exit 1 || exit 0 + +# test: lint compile deps clean +test: compile deps + @$(EMACS) $(EMACS_BATCH_OPTS) --load ./tests/pyim-tests.el + $(RM) pyim-tests-temp-* diff --git a/tests/Makefile b/tests/Makefile deleted file mode 100644 index 4c5c19d812..0000000000 --- a/tests/Makefile +++ /dev/null @@ -1,36 +0,0 @@ -# -*- Makefile -*- -SHELL = /bin/sh -EMACS ?= emacs - -.PHONY: test lint clean deps compile - -EMACS_BATCH_OPTS=--batch --quick --directory .. --directory ./deps -RM=@rm -rf - -clean: - $(RM) pyim-tests-temp-* - $(RM) ../*.elc - $(RM) *.elc - -deps: - @mkdir -p deps; - @if [ ! -f deps/xr.el ]; then curl -L "https://git.savannah.gnu.org/cgit/emacs/elpa.git/plain/xr.el?h=externals/xr" > deps/xr.el; fi; - @if [ ! -f deps/async.el ]; then curl -L "https://git.savannah.gnu.org/cgit/emacs/elpa.git/plain/async.el?h=externals/async" > deps/async.el; fi; - @if [ ! -f deps/popup.el ]; then curl -L "https://git.savannah.gnu.org/cgit/emacs/nongnu.git/plain/popup.el?h=elpa/popup" > deps/popup.el; fi; - @if [ ! -f deps/popon.el ]; then curl -L "https://git.savannah.gnu.org/cgit/emacs/nongnu.git/plain/popon.el?h=elpa/popon" > deps/popon.el; fi; - ## Download pyim-basedict V0.5.0 (commit: 7495c974ada99f9fed96d8e85d8b97dabce9532c) - @if [ ! -f deps/pyim-basedict.pyim ]; then curl -L "https://git.savannah.gnu.org/cgit/emacs/elpa.git/plain/pyim-basedict.pyim?h=externals/pyim-basedict&id=7495c974ada99f9fed96d8e85d8b97dabce9532c" > deps/pyim-basedict.pyim; fi; - @if [ ! -f deps/pyim-basedict.el ]; then curl -L "https://git.savannah.gnu.org/cgit/emacs/elpa.git/plain/pyim-basedict.el?h=externals/pyim-basedict&id=7495c974ada99f9fed96d8e85d8b97dabce9532c" > deps/pyim-basedict.el; fi; - @if [ ! -f deps/posframe.el ]; then curl -L "https://git.savannah.gnu.org/cgit/emacs/elpa.git/plain/posframe.el?h=externals/posframe" > deps/posframe.el; fi; - -lint: deps - @$(EMACS) $(EMACS_BATCH_OPTS) --load ./pyim-elint.el 2>&1 | grep -vE "pyim-cregexp.el:[0-9]+:Warning: Empty varlist in let|pyim-indicator.el:[0-9]+:Error: Call to undefined function: posframe-show" | grep -E "([Ee]rror|[Ww]arning):" && exit 1 || exit 0 - -compile: deps - $(RM) ../*.elc - @$(EMACS) $(EMACS_BATCH_OPTS) --load ./pyim-byte-compile.el 2>&1 | grep -E "([Ee]rror|[Ww]arning):" && exit 1 || exit 0 - -# test: lint compile deps clean -test: compile deps - @$(EMACS) $(EMACS_BATCH_OPTS) --load ./pyim-tests.el - $(RM) pyim-tests-temp-* diff --git a/tests/pyim-byte-compile.el b/tests/pyim-byte-compile.el index 09506e9204..beadf90724 100644 --- a/tests/pyim-byte-compile.el +++ b/tests/pyim-byte-compile.el @@ -29,7 +29,7 @@ (require 'find-lisp) (let ((files (find-lisp-find-files-internal - "../" + "./" (lambda (file dir) (and (not (file-directory-p (expand-file-name file dir))) (string-match "\\.el$" file)