[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/lua-mode 1d21a10 259/468: Reorganize test structure
From: |
Philip Kaludercic |
Subject: |
[nongnu] elpa/lua-mode 1d21a10 259/468: Reorganize test structure |
Date: |
Thu, 5 Aug 2021 04:58:49 -0400 (EDT) |
branch: elpa/lua-mode
commit 1d21a101a8c7e839b65fa793afef4149698cf09c
Author: immerrr <immerrr+lua@gmail.com>
Commit: immerrr <immerrr+lua@gmail.com>
Reorganize test structure
- rename test helper to test-helper.el
- rename test-XX.el to XX-test.el to avoid confusion with test-helper
- `load', not `require' test-helper
---
Makefile | 23 ++++++++++++----------
...ltin-font-lock.el => builtin-font-lock-test.el} | 9 +++------
...-defun-font-lock.el => defun-font-lock-test.el} | 8 +++-----
...test-electric-mode.el => electric-mode-test.el} | 12 +++--------
test/{test-indentation.el => indentation-test.el} | 10 ++++------
...nd-comments.el => strings-and-comments-test.el} | 8 +++-----
...ua-font-lock-test-helpers.el => test-helper.el} | 4 +---
7 files changed, 30 insertions(+), 44 deletions(-)
diff --git a/Makefile b/Makefile
index 301724a..3702314 100644
--- a/Makefile
+++ b/Makefile
@@ -9,34 +9,37 @@ EMACS?=emacs
EMACS_BATCH=cask exec $(EMACS) --batch -Q
TESTS=
-TESTS += test/test-defun-font-lock.el
-TESTS += test/test-builtin-font-lock.el
-TESTS += test/test-electric-mode.el
-TESTS += test/test-indentation.el
-TESTS += test/test-strings-and-comments.el
+TESTS += test/defun-font-lock-test.el
+TESTS += test/builtin-font-lock-test.el
+TESTS += test/electric-mode-test.el
+TESTS += test/indentation-test.el
+TESTS += test/strings-and-comments-test.el
default:
@echo version is $(VERSION)
-compile:
- $(EMACS_BATCH) -f batch-byte-compile lua-mode.el
+%.elc: %.el
+ $(EMACS_BATCH) -f batch-byte-compile $<
+
+compile: lua-mode.elc
+
dist:
rm -f $(DISTFILE) && \
git archive --format=zip -o $(DISTFILE) --prefix=lua-mode/ HEAD
-.PHONY: test test-compiled test-uncompiled
+.PHONY: test-compiled test-uncompiled
# check both regular and compiled versions
test: test-compiled test-uncompiled
test-compiled: compile
$(EMACS_BATCH) -l test/ert.el \
- -l lua-mode.elc -l test/lua-font-lock-test-helpers.el \
+ -l lua-mode.elc \
$(addprefix -l ,$(TESTS)) -f ert-run-tests-batch-and-exit
test-uncompiled:
$(EMACS_BATCH) -l test/ert.el \
- -l lua-mode.el -l test/lua-font-lock-test-helpers.el \
+ -l lua-mode.el \
$(addprefix -l ,$(TESTS)) -f ert-run-tests-batch-and-exit
release:
diff --git a/test/test-builtin-font-lock.el b/test/builtin-font-lock-test.el
similarity index 85%
rename from test/test-builtin-font-lock.el
rename to test/builtin-font-lock-test.el
index 5e3184a..a468b4e 100644
--- a/test/test-builtin-font-lock.el
+++ b/test/builtin-font-lock-test.el
@@ -1,9 +1,6 @@
-(require 'ert)
-(require 'lua-font-lock-test-helpers
- ;; let's try a bit to help Emacs find the helpers, just in case
- (concat (file-name-directory (or load-file-name (buffer-file-name)
- default-directory))
- "lua-font-lock-test-helpers.el"))
+(load (concat (file-name-directory (or load-file-name (buffer-file-name)
+ default-directory))
+ "test-helper.el") nil 'nomessage 'nosuffix)
(ert-deftest lua-font-lock-builtins ()
diff --git a/test/test-defun-font-lock.el b/test/defun-font-lock-test.el
similarity index 90%
rename from test/test-defun-font-lock.el
rename to test/defun-font-lock-test.el
index 28072ab..a137e7d 100644
--- a/test/test-defun-font-lock.el
+++ b/test/defun-font-lock-test.el
@@ -1,9 +1,7 @@
(require 'ert)
-(require 'lua-font-lock-test-helpers
- ;; let's try a bit to help Emacs find the helpers, just in case
- (concat (file-name-directory (or load-file-name (buffer-file-name)
- default-directory))
- "lua-font-lock-test-helpers.el"))
+(load (concat (file-name-directory (or load-file-name (buffer-file-name)
+ default-directory))
+ "test-helper.el") nil 'nomessage 'nosuffix)
(ert-deftest lua-font-lock-defuns ()
diff --git a/test/test-electric-mode.el b/test/electric-mode-test.el
similarity index 91%
rename from test/test-electric-mode.el
rename to test/electric-mode-test.el
index b95797e..1e618f0 100644
--- a/test/test-electric-mode.el
+++ b/test/electric-mode-test.el
@@ -1,12 +1,6 @@
-(require 'ert)
-(require 's)
-
-(defmacro with-lua-buffer (&rest body)
- `(with-temp-buffer
- (switch-to-buffer (current-buffer))
- (lua-mode)
- (font-lock-fontify-buffer)
- ,@body))
+(load (concat (file-name-directory (or load-file-name (buffer-file-name)
+ default-directory))
+ "test-helper.el") nil 'nomessage 'nosuffix)
(ert-deftest test-electric-brace ()
diff --git a/test/test-indentation.el b/test/indentation-test.el
similarity index 96%
rename from test/test-indentation.el
rename to test/indentation-test.el
index aefbf53..2ccfe34 100644
--- a/test/test-indentation.el
+++ b/test/indentation-test.el
@@ -1,10 +1,8 @@
(require 'cl-lib)
-(require 'ert)
-(require 'lua-font-lock-test-helpers
- ;; let's try a bit to help Emacs find the helpers, just in case
- (concat (file-name-directory (or load-file-name (buffer-file-name)
- default-directory))
- "lua-font-lock-test-helpers.el"))
+(load (concat (file-name-directory (or load-file-name (buffer-file-name)
+ default-directory))
+ "test-helper.el") nil 'nomessage 'nosuffix)
+
(ert-deftest lua-indentation-assignment ()
(should-lua-indent "\
diff --git a/test/test-strings-and-comments.el
b/test/strings-and-comments-test.el
similarity index 89%
rename from test/test-strings-and-comments.el
rename to test/strings-and-comments-test.el
index 904805a..1cf1f02 100644
--- a/test/test-strings-and-comments.el
+++ b/test/strings-and-comments-test.el
@@ -1,9 +1,7 @@
(require 'ert)
-(require 'lua-font-lock-test-helpers
- ;; let's try a bit to help Emacs find the helpers, just in case
- (concat (file-name-directory (or load-file-name (buffer-file-name)
- default-directory))
- "lua-font-lock-test-helpers.el"))
+(load (concat (file-name-directory (or load-file-name (buffer-file-name)
+ default-directory))
+ "test-helper.el") nil 'nomessage 'nosuffix)
(defmacro should= (lhs rhs)
`(should (equal ,lhs ,rhs)))
diff --git a/test/lua-font-lock-test-helpers.el b/test/test-helper.el
similarity index 98%
rename from test/lua-font-lock-test-helpers.el
rename to test/test-helper.el
index 32a44ec..6c1a87e 100644
--- a/test/lua-font-lock-test-helpers.el
+++ b/test/test-helper.el
@@ -1,3 +1,4 @@
+(require 'ert)
(require 'lua-mode)
(defun get-str-faces (str)
@@ -96,6 +97,3 @@ This is a mere typing/reading aid for lua-mode's font-lock
tests."
(indent-tabs-mode nil))
(should
(equal strs (lua-get-indented-strs strs)))))
-
-
-(provide 'lua-font-lock-test-helpers)
- [nongnu] elpa/lua-mode d0fa50d 217/468: lua-make-delimited-matcher: wrap into eval-and-compile, (continued)
- [nongnu] elpa/lua-mode d0fa50d 217/468: lua-make-delimited-matcher: wrap into eval-and-compile, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode b684790 219/468: Revert "Rename lua--function-name-rx, use it in font-lock keywords init", Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 8e19d23 231/468: Add basic indentation tests, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 6729533 234/468: Rewrite lua-send-buffer function (should fix issue #60), Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode afc1ea0 235/468: Send init-code in lua-start-process, enable compilation-shell-minor-mode, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 1ede907 242/468: Fix several cases for `indent-new-comment-line' (M-j), Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 6c55abb 245/468: Add lua-rx/-to-string wrappers to simplify writing Lua-specific regexps, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 1452f8e 244/468: should-lua-indent: accept strings rather than lists to simplify writing tests, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode a0f3a6f 250/468: Simplify font-lock & imenu regexps with lua-rx, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode e430d01 252/468: Remove deprecated test code from test/, put current code there instead, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 1d21a10 259/468: Reorganize test structure,
Philip Kaludercic <=
- [nongnu] elpa/lua-mode dc55356 261/468: lua-forward-regexp: make sure direction is `forward', Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 0a986f7 266/468: Add hideshow support for "repeat... until" blocks, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 8d27d2c 268/468: fixed up tests && improved lua-kill-process, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 82daeb5 297/468: Merge pull request #88 from tarsius/master, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 7b2c18c 305/468: Merge pull request #99 from tarsius/master, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 6f4035a 315/468: Merge pull request #108 from ptrv/patch-1, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode f2915c3 324/468: Add string tab escape test, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 652e299 339/468: gitignore: add cask working dir, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode adb1f3a 334/468: lua_loadstring: fix variables that were made global, Philip Kaludercic, 2021/08/05
- [nongnu] elpa/lua-mode 191eb10 330/468: Makefile: add "nocask" targets, Philip Kaludercic, 2021/08/05