branch: externals/debbugs commit a978cdf56efb9138f82b4326998ce87ab50bb207 Author: Michael Albinus <michael.albi...@gmx.de> Commit: Michael Albinus <michael.albi...@gmx.de>
Fix some minor nits from last commit * Makefile (all): New target. (.PHONY): Add all and build. (check): Use @$(EMACS). * test/debbugs-tests.el (debbugs-test--bug-status-soap-return) (debbugs-test--bug-status, debbugs-test-get-bugs) (debbugs-test-newest-bugs, debbugs-test-get-status) (debbugs-test-get-usertag): Add docstring. (debbugs-test--soap-invoke-internal): Fix docstring. --- Makefile | 6 ++++-- test/debbugs-tests.el | 18 ++++++++++++------ 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 86cc575a2b..7d2975dedc 100644 --- a/Makefile +++ b/Makefile @@ -5,16 +5,18 @@ TESTSOURCE=$(wildcard test/*.el) TARGET=$(patsubst %.el,%.elc,$(SOURCE)) TESTTARGET=$(patsubst %.el,%.elc,$(TESTSOURCE)) -.PHONY: check clean +.PHONY: all build check clean .PRECIOUS: %.elc %.elc: %.el @$(EMACS) -Q -batch -L . -f batch-byte-compile $< +all: build + build: $(TARGET) check: build $(TESTTARGET) - emacs -Q --batch -L . -l $(TESTSOURCE) -f ert-run-tests-batch-and-exit + @$(EMACS) -Q --batch -L . -l $(TESTSOURCE) -f ert-run-tests-batch-and-exit clean: -rm -f $(TARGET) $(TESTTARGET) diff --git a/test/debbugs-tests.el b/test/debbugs-tests.el index e22aadc14d..b4ac9a69c4 100644 --- a/test/debbugs-tests.el +++ b/test/debbugs-tests.el @@ -49,7 +49,8 @@ (msgid . "<dm5pr03mb31632e3a4fe170c62e7d4b0cc5...@dm5pr03mb3163.namprd03.prod.outlook.com>") (bug_num . 64064) (subject . "[PATCH 0/4] debbugs improvements") - (fixed_date)))))) + (fixed_date))))) + "Mock result from `soap-invoke' for bug 64064.") ;; Generated using this: ;; (debbugs-get-status 64064) @@ -64,16 +65,16 @@ (fixed_versions) (id . 64064) (fixed) (found_date) (forwarded) (msgid . "<dm5pr03mb31632e3a4fe170c62e7d4b0cc5...@dm5pr03mb3163.namprd03.prod.outlook.com>") - (owner) (found_versions) (fixed_date) (bug_num . 64064)))) + (owner) (found_versions) (fixed_date) (bug_num . 64064))) + "Mock result from `debbugs-get-status' for bug 64064.") ;;; Helper Functions: (defvar debbugs-test--soap-operation-name nil) (defvar debbugs-test--soap-parameters nil) -(defun debbugs-test--soap-invoke-internal (callback _cbargs _wsdl _service - operation-name - &rest parameters) - "Over-ride for testing" +(defun debbugs-test--soap-invoke-internal + (callback _cbargs _wsdl _service operation-name &rest parameters) + "Over-ride for testing." (setq debbugs-test--soap-operation-name operation-name) (setq debbugs-test--soap-parameters parameters) (let ((return @@ -95,6 +96,7 @@ ;;; Tests: (ert-deftest debbugs-test-get-bugs () + "Test \"get_bugs\"." (let (debbugs-test--soap-operation-name debbugs-test--soap-parameters) (debbugs-get-bugs :tag "patch" @@ -107,12 +109,14 @@ "status" "open" "status" "forwarded"]))))) (ert-deftest debbugs-test-newest-bugs () + "Test \"newest_bugs\"." (let (debbugs-test--soap-operation-name debbugs-test--soap-parameters) (debbugs-newest-bugs 4) (should (string-equal debbugs-test--soap-operation-name "newest_bugs")) (should (equal debbugs-test--soap-parameters '(4))))) (ert-deftest debbugs-test-get-status () + "Test \"get_status\"." (let (debbugs-test--soap-operation-name debbugs-test--soap-parameters) (cl-letf (((symbol-function #'float-time) (lambda (&optional _specified-time) 5000))) @@ -123,10 +127,12 @@ (should (equal debbugs-test--soap-parameters '([64064])))))) (ert-deftest debbugs-test-get-usertag () + "Test \"get_usertag\"." (let (debbugs-test--soap-operation-name debbugs-test--soap-parameters) (should (equal (debbugs-get-usertag :user "emacs") '("hi"))) (should (string-equal debbugs-test--soap-operation-name "get_usertag")) (should (equal debbugs-test--soap-parameters '("emacs"))))) (provide 'debbugs-tests) + ;;; debbugs-tests.el ends here