[elpa] externals/pyim 6d1d93f: * pyim-candidates.el (pyim-candidates-search-buffer): Sort words by count.

2021-12-16 Thread ELPA Syncer
branch: externals/pyim
commit 6d1d93f22a07d51e5a78b3fe91d2107391fcbfed
Author: Feng Shu 
Commit: Feng Shu 

* pyim-candidates.el (pyim-candidates-search-buffer): Sort words by count.
---
 pyim-candidates.el  | 15 +++
 tests/pyim-tests.el | 28 +++-
 2 files changed, 14 insertions(+), 29 deletions(-)

diff --git a/pyim-candidates.el b/pyim-candidates.el
index c2ee97a..b3aba11 100644
--- a/pyim-candidates.el
+++ b/pyim-candidates.el
@@ -123,15 +123,22 @@ IMOBJS 获得候选词条。"
 (defun pyim-candidates-search-buffer (regexp)
   "在当前 buffer 中使用 REGEXP 搜索词条。"
   (save-excursion
-(let (words)
+(let ((counts (make-hash-table :test #'equal))
+  (time-limit 0.1)
+  words)
   (goto-char (point-min))
   (pyim-time-limit-while (and (not (input-pending-p))
-  (re-search-forward regexp nil t)) 0.1
+  (re-search-forward regexp nil t)) time-limit
 (let ((match (match-string-no-properties 0)))
   ;; NOTE: 单个汉字我觉得不值得收集。
   (when (>= (length match) 2)
-(cl-pushnew match words :test #'equal
-  words)))
+(if (member match words)
+(cl-incf (gethash match counts))
+  (push match words)
+  (puthash match 1 counts)
+  (sort words (lambda (a b)
+(> (or (gethash a counts) 0)
+   (or (gethash b counts) 0)))
 
 (defun pyim-candidates-create-quanpin (imobjs scheme-name &optional 
fast-search)
   "`pyim-candidates-create:quanpin' 内部使用的函数。"
diff --git a/tests/pyim-tests.el b/tests/pyim-tests.el
index 03acd9f..aba806a 100644
--- a/tests/pyim-tests.el
+++ b/tests/pyim-tests.el
@@ -349,31 +349,9 @@
 ;; ** pyim-candidates 相关单元测试
 (ert-deftest pyim-tests-pyim-candidates-search-buffer ()
   (with-temp-buffer
-(insert "
-一日,正当嗟悼之际,俄见一僧一道远远而来,生得骨格不凡,丰神迥别,说说
-笑笑,来至峰下,坐于石边,高谈快论:先是说些云山雾海、神仙玄幻之事,后
-便说到红尘中荣华富贵。此石听了,不觉打动凡心,也想要到人间去享一享这荣
-华富贵,但自恨粗蠢,不得已,便口吐人言,向那僧道说道:“大师,弟子蠢物,
-不能见礼了!适闻二位谈那人世间荣耀繁华,心切慕之。弟子质虽粗蠢,性却稍
-通,况见二师仙形道体,定非凡品,必有补天济世之材,利物济人之德。如蒙发
-一点慈心,携带弟子得入红尘,在那富贵场中,温柔乡里受享几年,自当永佩洪
-恩,万劫不忘也!”二仙师听毕,齐憨笑道:“善哉,善哉!那红尘中有却有些乐
-事,但不能永远依恃;况又有‘美中不足,好事多磨’八个字紧相连属,瞬息间则
-又乐极悲生,人非物换,究竟是到头一梦,万境归空,倒不如不去的好。”这石
-凡心已炽,那里听得进这话去,乃复苦求再四。二仙知不可强制,乃叹道:“此
-亦静极思动,无中生有之数也!既如此,我们便携你去受享受享,只是到不得意
-时,切莫后悔!”石道:“自然,自然。”那僧又道:“若说你性灵,却又如此质蠢,
-并更无奇贵之处。如此也只好踮脚而已。也罢!我如今大施佛法,助你助,待劫
-终之日,复还本质,以了此案。你道好否?”石头听了,感谢不尽。那僧便念咒
-书符,大展幻术,将一块大石登时变成一块鲜明莹洁的美玉,且又缩成扇坠大小
-的可佩可拿。那僧托于掌上,笑道:“形体倒也是个宝物了!还只没有实在的好
-处,须得再镌上数字,使人一见便知是奇物方妙。然后好携你到那昌明隆盛之邦、
-诗礼簪缨之族、花柳繁华地、温柔富贵乡去安身乐业。”石头听了,喜不能禁,
-乃问:“不知赐了弟子那哪几件奇处?又不知携了弟子到何地方?望乞明示,使
-弟子不惑。”那僧笑道:“你且莫问,日后自然明白的。”说着,便袖了这石,同
-那道人飘然而去,竟不知投奔何方何舍。")
-(should (equal (pyim-candidates-search-buffer (pyim-cregexp-build "hs" 3 
t))
-   '("何舍" "幻术" "好事")
+(insert "你好你好你坏你坏你话牛蛤牛和牛蛤牛蛤牛蛤牛蛤牛蛤")
+(should (equal (pyim-candidates-search-buffer (pyim-cregexp-build "nh" 3 
t))
+   '("牛蛤" "你坏" "你好" "牛和" "你话")
 
 ;; ** pyim-cstring 相关单元测试
 (ert-deftest pyim-tests-pyim-cstring-partition ()



[elpa] externals/org 325b06b 2/3: org-element-cache: Do not carry over warning after sync

2021-12-16 Thread ELPA Syncer
branch: externals/org
commit 325b06bde4496a8f228bc0791174db1aec1d7c39
Author: Ihor Radchenko 
Commit: Ihor Radchenko 

org-element-cache: Do not carry over warning after sync

* lisp/org-element.el (org-element--cache-sync): Set
`org-element--cache-warning' to nil at the end of synchronisation.
We do not need to consider that next request might be merged with
existing request in such scenario.
(org-element--cache-before-change): Add comment explaining the use of 
`org-element--cache-warning'.
---
 lisp/org-element.el | 12 
 1 file changed, 12 insertions(+)

diff --git a/lisp/org-element.el b/lisp/org-element.el
index 9b52372..d2e493c 100644
--- a/lisp/org-element.el
+++ b/lisp/org-element.el
@@ -5932,6 +5932,7 @@ The buffer is: %s\n Current command: %S\n Chars modified: 
%S\n Buffer modified:
  ;; Otherwise, reset keys.
  (if org-element--cache-sync-requests
  (org-element--cache-set-timer buffer)
+(setq org-element--cache-change-warning nil)
 (setq org-element--cache-sync-keys-value (1+ 
org-element--cache-sync-keys-value
 
 (defun org-element--cache-process-request
@@ -6533,6 +6534,17 @@ The function returns the new value of 
`org-element--cache-change-warning'."
end
  (line-end-position)
  (prog1
+ ;; Use the worst change warning to not miss important edits.
+ ;; This function is called before edit and after edit by
+ ;; `org-element--cache-after-change'.  Before the edit, we still
+ ;; want to use the old value if it comes from previous
+ ;; not yet processed edit (they may be merged by
+ ;; `org-element--cache-submit-request').  After the edit, we want 
to
+ ;; look if there was a sensitive removed during edit.
+ ;; FIXME: This is not the most efficient way and we now
+ ;; have to delete more elemetns than needed in some
+ ;; cases.  A better approach may be storing the warning
+ ;; in the modification request itself.
  (let ((org-element--cache-change-warning-before 
org-element--cache-change-warning)
(org-element--cache-change-warning-after))
(setq org-element--cache-change-warning-after



[elpa] externals-release/org 7ec9e37: org-tree-to-indirect-buffer: Fix when last headline is empty at point-max

2021-12-16 Thread ELPA Syncer
branch: externals-release/org
commit 7ec9e371177909f4af8b6d3c073a9dd5e3a39d18
Author: Ihor Radchenko 
Commit: Ihor Radchenko 

org-tree-to-indirect-buffer: Fix when last headline is empty at point-max

* lisp/org.el (org-tree-to-indirect-buffer): Consider scenario when
`org-end-of-subtree' with 't second arg moves to `point-max' at the
end of an empty headline.  We do not need to move back the point then.

Fixes 
https://orgmode.org/list/CA+AFVDUF3RzA-mnoAp8yFv-bppoYJfJo=wa8qmnqhv-tfhh...@mail.gmail.com
---
 lisp/org.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/org.el b/lisp/org.el
index 00bbc07..f784369 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -6905,7 +6905,7 @@ frame is not changed."
   (setq beg (point)
heading (org-get-heading 'no-tags))
   (org-end-of-subtree t t)
-  (when (org-at-heading-p) (backward-char 1))
+  (when (and (not (eobp)) (org-at-heading-p)) (backward-char 1))
   (setq end (point)))
 (when (and (buffer-live-p org-last-indirect-buffer)
   (not (eq org-indirect-buffer-display 'new-frame))



[elpa] externals/org updated (f0c474e -> de022ed)

2021-12-16 Thread ELPA Syncer
elpasync pushed a change to branch externals/org.

  from  f0c474e   test-org-element: Add new tests for org-element-cache
   new  d267486   org-element-cache: Fix some edits right after indent at 
:begin
   new  325b06b   org-element-cache: Do not carry over warning after sync
   new  7ec9e37   org-tree-to-indirect-buffer: Fix when last headline is 
empty at point-max
   new  de022ed   Merge branch 'bugfix'


Summary of changes:
 lisp/org-element.el  | 21 +
 lisp/org.el  |  2 +-
 testing/lisp/test-org-element.el |  9 +
 3 files changed, 31 insertions(+), 1 deletion(-)



[elpa] externals/org d267486 1/3: org-element-cache: Fix some edits right after indent at :begin

2021-12-16 Thread ELPA Syncer
branch: externals/org
commit d26748600229213acb806c0c7683e3c6595d7f94
Author: Ihor Radchenko 
Commit: Ihor Radchenko 

org-element-cache: Fix some edits right after indent at :begin

* lisp/org-element.el (org-element--cache-after-change): Extend
changed region to bol when we are editing near beginning of an element
within or right after indentation.  Such edits potentially change
:post-blank value of the previous element.
* testing/lisp/test-org-element.el (test-org-element/cache): Add test
checking one of such cases.
---
 lisp/org-element.el  | 9 +
 testing/lisp/test-org-element.el | 9 +
 2 files changed, 18 insertions(+)

diff --git a/lisp/org-element.el b/lisp/org-element.el
index 4ed2408..9b52372 100644
--- a/lisp/org-element.el
+++ b/lisp/org-element.el
@@ -6585,6 +6585,15 @@ that range.  See `after-change-functions' for more 
information."
   (when (not (eq org-element--cache-change-tic 
(buffer-chars-modified-tick)))
 (org-element--cache-log-message "After change")
 (setq org-element--cache-change-warning 
(org-element--cache-before-change beg end))
+;; If beg is right after spaces in front of an element, we
+;; risk affecting previous element, so move beg to bol, making
+;; sure that we capture preceding element.
+(setq beg (save-excursion
+(goto-char beg)
+(skip-chars-backward " \t")
+(if (not (bolp)) beg
+  (cl-incf pre (- beg (point)))
+  (point
 ;; Store synchronization request.
 (let ((offset (- end beg pre)))
   (save-match-data
diff --git a/testing/lisp/test-org-element.el b/testing/lisp/test-org-element.el
index 0f66d6c..83a96e1 100644
--- a/testing/lisp/test-org-element.el
+++ b/testing/lisp/test-org-element.el
@@ -4004,6 +4004,15 @@ Text
 (equal (cons (org-element-property :begin element)
  (org-element-property :end element))
(cons (point-min) (point-max)))
+  (org-test-with-temp-text ":DRAWER:\ntest\n:END:\n #\nParagraph"
+(let ((org-element-use-cache t))
+  (org-element-cache-map #'ignore :granularity 'element)
+  (should (eq 'comment (org-element-type (org-element-at-point
+  (should (eq 0 (org-element-property :post-blank (org-element-at-point 
(point-min)
+  (insert " ") (delete-char -1)
+  (org-element-cache-map #'ignore :granularity 'element)
+  (delete-char 1)
+  (should (eq 1 (org-element-property :post-blank (org-element-at-point 
(point-min)))
   ;; Sensitive change: adding a line alters document structure both
   ;; above and below.
   (should



[elpa] externals/org de022ed 3/3: Merge branch 'bugfix'

2021-12-16 Thread ELPA Syncer
branch: externals/org
commit de022ed6542e28406b148b051fbdaae0a459175a
Merge: 325b06b 7ec9e37
Author: Ihor Radchenko 
Commit: Ihor Radchenko 

Merge branch 'bugfix'
---
 lisp/org.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/org.el b/lisp/org.el
index 1295ae2..ce4e08e 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -6924,7 +6924,7 @@ frame is not changed."
   (setq beg (point)
heading (org-get-heading 'no-tags))
   (org-end-of-subtree t t)
-  (when (org-at-heading-p) (backward-char 1))
+  (when (and (not (eobp)) (org-at-heading-p)) (backward-char 1))
   (setq end (point)))
 (when (and (buffer-live-p org-last-indirect-buffer)
   (not (eq org-indirect-buffer-display 'new-frame))



[elpa] externals/org 092e921 2/2: org-element-cache-map: Fix when start is nil after buffer modification

2021-12-16 Thread ELPA Syncer
branch: externals/org
commit 092e921423f02d48778a0c5d298a211388af8090
Author: Ihor Radchenko 
Commit: Ihor Radchenko 

org-element-cache-map: Fix when start is nil after buffer modification
---
 lisp/org-element.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/org-element.el b/lisp/org-element.el
index 1c37f79..2106f56 100644
--- a/lisp/org-element.el
+++ b/lisp/org-element.el
@@ -7507,7 +7507,7 @@ the cache."
  (eq cache-size (cache-size)))
   ;; START may no longer be valid, update
   ;; it to beginning of real element.
-  (goto-char start)
+  (when start (goto-char start))
   ;; Upon modification, START may lay
   ;; inside an element.  We want to move
   ;; it to real beginning then despite



[elpa] externals/org updated (de022ed -> 092e921)

2021-12-16 Thread ELPA Syncer
elpasync pushed a change to branch externals/org.

  from  de022ed   Merge branch 'bugfix'
   new  3338f37   org-element--cache-process-request: Fix format specifier 
allowing marker
   new  092e921   org-element-cache-map: Fix when start is nil after buffer 
modification


Summary of changes:
 lisp/org-element.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)



[elpa] externals/org 3338f37 1/2: org-element--cache-process-request: Fix format specifier allowing marker

2021-12-16 Thread ELPA Syncer
branch: externals/org
commit 3338f37061a8de1b5cf8ac3f85e6a2146ebddd83
Author: Ihor Radchenko 
Commit: Ihor Radchenko 

org-element--cache-process-request: Fix format specifier allowing marker

Fixes 
https://list.orgmode.org/CAFyQvY2=M6-JO7k=df74injm7khccgugdcczxm6tzpwdtgb...@mail.gmail.com/T/#t
---
 lisp/org-element.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/org-element.el b/lisp/org-element.el
index d2e493c..1c37f79 100644
--- a/lisp/org-element.el
+++ b/lisp/org-element.el
@@ -6247,7 +6247,7 @@ completing the request."
;; Cache is up-to-date past THRESHOLD.  Request
;; interruption.
(when (and threshold (> begin threshold))
-  (org-element--cache-log-message "Reached threshold %d: %S"
+  (org-element--cache-log-message "Reached threshold %S: %S"
   threshold
   (org-element--format-element 
data))
   (setq exit-flag t



[nongnu] elpa/git-commit updated (65c4485 -> 7b19ac5)

2021-12-16 Thread ELPA Syncer
elpasync pushed a change to branch elpa/git-commit.

  from  65c4485   magit-current-blame-chunk: Don't try to operate in Dired 
buffers
   new  337a190   Rename Documentation/ to docs/
   new  b28207a   Rename t/ to test/
   new  3d7d353   make: Update stats target
   new  7c46e1c   make: Set more variables in default.mk
   new  7b19ac5   AUTHORS.md: Update list of contributors


Summary of changes:
 .gitignore  | 24 ++---
 Makefile| 55 +
 RelNotes.org|  2 +-
 default.mk  |  9 +++--
 {Documentation => docs}/AUTHORS.md  |  2 ++
 {Documentation => docs}/BACKERS.md  |  0
 {Documentation => docs}/Makefile| 13 ---
 {Documentation => docs}/RelNotes/0.5.1.txt  |  0
 {Documentation => docs}/RelNotes/0.6.1.txt  |  0
 {Documentation => docs}/RelNotes/0.7.0.txt  |  0
 {Documentation => docs}/RelNotes/0.8.0.txt  |  0
 {Documentation => docs}/RelNotes/0.8.1.txt  |  0
 {Documentation => docs}/RelNotes/0.8.2.txt  |  0
 {Documentation => docs}/RelNotes/1.0.0.txt  |  0
 {Documentation => docs}/RelNotes/1.1.0.txt  |  0
 {Documentation => docs}/RelNotes/1.1.1.txt  |  0
 {Documentation => docs}/RelNotes/1.1.2.txt  |  0
 {Documentation => docs}/RelNotes/1.2.0.txt  |  0
 {Documentation => docs}/RelNotes/1.2.1.txt  |  0
 {Documentation => docs}/RelNotes/1.2.2.txt  |  0
 {Documentation => docs}/RelNotes/1.4.0.txt  |  0
 {Documentation => docs}/RelNotes/1.4.1.txt  |  0
 {Documentation => docs}/RelNotes/1.4.2.txt  |  0
 {Documentation => docs}/RelNotes/2.1.0.txt  |  0
 {Documentation => docs}/RelNotes/2.10.0.txt |  0
 {Documentation => docs}/RelNotes/2.10.1.txt |  0
 {Documentation => docs}/RelNotes/2.10.2.txt |  0
 {Documentation => docs}/RelNotes/2.10.3.txt |  0
 {Documentation => docs}/RelNotes/2.11.0.txt |  0
 {Documentation => docs}/RelNotes/2.12.0.txt |  0
 {Documentation => docs}/RelNotes/2.12.1.txt |  0
 {Documentation => docs}/RelNotes/2.13.0.txt |  0
 {Documentation => docs}/RelNotes/2.13.1.txt |  0
 {Documentation => docs}/RelNotes/2.2.0.txt  |  0
 {Documentation => docs}/RelNotes/2.2.1.txt  |  0
 {Documentation => docs}/RelNotes/2.2.2.txt  |  0
 {Documentation => docs}/RelNotes/2.3.0.txt  |  0
 {Documentation => docs}/RelNotes/2.3.1.txt  |  0
 {Documentation => docs}/RelNotes/2.4.0.txt  |  0
 {Documentation => docs}/RelNotes/2.4.1.txt  |  0
 {Documentation => docs}/RelNotes/2.5.0.txt  |  0
 {Documentation => docs}/RelNotes/2.6.0.txt  |  0
 {Documentation => docs}/RelNotes/2.6.1.txt  |  0
 {Documentation => docs}/RelNotes/2.6.2.txt  |  0
 {Documentation => docs}/RelNotes/2.7.0.txt  |  0
 {Documentation => docs}/RelNotes/2.8.0.txt  |  0
 {Documentation => docs}/RelNotes/2.9.0.txt  |  0
 {Documentation => docs}/RelNotes/2.90.0.org |  0
 {Documentation => docs}/RelNotes/2.90.1.org |  0
 {Documentation => docs}/RelNotes/3.0.0.org  |  0
 {Documentation => docs}/RelNotes/3.1.0.org  |  0
 {Documentation => docs}/RelNotes/3.2.0.org  |  0
 {Documentation => docs}/RelNotes/3.2.1.org  |  0
 {Documentation => docs}/RelNotes/3.3.0.org  |  0
 {Documentation => docs}/RelNotes/3.4.0.org  |  0
 {Documentation => docs}/htmlxref.cnf|  0
 {Documentation => docs}/magit-section.org   |  0
 {Documentation => docs}/magit-section.texi  |  0
 {Documentation => docs}/magit.org   |  0
 {Documentation => docs}/magit.texi  |  0
 test/Makefile   | 14 
 {t => test}/magit-tests.el  |  0
 62 files changed, 67 insertions(+), 52 deletions(-)
 rename {Documentation => docs}/AUTHORS.md (99%)
 rename {Documentation => docs}/BACKERS.md (100%)
 rename {Documentation => docs}/Makefile (96%)
 rename {Documentation => docs}/RelNotes/0.5.1.txt (100%)
 rename {Documentation => docs}/RelNotes/0.6.1.txt (100%)
 rename {Documentation => docs}/RelNotes/0.7.0.txt (100%)
 rename {Documentation => docs}/RelNotes/0.8.0.txt (100%)
 rename {Documentation => docs}/RelNotes/0.8.1.txt (100%)
 rename {Documentation => docs}/RelNotes/0.8.2.txt (100%)
 rename {Documentation => docs}/RelNotes/1.0.0.txt (100%)
 rename {Documentation => docs}/RelNotes/1.1.0.txt (100%)
 rename {Documentation => docs}/RelNotes/1.1.1.txt (100%)
 rename {Documentation => docs}/RelNotes/1.1.2.txt (100%)
 rename {Documentation => docs}/RelNotes/1.2.0.txt (100%)
 rename {Documentation => docs}/RelNotes/1.2.1.txt (100%)
 rename {Documentation => docs}/RelNotes/1.2.2.txt (100%)
 rename {Documentation => docs}/RelNotes/1.4.0.txt (100%)
 rename {Documentation => docs}/RelNotes/1.4.1.txt (100%)
 rename {Documentation => docs}/RelNotes/1.4.2.txt (100%)
 rename {Documentation => docs}/RelNotes/2.1.0.txt (100%)
 rename {Documentation => docs}/RelNotes/2.10.0.txt (100%)
 rename {Documentation => docs}/RelNotes/2.10.1.txt (100%)
 rename {Documentation => docs}/RelNotes/2.10.2.txt (100%)
 rename {Documentation => docs}/RelN

[nongnu] elpa/git-commit b28207a 2/5: Rename t/ to test/

2021-12-16 Thread ELPA Syncer
branch: elpa/git-commit
commit b28207aee1f17083150dfba5a58ab9c1b1ef8735
Author: Jonas Bernoulli 
Commit: Jonas Bernoulli 

Rename t/ to test/
---
 Makefile   |  9 ++---
 test/Makefile  | 14 ++
 {t => test}/magit-tests.el |  0
 3 files changed, 16 insertions(+), 7 deletions(-)

diff --git a/Makefile b/Makefile
index db6ae0c..f81722c 100644
--- a/Makefile
+++ b/Makefile
@@ -107,15 +107,10 @@ install-info: info
 ## Test ##
 
 test:
-   @$(BATCH) --eval "(progn\
-$$suppress_warnings\
-   (load-file \"t/magit-tests.el\")\
-   (ert-run-tests-batch-and-exit))"
+   @$(MAKE) -C test test
 
 test-interactive:
-   @$(EMACSBIN) -Q $(LOAD_PATH) --eval "(progn\
-   (load-file \"t/magit-tests.el\")\
-   (ert t))"
+   @$(MAKE) -C test test-interactive
 
 emacs-Q: clean-lisp
@$(EMACSBIN) -Q $(LOAD_PATH) --debug-init --eval "(progn\
diff --git a/test/Makefile b/test/Makefile
new file mode 100644
index 000..5c8d3cb
--- /dev/null
+++ b/test/Makefile
@@ -0,0 +1,14 @@
+-include ../config.mk
+include ../default.mk
+
+test:
+   @printf "Testing...\n"
+   @$(BATCH) --eval "(progn\
+   $$suppress_warnings\
+   (load-file \"$(TOP)test/magit-tests.el\")\
+   (ert-run-tests-batch-and-exit))"
+
+test-interactive:
+   @$(EMACSBIN) -Q $(LOAD_PATH) --eval "(progn\
+   (load-file \"$(TOP)test/magit-tests.el\")\
+   (ert t))"
diff --git a/t/magit-tests.el b/test/magit-tests.el
similarity index 100%
rename from t/magit-tests.el
rename to test/magit-tests.el



[nongnu] elpa/git-commit 3d7d353 3/5: make: Update stats target

2021-12-16 Thread ELPA Syncer
branch: elpa/git-commit
commit 3d7d353ad546f47ce91103d5da46e847b00d3a19
Author: Jonas Bernoulli 
Commit: Jonas Bernoulli 

make: Update stats target
---
 default.mk| 7 ---
 docs/Makefile | 6 +++---
 2 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/default.mk b/default.mk
index b5abc1d..6faced9 100644
--- a/default.mk
+++ b/default.mk
@@ -19,8 +19,6 @@ lispdir  ?= $(sharedir)/emacs/site-lisp/magit
 infodir  ?= $(sharedir)/info
 docdir   ?= $(sharedir)/doc/magit
 
-STATSDIR ?= $(TOP)docs/stats
-
 CP   ?= install -p -m 644
 MKDIR?= install -p -m 755 -d
 RMDIR?= rm -rf
@@ -34,6 +32,9 @@ INSTALL_INFO ?= $(shell command -v ginstall-info || 
printf install-info)
 MAKEINFO ?= makeinfo
 MANUAL_HTML_ARGS ?= --css-ref /assets/page.css
 
+GITSTATS_DIR  ?= $(TOP)docs/stats
+GITSTATS_ARGS ?= -c style=https://magit.vc/assets/stats.css -c max_authors=999
+
 BUILD_MAGIT_LIBGIT ?= true
 
 ## Files #
@@ -175,7 +176,7 @@ WITH_EDITOR_DIR ?= $(shell \
   find -L $(ELPA_DIR) -maxdepth 1 -regex '.*/with-editor-[.0-9]*' 2> /dev/null 
| \
   sort | tail -n 1)
 ifeq "$(WITH_EDITOR_DIR)" ""
-  WITH_EDITOR_DIR = $(TOP)../with-editor
+  WITH_EDITOR_DIR = $(TOP)../with-editor/lisp
 endif
 
 MAGIT_SECTION_DIR ?= $(shell \
diff --git a/docs/Makefile b/docs/Makefile
index 00ce2cd..0306cf7 100644
--- a/docs/Makefile
+++ b/docs/Makefile
@@ -82,7 +82,7 @@ clean:
@$(RMDIR) $(EPUBFILES) $(EPUBTRASH)
 
 clean-stats:
-   @$(RMDIR) $(statsdir)
+   @$(RMDIR) $(GENSTATS_DIR)
 
 ## Release management 
 
@@ -110,7 +110,7 @@ texi:
 
 stats:
@printf "Generating statistics\n"
-   @gitstats -c style=https://magit.vc/assets/stats.css -c max_authors=999 
$(TOP) $(STATSDIR)
+   @gitstats $(GITSTATS_ARGS) $(TOP) $(GITSTATS_DIR)
 
 authors: AUTHORS.md
 
@@ -139,7 +139,7 @@ space := $(empty) $(empty)
 
 publish-stats: stats
@printf "Uploading statistics...\n"
-   @aws s3 sync $(STATSDIR) $(S3_BUCKET)/stats/
+   @aws s3 sync $(GITSTATS_DIR) $(S3_BUCKET)/stats/
@printf "Uploaded to $(PUBLISH_URL)/stats/\n"
@printf "Generating CDN invalidation\n"
@aws cloudfront create-invalidation \



[nongnu] elpa/git-commit 7c46e1c 4/5: make: Set more variables in default.mk

2021-12-16 Thread ELPA Syncer
branch: elpa/git-commit
commit 7c46e1c2c5588979b7e420460b8b11a118f90114
Author: Jonas Bernoulli 
Commit: Jonas Bernoulli 

make: Set more variables in default.mk
---
 default.mk| 3 +++
 docs/Makefile | 4 
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/default.mk b/default.mk
index 6faced9..ca8e850 100644
--- a/default.mk
+++ b/default.mk
@@ -223,6 +223,9 @@ endif
 
 ## Publish ###
 
+DOMAIN  ?= magit.vc
+CFRONT_DIST ?= E2LUHBKU1FBV02
+
 PUBLISH_TARGETS ?= html html-dir pdf epub
 
 DOCBOOK_XSL ?= /usr/share/xml/docbook/stylesheet/docbook-xsl/epub/docbook.xsl
diff --git a/docs/Makefile b/docs/Makefile
index 0306cf7..5a34862 100644
--- a/docs/Makefile
+++ b/docs/Makefile
@@ -122,15 +122,11 @@ AUTHORS.md:
&& printf "done\n" ; ) \
|| printf "FAILED (non-fatal)\n"
 
-DOMAIN ?= magit.vc
 PUBLISH_PATH   ?= /manual/
 RELEASE_PATH   ?= /manual/$(VERSION)/
-
 S3_BUCKET  ?= s3://$(DOMAIN)
 PUBLISH_TARGET  = $(S3_BUCKET)$(PUBLISH_PATH)
 RELEASE_TARGET  = $(S3_BUCKET)$(RELEASE_PATH)
-
-CFRONT_DIST?= E2LUHBKU1FBV02
 CFRONT_PATHS= $(PKG).html $(PKG).pdf $(PKG)/*
 
 comma := ,



[nongnu] elpa/git-commit 7b19ac5 5/5: AUTHORS.md: Update list of contributors

2021-12-16 Thread ELPA Syncer
branch: elpa/git-commit
commit 7b19ac53aaad5ac24e4daeece667ba097fed8363
Author: Jonas Bernoulli 
Commit: Jonas Bernoulli 

AUTHORS.md: Update list of contributors
---
 docs/AUTHORS.md | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/docs/AUTHORS.md b/docs/AUTHORS.md
index b907942..44343b6 100644
--- a/docs/AUTHORS.md
+++ b/docs/AUTHORS.md
@@ -78,6 +78,7 @@ Contributors
 - Bart Bakker 
 - Basil L. Contovounesios 
 - Bastian Beischer 
+- Bastian Beranek 
 - Benjamin Motz 
 - Ben North 
 - Ben Walton 
@@ -145,6 +146,7 @@ Contributors
 - Feng Li 
 - Florian Ragwitz 
 - Franklin Delehelle 
+- Frédéric Giquel 
 - Fritz Grabo 
 - Fritz Stelzer 
 - Geoff Shannon 



[nongnu] elpa/git-commit 337a190 1/5: Rename Documentation/ to docs/

2021-12-16 Thread ELPA Syncer
branch: elpa/git-commit
commit 337a190c1a49266864545facecddcb4a89eca035
Author: Jonas Bernoulli 
Commit: Jonas Bernoulli 

Rename Documentation/ to docs/
---
 .gitignore  | 24 +++
 Makefile| 46 ++---
 RelNotes.org|  2 +-
 default.mk  |  3 +-
 {Documentation => docs}/AUTHORS.md  |  0
 {Documentation => docs}/BACKERS.md  |  0
 {Documentation => docs}/Makefile|  9 --
 {Documentation => docs}/RelNotes/0.5.1.txt  |  0
 {Documentation => docs}/RelNotes/0.6.1.txt  |  0
 {Documentation => docs}/RelNotes/0.7.0.txt  |  0
 {Documentation => docs}/RelNotes/0.8.0.txt  |  0
 {Documentation => docs}/RelNotes/0.8.1.txt  |  0
 {Documentation => docs}/RelNotes/0.8.2.txt  |  0
 {Documentation => docs}/RelNotes/1.0.0.txt  |  0
 {Documentation => docs}/RelNotes/1.1.0.txt  |  0
 {Documentation => docs}/RelNotes/1.1.1.txt  |  0
 {Documentation => docs}/RelNotes/1.1.2.txt  |  0
 {Documentation => docs}/RelNotes/1.2.0.txt  |  0
 {Documentation => docs}/RelNotes/1.2.1.txt  |  0
 {Documentation => docs}/RelNotes/1.2.2.txt  |  0
 {Documentation => docs}/RelNotes/1.4.0.txt  |  0
 {Documentation => docs}/RelNotes/1.4.1.txt  |  0
 {Documentation => docs}/RelNotes/1.4.2.txt  |  0
 {Documentation => docs}/RelNotes/2.1.0.txt  |  0
 {Documentation => docs}/RelNotes/2.10.0.txt |  0
 {Documentation => docs}/RelNotes/2.10.1.txt |  0
 {Documentation => docs}/RelNotes/2.10.2.txt |  0
 {Documentation => docs}/RelNotes/2.10.3.txt |  0
 {Documentation => docs}/RelNotes/2.11.0.txt |  0
 {Documentation => docs}/RelNotes/2.12.0.txt |  0
 {Documentation => docs}/RelNotes/2.12.1.txt |  0
 {Documentation => docs}/RelNotes/2.13.0.txt |  0
 {Documentation => docs}/RelNotes/2.13.1.txt |  0
 {Documentation => docs}/RelNotes/2.2.0.txt  |  0
 {Documentation => docs}/RelNotes/2.2.1.txt  |  0
 {Documentation => docs}/RelNotes/2.2.2.txt  |  0
 {Documentation => docs}/RelNotes/2.3.0.txt  |  0
 {Documentation => docs}/RelNotes/2.3.1.txt  |  0
 {Documentation => docs}/RelNotes/2.4.0.txt  |  0
 {Documentation => docs}/RelNotes/2.4.1.txt  |  0
 {Documentation => docs}/RelNotes/2.5.0.txt  |  0
 {Documentation => docs}/RelNotes/2.6.0.txt  |  0
 {Documentation => docs}/RelNotes/2.6.1.txt  |  0
 {Documentation => docs}/RelNotes/2.6.2.txt  |  0
 {Documentation => docs}/RelNotes/2.7.0.txt  |  0
 {Documentation => docs}/RelNotes/2.8.0.txt  |  0
 {Documentation => docs}/RelNotes/2.9.0.txt  |  0
 {Documentation => docs}/RelNotes/2.90.0.org |  0
 {Documentation => docs}/RelNotes/2.90.1.org |  0
 {Documentation => docs}/RelNotes/3.0.0.org  |  0
 {Documentation => docs}/RelNotes/3.1.0.org  |  0
 {Documentation => docs}/RelNotes/3.2.0.org  |  0
 {Documentation => docs}/RelNotes/3.2.1.org  |  0
 {Documentation => docs}/RelNotes/3.3.0.org  |  0
 {Documentation => docs}/RelNotes/3.4.0.org  |  0
 {Documentation => docs}/htmlxref.cnf|  0
 {Documentation => docs}/magit-section.org   |  0
 {Documentation => docs}/magit-section.texi  |  0
 {Documentation => docs}/magit.org   |  0
 {Documentation => docs}/magit.texi  |  0
 60 files changed, 44 insertions(+), 40 deletions(-)

diff --git a/.gitignore b/.gitignore
index dc67577..0c895e9 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,18 +2,18 @@
 *~
 /*.tar
 /*.tar.gz
-/Documentation/*.epub
-/Documentation/*.html
-/Documentation/*.info
-/Documentation/*.pdf
-/Documentation/META-INF/
-/Documentation/OEBPS/
-/Documentation/dir
-/Documentation/epub.xml
-/Documentation/magit/
-/Documentation/magit-section/
-/Documentation/mimetype
-/Documentation/stats/
 /config.mk
+/docs/*.epub
+/docs/*.html
+/docs/*.info
+/docs/*.pdf
+/docs/META-INF/
+/docs/OEBPS/
+/docs/dir
+/docs/epub.xml
+/docs/magit/
+/docs/magit-section/
+/docs/mimetype
+/docs/stats/
 /lisp/magit-autoloads.el
 /lisp/magit-version.el
diff --git a/Makefile b/Makefile
index 0481f02..db6ae0c 100644
--- a/Makefile
+++ b/Makefile
@@ -74,22 +74,22 @@ lisp:
@$(MAKE) -C lisp lisp
 
 docs:
-   @$(MAKE) -C Documentation all
+   @$(MAKE) -C docs all
 
 info:
-   @$(MAKE) -C Documentation info
+   @$(MAKE) -C docs info
 
 html:
-   @$(MAKE) -C Documentation html
+   @$(MAKE) -C docs html
 
 html-dir:
-   @$(MAKE) -C Documentation html-dir
+   @$(MAKE) -C docs html-dir
 
 pdf:
-   @$(MAKE) -C Documentation pdf
+   @$(MAKE) -C docs pdf
 
 epub:
-   @$(MAKE) -C Documentation epub
+   @$(MAKE) -C docs epub
 
 ## Install ###
 
@@ -99,10 +99,10 @@ install-lisp: lisp
@$(MAKE) -C lisp install
 
 install-docs: docs
-   @$(MAKE) -C Documentation install-docs
+   @$(MAKE) -C docs install-docs
 
 install-info: info
-   @$(MAKE) -C Documentation install-info
+   @$(MAKE) -C docs install-info
 
 ## Test #

[nongnu] elpa/magit updated (65c4485 -> 7b19ac5)

2021-12-16 Thread ELPA Syncer
elpasync pushed a change to branch elpa/magit.

  from  65c4485   magit-current-blame-chunk: Don't try to operate in Dired 
buffers
  adds  337a190   Rename Documentation/ to docs/
  adds  b28207a   Rename t/ to test/
  adds  3d7d353   make: Update stats target
  adds  7c46e1c   make: Set more variables in default.mk
  adds  7b19ac5   AUTHORS.md: Update list of contributors

No new revisions were added by this update.

Summary of changes:
 .gitignore  | 24 ++---
 Makefile| 55 +
 RelNotes.org|  2 +-
 default.mk  |  9 +++--
 {Documentation => docs}/AUTHORS.md  |  2 ++
 {Documentation => docs}/BACKERS.md  |  0
 {Documentation => docs}/Makefile| 13 ---
 {Documentation => docs}/RelNotes/0.5.1.txt  |  0
 {Documentation => docs}/RelNotes/0.6.1.txt  |  0
 {Documentation => docs}/RelNotes/0.7.0.txt  |  0
 {Documentation => docs}/RelNotes/0.8.0.txt  |  0
 {Documentation => docs}/RelNotes/0.8.1.txt  |  0
 {Documentation => docs}/RelNotes/0.8.2.txt  |  0
 {Documentation => docs}/RelNotes/1.0.0.txt  |  0
 {Documentation => docs}/RelNotes/1.1.0.txt  |  0
 {Documentation => docs}/RelNotes/1.1.1.txt  |  0
 {Documentation => docs}/RelNotes/1.1.2.txt  |  0
 {Documentation => docs}/RelNotes/1.2.0.txt  |  0
 {Documentation => docs}/RelNotes/1.2.1.txt  |  0
 {Documentation => docs}/RelNotes/1.2.2.txt  |  0
 {Documentation => docs}/RelNotes/1.4.0.txt  |  0
 {Documentation => docs}/RelNotes/1.4.1.txt  |  0
 {Documentation => docs}/RelNotes/1.4.2.txt  |  0
 {Documentation => docs}/RelNotes/2.1.0.txt  |  0
 {Documentation => docs}/RelNotes/2.10.0.txt |  0
 {Documentation => docs}/RelNotes/2.10.1.txt |  0
 {Documentation => docs}/RelNotes/2.10.2.txt |  0
 {Documentation => docs}/RelNotes/2.10.3.txt |  0
 {Documentation => docs}/RelNotes/2.11.0.txt |  0
 {Documentation => docs}/RelNotes/2.12.0.txt |  0
 {Documentation => docs}/RelNotes/2.12.1.txt |  0
 {Documentation => docs}/RelNotes/2.13.0.txt |  0
 {Documentation => docs}/RelNotes/2.13.1.txt |  0
 {Documentation => docs}/RelNotes/2.2.0.txt  |  0
 {Documentation => docs}/RelNotes/2.2.1.txt  |  0
 {Documentation => docs}/RelNotes/2.2.2.txt  |  0
 {Documentation => docs}/RelNotes/2.3.0.txt  |  0
 {Documentation => docs}/RelNotes/2.3.1.txt  |  0
 {Documentation => docs}/RelNotes/2.4.0.txt  |  0
 {Documentation => docs}/RelNotes/2.4.1.txt  |  0
 {Documentation => docs}/RelNotes/2.5.0.txt  |  0
 {Documentation => docs}/RelNotes/2.6.0.txt  |  0
 {Documentation => docs}/RelNotes/2.6.1.txt  |  0
 {Documentation => docs}/RelNotes/2.6.2.txt  |  0
 {Documentation => docs}/RelNotes/2.7.0.txt  |  0
 {Documentation => docs}/RelNotes/2.8.0.txt  |  0
 {Documentation => docs}/RelNotes/2.9.0.txt  |  0
 {Documentation => docs}/RelNotes/2.90.0.org |  0
 {Documentation => docs}/RelNotes/2.90.1.org |  0
 {Documentation => docs}/RelNotes/3.0.0.org  |  0
 {Documentation => docs}/RelNotes/3.1.0.org  |  0
 {Documentation => docs}/RelNotes/3.2.0.org  |  0
 {Documentation => docs}/RelNotes/3.2.1.org  |  0
 {Documentation => docs}/RelNotes/3.3.0.org  |  0
 {Documentation => docs}/RelNotes/3.4.0.org  |  0
 {Documentation => docs}/htmlxref.cnf|  0
 {Documentation => docs}/magit-section.org   |  0
 {Documentation => docs}/magit-section.texi  |  0
 {Documentation => docs}/magit.org   |  0
 {Documentation => docs}/magit.texi  |  0
 test/Makefile   | 14 
 {t => test}/magit-tests.el  |  0
 62 files changed, 67 insertions(+), 52 deletions(-)
 rename {Documentation => docs}/AUTHORS.md (99%)
 rename {Documentation => docs}/BACKERS.md (100%)
 rename {Documentation => docs}/Makefile (96%)
 rename {Documentation => docs}/RelNotes/0.5.1.txt (100%)
 rename {Documentation => docs}/RelNotes/0.6.1.txt (100%)
 rename {Documentation => docs}/RelNotes/0.7.0.txt (100%)
 rename {Documentation => docs}/RelNotes/0.8.0.txt (100%)
 rename {Documentation => docs}/RelNotes/0.8.1.txt (100%)
 rename {Documentation => docs}/RelNotes/0.8.2.txt (100%)
 rename {Documentation => docs}/RelNotes/1.0.0.txt (100%)
 rename {Documentation => docs}/RelNotes/1.1.0.txt (100%)
 rename {Documentation => docs}/RelNotes/1.1.1.txt (100%)
 rename {Documentation => docs}/RelNotes/1.1.2.txt (100%)
 rename {Documentation => docs}/RelNotes/1.2.0.txt (100%)
 rename {Documentation => docs}/RelNotes/1.2.1.txt (100%)
 rename {Documentation => docs}/RelNotes/1.2.2.txt (100%)
 rename {Documentation => docs}/RelNotes/1.4.0.txt (100%)
 rename {Documentation => docs}/RelNotes/1.4.1.txt (100%)
 rename {Documentation => docs}/RelNotes/1.4.2.txt (100%)
 rename {Documentation => docs}/RelNotes/2.1.0.txt (100%)
 rename {Documentation => docs}/RelNotes/2.10.0.txt (100%)
 rename {Documentation => docs}/RelNotes/2.10.1.txt (100%)
 rename {Documentation => docs}/RelNotes/2.10.2.txt (100

[nongnu] elpa/magit-section updated (65c4485 -> 7b19ac5)

2021-12-16 Thread ELPA Syncer
elpasync pushed a change to branch elpa/magit-section.

  from  65c4485   magit-current-blame-chunk: Don't try to operate in Dired 
buffers
  adds  337a190   Rename Documentation/ to docs/
  adds  b28207a   Rename t/ to test/
  adds  3d7d353   make: Update stats target
  adds  7c46e1c   make: Set more variables in default.mk
  adds  7b19ac5   AUTHORS.md: Update list of contributors

No new revisions were added by this update.

Summary of changes:
 .gitignore  | 24 ++---
 Makefile| 55 +
 RelNotes.org|  2 +-
 default.mk  |  9 +++--
 {Documentation => docs}/AUTHORS.md  |  2 ++
 {Documentation => docs}/BACKERS.md  |  0
 {Documentation => docs}/Makefile| 13 ---
 {Documentation => docs}/RelNotes/0.5.1.txt  |  0
 {Documentation => docs}/RelNotes/0.6.1.txt  |  0
 {Documentation => docs}/RelNotes/0.7.0.txt  |  0
 {Documentation => docs}/RelNotes/0.8.0.txt  |  0
 {Documentation => docs}/RelNotes/0.8.1.txt  |  0
 {Documentation => docs}/RelNotes/0.8.2.txt  |  0
 {Documentation => docs}/RelNotes/1.0.0.txt  |  0
 {Documentation => docs}/RelNotes/1.1.0.txt  |  0
 {Documentation => docs}/RelNotes/1.1.1.txt  |  0
 {Documentation => docs}/RelNotes/1.1.2.txt  |  0
 {Documentation => docs}/RelNotes/1.2.0.txt  |  0
 {Documentation => docs}/RelNotes/1.2.1.txt  |  0
 {Documentation => docs}/RelNotes/1.2.2.txt  |  0
 {Documentation => docs}/RelNotes/1.4.0.txt  |  0
 {Documentation => docs}/RelNotes/1.4.1.txt  |  0
 {Documentation => docs}/RelNotes/1.4.2.txt  |  0
 {Documentation => docs}/RelNotes/2.1.0.txt  |  0
 {Documentation => docs}/RelNotes/2.10.0.txt |  0
 {Documentation => docs}/RelNotes/2.10.1.txt |  0
 {Documentation => docs}/RelNotes/2.10.2.txt |  0
 {Documentation => docs}/RelNotes/2.10.3.txt |  0
 {Documentation => docs}/RelNotes/2.11.0.txt |  0
 {Documentation => docs}/RelNotes/2.12.0.txt |  0
 {Documentation => docs}/RelNotes/2.12.1.txt |  0
 {Documentation => docs}/RelNotes/2.13.0.txt |  0
 {Documentation => docs}/RelNotes/2.13.1.txt |  0
 {Documentation => docs}/RelNotes/2.2.0.txt  |  0
 {Documentation => docs}/RelNotes/2.2.1.txt  |  0
 {Documentation => docs}/RelNotes/2.2.2.txt  |  0
 {Documentation => docs}/RelNotes/2.3.0.txt  |  0
 {Documentation => docs}/RelNotes/2.3.1.txt  |  0
 {Documentation => docs}/RelNotes/2.4.0.txt  |  0
 {Documentation => docs}/RelNotes/2.4.1.txt  |  0
 {Documentation => docs}/RelNotes/2.5.0.txt  |  0
 {Documentation => docs}/RelNotes/2.6.0.txt  |  0
 {Documentation => docs}/RelNotes/2.6.1.txt  |  0
 {Documentation => docs}/RelNotes/2.6.2.txt  |  0
 {Documentation => docs}/RelNotes/2.7.0.txt  |  0
 {Documentation => docs}/RelNotes/2.8.0.txt  |  0
 {Documentation => docs}/RelNotes/2.9.0.txt  |  0
 {Documentation => docs}/RelNotes/2.90.0.org |  0
 {Documentation => docs}/RelNotes/2.90.1.org |  0
 {Documentation => docs}/RelNotes/3.0.0.org  |  0
 {Documentation => docs}/RelNotes/3.1.0.org  |  0
 {Documentation => docs}/RelNotes/3.2.0.org  |  0
 {Documentation => docs}/RelNotes/3.2.1.org  |  0
 {Documentation => docs}/RelNotes/3.3.0.org  |  0
 {Documentation => docs}/RelNotes/3.4.0.org  |  0
 {Documentation => docs}/htmlxref.cnf|  0
 {Documentation => docs}/magit-section.org   |  0
 {Documentation => docs}/magit-section.texi  |  0
 {Documentation => docs}/magit.org   |  0
 {Documentation => docs}/magit.texi  |  0
 test/Makefile   | 14 
 {t => test}/magit-tests.el  |  0
 62 files changed, 67 insertions(+), 52 deletions(-)
 rename {Documentation => docs}/AUTHORS.md (99%)
 rename {Documentation => docs}/BACKERS.md (100%)
 rename {Documentation => docs}/Makefile (96%)
 rename {Documentation => docs}/RelNotes/0.5.1.txt (100%)
 rename {Documentation => docs}/RelNotes/0.6.1.txt (100%)
 rename {Documentation => docs}/RelNotes/0.7.0.txt (100%)
 rename {Documentation => docs}/RelNotes/0.8.0.txt (100%)
 rename {Documentation => docs}/RelNotes/0.8.1.txt (100%)
 rename {Documentation => docs}/RelNotes/0.8.2.txt (100%)
 rename {Documentation => docs}/RelNotes/1.0.0.txt (100%)
 rename {Documentation => docs}/RelNotes/1.1.0.txt (100%)
 rename {Documentation => docs}/RelNotes/1.1.1.txt (100%)
 rename {Documentation => docs}/RelNotes/1.1.2.txt (100%)
 rename {Documentation => docs}/RelNotes/1.2.0.txt (100%)
 rename {Documentation => docs}/RelNotes/1.2.1.txt (100%)
 rename {Documentation => docs}/RelNotes/1.2.2.txt (100%)
 rename {Documentation => docs}/RelNotes/1.4.0.txt (100%)
 rename {Documentation => docs}/RelNotes/1.4.1.txt (100%)
 rename {Documentation => docs}/RelNotes/1.4.2.txt (100%)
 rename {Documentation => docs}/RelNotes/2.1.0.txt (100%)
 rename {Documentation => docs}/RelNotes/2.10.0.txt (100%)
 rename {Documentation => docs}/RelNotes/2.10.1.txt (100%)
 rename {Documentation => docs}/RelNotes/2.10.2.

[nongnu] elpa/with-editor 35c73e7 3/6: make: Update stats target

2021-12-16 Thread ELPA Syncer
branch: elpa/with-editor
commit 35c73e7a8881460705b79e29d9f2d066c988663e
Author: Jonas Bernoulli 
Commit: Jonas Bernoulli 

make: Update stats target
---
 default.mk| 3 ++-
 docs/Makefile | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/default.mk b/default.mk
index c40a18e..6a57846 100644
--- a/default.mk
+++ b/default.mk
@@ -25,4 +25,5 @@ INSTALL_INFO ?= $(shell command -v ginstall-info || 
printf install-info)
 MAKEINFO ?= makeinfo
 MANUAL_HTML_ARGS ?= --css-ref /assets/page.css
 
-STATS_DIR ?= $(TOP)docs/stats
+GITSTATS_DIR  ?= $(TOP)docs/stats
+GITSTATS_ARGS ?= -c style=https://magit.vc/assets/stats.css -c max_authors=999
diff --git a/docs/Makefile b/docs/Makefile
index b40affa..efcdd24 100644
--- a/docs/Makefile
+++ b/docs/Makefile
@@ -63,7 +63,7 @@ html-dir: $(PKG).texi
 .PHONY: stats
 stats:
@printf "Generating statistics\n"
-   @gitstats -c style=https://magit.vc/assets/stats.css -c max_authors=999 
$(TOP) $(STATS_DIR)
+   @gitstats $(GITSTATS_ARGS) $(TOP) $(GITSTATS_DIR)
 
 DOMAIN ?= magit.vc
 PUBLISH_PATH   ?= /manual/



[nongnu] elpa/with-editor updated (d53df36 -> 388a2b8)

2021-12-16 Thread ELPA Syncer
elpasync pushed a change to branch elpa/with-editor.

  from  d53df36   manual: No longer support dissolvable sections
   new  93ba7c8   make: Add stats target
   new  a94faea   Add lisp/ and docs/ directories
   new  35c73e7   make: Update stats target
   new  a0d42f7   make: Cosmetics
   new  96aa1d3   make: Fix publish and release targets
   new  388a2b8   make: Set more variables in default.mk


Summary of changes:
 .gitignore|  18 +--
 Makefile  | 196 +-
 default.mk|  32 +
 AUTHORS.md => docs/AUTHORS.md |   0
 Makefile => docs/Makefile |  99 ++-
 htmlxref.cnf => docs/htmlxref.cnf |   0
 with-editor.org => docs/with-editor.org   |   0
 with-editor.texi => docs/with-editor.texi |   0
 lisp/Makefile |  44 +++
 with-editor.el => lisp/with-editor.el |   0
 10 files changed, 127 insertions(+), 262 deletions(-)
 create mode 100644 default.mk
 rename AUTHORS.md => docs/AUTHORS.md (100%)
 copy Makefile => docs/Makefile (60%)
 rename htmlxref.cnf => docs/htmlxref.cnf (100%)
 rename with-editor.org => docs/with-editor.org (100%)
 rename with-editor.texi => docs/with-editor.texi (100%)
 create mode 100644 lisp/Makefile
 rename with-editor.el => lisp/with-editor.el (100%)



[nongnu] elpa/with-editor a94faea 2/6: Add lisp/ and docs/ directories

2021-12-16 Thread ELPA Syncer
branch: elpa/with-editor
commit a94faeae2ff95235b31c1c1f9447bc95fc527240
Author: Jonas Bernoulli 
Commit: Jonas Bernoulli 

Add lisp/ and docs/ directories
---
 .gitignore|  18 +--
 Makefile  | 198 +-
 default.mk|  28 +
 AUTHORS.md => docs/AUTHORS.md |   0
 Makefile => docs/Makefile |  89 +-
 htmlxref.cnf => docs/htmlxref.cnf |   0
 with-editor.org => docs/with-editor.org   |   0
 with-editor.texi => docs/with-editor.texi |   0
 lisp/Makefile |  44 +++
 with-editor.el => lisp/with-editor.el |   0
 10 files changed, 115 insertions(+), 262 deletions(-)

diff --git a/.gitignore b/.gitignore
index 5f471f4..d42446b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,9 +1,9 @@
-/*.elc
-/*-autoloads.el
-/.config.mk
-/dir
-/with-editor/
-/with-editor.html
-/with-editor.info
-/with-editor.pdf
-/with-editor-autoloads.el
+/config.mk
+/docs/*.html
+/docs/*.pdf
+/docs/dir
+/docs/stats/
+/lisp/*-autoloads.el
+/lisp/*.elc
+
+/docs/with-editor/
diff --git a/Makefile b/Makefile
index 960f183..23dc9e0 100644
--- a/Makefile
+++ b/Makefile
@@ -1,193 +1,51 @@
 -include config.mk
+include default.mk
 
-PKG = with-editor
+.PHONY: lisp docs clean
 
-ELS   = $(PKG).el
-ELCS  = $(ELS:.el=.elc)
-
-DEPS  = dash
-
-VERSION ?= $(shell test -e $(TOP).git && git describe --tags --abbrev=0 | cut 
-c2-)
-
-EMACS  ?= emacs
-EMACS_ARGS ?=
-EMACS_ARGS += --eval '(setq with-editor-emacsclient-executable nil)'
-
-LOAD_PATH  ?= $(addprefix -L ../,$(DEPS))
-LOAD_PATH  += -L .
-
-ifndef ORG_LOAD_PATH
-ORG_LOAD_PATH  = -L ../org/lisp
-ORG_LOAD_PATH += -L ../ox-texinfo+
-endif
-
-INSTALL_INFO ?= $(shell command -v ginstall-info || printf install-info)
-MAKEINFO ?= makeinfo
-MANUAL_HTML_ARGS ?= --css-ref /assets/page.css
-
-all: lisp info
-doc: info html html-dir pdf
+all: lisp docs
 
 help:
$(info make all  - generate lisp and manual)
-   $(info make doc  - generate most manual formats)
$(info make lisp - generate byte-code and autoloads)
+   $(info make docs - generate most manual formats)
$(info make texi - generate texi manual (see comments))
$(info make info - generate info manual)
$(info make html - generate html manual file)
$(info make html-dir - generate html manual directory)
$(info make pdf  - generate pdf manual)
-   $(info make stats- generate statistics)
$(info make authors  - generate AUTHORS.md)
+   $(info make stats- generate statistics)
$(info make publish  - publish snapshot manuals)
$(info make release  - publish release manuals)
$(info make clean- remove most generated files)
+   @printf "\n"
 
-lisp: $(ELCS) loaddefs
-
-loaddefs: $(PKG)-autoloads.el
-
-%.elc: %.el
-   @printf "Compiling $<\n"
-   @$(EMACS) -Q --batch $(EMACS_ARGS) $(LOAD_PATH) -f batch-byte-compile $<
-
-info: $(PKG).info dir
-html: $(PKG).html
-pdf:  $(PKG).pdf
+lisp:
+   @$(MAKE) -C lisp lisp
 
-ORG_ARGS  = --batch -Q $(ORG_LOAD_PATH) -l ox-texinfo+
-ORG_EVAL  = --eval "(setq org-texinfo+-dissolve-noexport-headlines t)"
-ORG_EVAL += --eval "(setq indent-tabs-mode nil)"
-ORG_EVAL += --eval "(setq org-src-preserve-indentation nil)"
-ORG_EVAL += --funcall org-texinfo-export-to-texinfo
-
-# This target first bumps version strings in the Org source.  The
-# necessary tools might be missing so other targets do not depend
-# on this target and it has to be run explicitly when appropriate.
-#
-#   AMEND=t make texiUpdate manual to be amended to HEAD.
-#   VERSION=N make texi  Update manual for release.
-#
-.PHONY: texi
+docs:
+   @$(MAKE) -C docs docs
 texi:
-   @$(EMACS) $(ORG_ARGS) $(PKG).org $(ORG_EVAL)
-   @printf "\n" >> $(PKG).texi
-   @rm -f $(PKG).texi~
-
-%.info: %.texi
-   @printf "Generating $@\n"
-   @$(MAKEINFO) --no-split $< -o $@
-
-dir: $(PKG).info
-   @printf "Generating $@\n"
-   @printf "%s" $^ | xargs -n 1 $(INSTALL_INFO) --dir=$@
-
-HTML_FIXUP_CSS= '//a\
-\
-\n\
-\n\
-\n\
-\n\
-\n'
-HTML_FIXUP_ONLOAD = 's///'
-HTML_FIXUP_MENU   = '/<\/body>/i<\/div>'
-
-%.html: %.texi
-   @printf "Generating $@\n"
-   @$(MAKEINFO) --html --no-split $(MANUAL_HTML_ARGS) $<
-   @sed -i -e $(HTML_FIXUP_CSS) -e $(HTML_FIXUP_ONLOAD) -e 
$(HTML_FIXUP_MENU) $@
-
-html-dir: $(PKG).texi
-   @printf "Generating $(PKG)/*.html\n"
-   @$(MAKEINFO) --html $(MANUAL_HTML_ARGS) $<
-   @for f in $$(find $(PKG) -name '*.html') ; do \
-   sed -i -e $(HTML_FIXUP_CSS) -e $(HTML_FIXUP_ONLOAD) -e 
$(HTML_FIXUP_MENU) $$f ; \
-   done
-
-%.pdf: %.texi
-   @printf "Generating $@\n"
-   @texi2pdf --clean $< > /dev/null
-
-.PHONY: stats
+   @$(MAKE) -C docs texi
+info:

[nongnu] elpa/with-editor 93ba7c8 1/6: make: Add stats target

2021-12-16 Thread ELPA Syncer
branch: elpa/with-editor
commit 93ba7c84a752cd44a8225c4131044635465daddb
Author: Jonas Bernoulli 
Commit: Jonas Bernoulli 

make: Add stats target
---
 Makefile | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/Makefile b/Makefile
index 2ecd247..960f183 100644
--- a/Makefile
+++ b/Makefile
@@ -37,6 +37,7 @@ help:
$(info make html - generate html manual file)
$(info make html-dir - generate html manual directory)
$(info make pdf  - generate pdf manual)
+   $(info make stats- generate statistics)
$(info make authors  - generate AUTHORS.md)
$(info make publish  - publish snapshot manuals)
$(info make release  - publish release manuals)
@@ -107,6 +108,11 @@ html-dir: $(PKG).texi
@printf "Generating $@\n"
@texi2pdf --clean $< > /dev/null
 
+.PHONY: stats
+stats:
+   @printf "Generating statistics\n"
+   @gitstats -c style=https://magit.vc/assets/stats.css -c max_authors=999 
. stats
+
 DOMAIN ?= magit.vc
 PUBLISH_PATH   ?= /manual/
 RELEASE_PATH   ?= /manual/$(VERSION)/



[nongnu] elpa/with-editor a0d42f7 4/6: make: Cosmetics

2021-12-16 Thread ELPA Syncer
branch: elpa/with-editor
commit a0d42f799fd2e0c188416fb2dea9c89bb0ab180d
Author: Jonas Bernoulli 
Commit: Jonas Bernoulli 

make: Cosmetics
---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 23dc9e0..41fa92e 100644
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
 -include config.mk
 include default.mk
 
-.PHONY: lisp docs clean
+.PHONY: lisp docs
 
 all: lisp docs
 



[nongnu] elpa/with-editor 96aa1d3 5/6: make: Fix publish and release targets

2021-12-16 Thread ELPA Syncer
branch: elpa/with-editor
commit 96aa1d3baf484d31aced5d6479372c01b162dfa0
Author: Jonas Bernoulli 
Commit: Jonas Bernoulli 

make: Fix publish and release targets
---
 docs/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/docs/Makefile b/docs/Makefile
index efcdd24..021d68c 100644
--- a/docs/Makefile
+++ b/docs/Makefile
@@ -83,7 +83,7 @@ space := $(empty) $(empty)
 publish: html html-dir pdf
@aws s3 cp $(PKG).html $(PUBLISH_TARGET)
@aws s3 cp $(PKG).pdf  $(PUBLISH_TARGET)
-   @aws s3 sync --delete $(PKG) $(PUBLISH_TARGET)$(PKG)/
+   @aws s3 sync $(PKG)$(PUBLISH_TARGET)$(PKG)/
@printf "Generating CDN invalidation\n"
@aws cloudfront create-invalidation --distribution-id $(CFRONT_DIST) 
--paths \
"$(subst $(space),$(comma),$(addprefix 
$(PUBLISH_PATH),$(CFRONT_PATHS)))" > /dev/null
@@ -91,7 +91,7 @@ publish: html html-dir pdf
 release: html html-dir pdf
@aws s3 cp $(PKG).html $(RELEASE_TARGET)
@aws s3 cp $(PKG).pdf  $(RELEASE_TARGET)
-   @aws s3 sync --delete $(PKG) $(RELEASE_TARGET)$(PKG)/
+   @aws s3 sync $(PKG)$(RELEASE_TARGET)$(PKG)/
@aws s3 cp $(PUBLISH_TARGET)dir.html $(RELEASE_TARGET)dir.html
@aws s3 cp $(PUBLISH_TARGET)dir/index.html 
$(RELEASE_TARGET)dir/index.html
@printf "Generating CDN invalidation\n"



[nongnu] elpa/with-editor 388a2b8 6/6: make: Set more variables in default.mk

2021-12-16 Thread ELPA Syncer
branch: elpa/with-editor
commit 388a2b8bf5aaf2e5ceb713a0ca002f815648100f
Author: Jonas Bernoulli 
Commit: Jonas Bernoulli 

make: Set more variables in default.mk
---
 default.mk| 3 +++
 docs/Makefile | 4 
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/default.mk b/default.mk
index 6a57846..6a82f9f 100644
--- a/default.mk
+++ b/default.mk
@@ -7,6 +7,9 @@ ELCS  = $(ELS:.el=.elc)
 
 DEPS  = dash
 
+DOMAIN  ?= magit.vc
+CFRONT_DIST ?= E2LUHBKU1FBV02
+
 VERSION ?= $(shell test -e $(TOP).git && git describe --tags --abbrev=0 | cut 
-c2-)
 
 EMACS  ?= emacs
diff --git a/docs/Makefile b/docs/Makefile
index 021d68c..d1cb3ee 100644
--- a/docs/Makefile
+++ b/docs/Makefile
@@ -65,15 +65,11 @@ stats:
@printf "Generating statistics\n"
@gitstats $(GITSTATS_ARGS) $(TOP) $(GITSTATS_DIR)
 
-DOMAIN ?= magit.vc
 PUBLISH_PATH   ?= /manual/
 RELEASE_PATH   ?= /manual/$(VERSION)/
-
 S3_BUCKET  ?= s3://$(DOMAIN)
 PUBLISH_TARGET  = $(S3_BUCKET)$(PUBLISH_PATH)
 RELEASE_TARGET  = $(S3_BUCKET)$(RELEASE_PATH)
-
-CFRONT_DIST?= E2LUHBKU1FBV02
 CFRONT_PATHS= $(PKG).html $(PKG).pdf $(PKG)/*
 
 comma := ,



[nongnu] main a6a5023: * elpa-packges (buttercup): New package

2021-12-16 Thread monnier--- via
branch: main
commit a6a50237228eebc9cd76c4f27f1b4ea8a1c6b139
Author: Stefan Monnier 
Commit: Stefan Monnier 

* elpa-packges (buttercup): New package
---
 elpa-packages | 1 +
 1 file changed, 1 insertion(+)

diff --git a/elpa-packages b/elpa-packages
index 540fb07..5da6a29 100644
--- a/elpa-packages
+++ b/elpa-packages
@@ -29,6 +29,7 @@
  ("arduino-mode"   :url "https://github.com/stardiviner/arduino-mode";
   :ignored-files ("Cask"))
 
+ ("buttercup"  :url 
"https://github.com/jorgenschaefer/emacs-buttercup";)
  ("bison-mode" :url "https://github.com/Wilfred/bison-mode";)
 
  ("caml"   :url "https://github.com/ocaml/caml-mode";



[nongnu] elpa/buttercup 67df4b1 012/340: Remove Cask file. It's unused.

2021-12-16 Thread ELPA Syncer
branch: elpa/buttercup
commit 67df4b1bad58b97e5151112c0859c573a6ae2cf8
Author: Jorgen Schaefer 
Commit: Jorgen Schaefer 

Remove Cask file. It's unused.
---
 Cask | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/Cask b/Cask
deleted file mode 100644
index 5cd3319..000
--- a/Cask
+++ /dev/null
@@ -1,3 +0,0 @@
-(source gnu)
-
-(development)



[nongnu] elpa/buttercup 7cdb219 028/340: Spies: :and-call-fake

2021-12-16 Thread ELPA Syncer
branch: elpa/buttercup
commit 7cdb2191767f051c990b8f6ea76e94f6377d0ad0
Author: Jorgen Schaefer 
Commit: Jorgen Schaefer 

Spies: :and-call-fake
---
 README.md | 30 ++
 buttercup-test.el | 14 ++
 buttercup.el  |  4 
 3 files changed, 48 insertions(+)

diff --git a/README.md b/README.md
index 70c6bbd..8eaad06 100644
--- a/README.md
+++ b/README.md
@@ -402,6 +402,36 @@ spied-on function should return.
   (expect fetched-bar :to-equal 745
 ```
 
+### Spies: `:and-call-fake`
+
+The keyword argument `:and-call-fake` delegates calls to a supplied
+function.
+
+```Lisp
+(describe "A spy, when configured with an alternate implementation"
+  (let (bar set-bar get-bar fetched-bar)
+(before-each
+  (fset 'set-bar (lambda (val)
+   (setq bar val)))
+  (fset 'get-bar (lambda ()
+   bar))
+
+  (spy-on 'get-bar :and-call-fake (lambda () 1001))
+
+  (set-bar 123)
+  (setq fetched-bar (get-bar)))
+
+(it "tracks that the spy was called"
+  (expect 'get-bar :to-have-been-called))
+
+(it "should not affect other functions"
+  (expect bar :to-equal 123))
+
+(it "when called returns the requested value"
+  (expect fetched-bar :to-equal 1001
+```
+
+
 ## Test Runners
 
 Evaluating `describe` forms just stores the suites. You need to use a
diff --git a/buttercup-test.el b/buttercup-test.el
index 5fe85b8..3fc2119 100644
--- a/buttercup-test.el
+++ b/buttercup-test.el
@@ -405,3 +405,17 @@
 (expect (test-function 2 3)
 :to-equal
 23)))
+
+(describe "The :and-call-fake keyword functionality"
+  (before-each
+(spy-on 'test-function :and-call-fake (lambda (a b) 1001)))
+
+  (it "tracks calls to the function"
+(test-function 42 23)
+
+(expect 'test-function :to-have-been-called))
+
+  (it "returns the specified value"
+(expect (test-function 2 3)
+:to-equal
+1001)))
diff --git a/buttercup.el b/buttercup.el
index 72f02c7..83e3c6e 100644
--- a/buttercup.el
+++ b/buttercup.el
@@ -380,6 +380,10 @@ A disabled spec is not run."
   (setq new-value (lambda (&rest args)
 (buttercup--spy-add-call new-value args)
 arg)))
+ ((eq keyword :and-call-fake)
+  (setq new-value (lambda (&rest args)
+(buttercup--spy-add-call new-value args)
+(apply arg args
  ((not keyword)
   (setq new-value (lambda (&rest args)
 (buttercup--spy-add-call new-value args)



[nongnu] elpa/buttercup e10955c 001/340: Initial commit.

2021-12-16 Thread ELPA Syncer
branch: elpa/buttercup
commit e10955c62a8c38679bcb8430630b703e3d348425
Author: Jorgen Schaefer 
Commit: Jorgen Schaefer 

Initial commit.
---
 Cask  |   3 +
 Makefile  |   6 ++
 README.md | 166 +
 buttercup-test.el |   1 +
 buttercup.el  | 273 ++
 5 files changed, 449 insertions(+)

diff --git a/Cask b/Cask
new file mode 100644
index 000..5cd3319
--- /dev/null
+++ b/Cask
@@ -0,0 +1,3 @@
+(source gnu)
+
+(development)
diff --git a/Makefile b/Makefile
new file mode 100644
index 000..5fc7198
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,6 @@
+.PHONY: test
+
+all: test
+
+test:
+   emacs -batch -L . -l buttercup.el -f buttercup-markdown-runner README.md
diff --git a/README.md b/README.md
new file mode 100644
index 000..23a1d26
--- /dev/null
+++ b/README.md
@@ -0,0 +1,166 @@
+# Buttercup — Behavior-Driven Emacs Lisp Testing
+
+Buttercup is a behavior-driven development framework for testing Emacs
+Lisp code. It is heavily inspired by
+[Jasmine](https://jasmine.github.io/). So heavily inspired, in fact,
+that half this page is more or less a verbatim copy of the
+[Jasmine introduction](https://jasmine.github.io/edge/introduction.html).
+
+All code in this file can be run by Buttercup’s built-in markdown test
+runner. Just use `make test` in the project directory to see the
+output.
+
+## Suites: `describe` Your Tests
+
+A test suite begins with a call to the Buttercup macro `describe` with
+the first parameter describing the suite and the rest being the body
+of code that implements the suite.
+
+```Lisp
+(describe "A suite"
+  (it "contains a spec with an expectation"
+(expect t :to-be t)))
+```
+
+## Specs
+
+Specs are defined by calling the Buttercup macro `it`, which, like
+`describe` takes a string and code. The string is the title of the
+spec and the code is the spec, or test. A spec contains one or more
+expectations that test the state of the code. An expectation in
+Buttercup is an assertion that is either true or false. A spec with
+all true expectations is a passing spec. A spec with one or more false
+expectations is a failing spec.
+
+### It’s Just Functions
+
+The code arguments to `describe` and `it` is just turned into
+functions internally, so they can contain any executable code
+necessary to implement the rules. Emacs Lisp scoping rules apply, so
+make sure to define your spec file to be lexically scoped.
+
+```Lisp
+(describe "A suite is just a function"
+  (let ((a nil))
+(it "and so is a spec"
+  (setq a t)
+  (expect a :to-be t
+```
+
+## Expectations
+
+Expectations are expressed with the `expect` function. Its first
+argument is the actual value. The second argument is a test, followed
+by expected values for the test to compare the actual value against.
+
+If there is no test, the argument is simply tested for being non-nil.
+This can be used by people who dislike the matcher syntax.
+
+### Matchers
+
+Each matcher implements a boolean comparison between the actual value
+and the expected value. It is responsible for reporting to Buttercup
+if the expectation is true or false. Buttercup will then pass or fail
+the spec.
+
+Any matcher can evaluate to a negative assertion by prepending it with
+the `:not` matcher.
+
+```Lisp
+(describe "The :to-be matcher compares with `eq'"
+  (it "and has a positive case"
+(expect t :to-be t))
+  (it "and can have a negative case"
+(expect nil :not :to-be t)))
+```
+
+### Included Matchers
+
+Buttercup has a rich set of matchers included. Each is used here — all
+expectations and specs pass. There is also the ability to write custom
+matchers (see the `buttercup-define-matcher` macro for further
+information) for when a project’s domain calls for specific assertions
+that are not included below.
+
+```Lisp
+(describe "Included matchers:"
+  (it "The :to-be matcher compares with `eq'"
+(let* ((a 12)
+   (b a))
+  (expect a :to-be b)
+  (expect a :not :to-be nil)))
+
+  (describe "The :to-equal matcher"
+(it "works for simple literals and variables"
+  (let ((a 12))
+(expect a :to-equal 12)))
+
+(it "should work for compound objects"
+  (let ((foo '((a . 12) (b . 34)))
+(bar '((a . 12) (b . 34
+(expect foo :to-equal bar
+
+  (it "The :to-match matcher is for regular expressions"
+(let ((message "foo bar baz"))
+  (expect message :to-match "bar")
+  (expect message :to-match (rx "bar"))
+  (expect message :not :to-match "quux")))
+
+  (it "The :to-be-truthy matcher is for boolean casting testing"
+(let (a
+  (foo "foo"))
+  (expect foo :to-be-truthy)
+  (expect a :not :to-be-truthy)))
+
+  (it "The :to-contain matcher is for finding an item in a list"
+(let ((a '("foo" "bar" "baz")))
+  (expect a :to-contain "bar")
+  (expect a :not :to-contain "quux")))
+
+  (it "The :to-be-less-t

[nongnu] elpa/buttercup 821cfa6 005/340: Comment separating built-in matchers from the rest.

2021-12-16 Thread ELPA Syncer
branch: elpa/buttercup
commit 821cfa6e135a078a7668d423cfe9c892e36be5ad
Author: Jorgen Schaefer 
Commit: Jorgen Schaefer 

Comment separating built-in matchers from the rest.
---
 buttercup.el | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/buttercup.el b/buttercup.el
index baff39e..c226b6a 100644
--- a/buttercup.el
+++ b/buttercup.el
@@ -114,6 +114,9 @@ MATCHER is either a matcher defined with
   (error "Not a test: %S" matcher))
 (apply function args)))
 
+;
+;;; Built-in matchers
+
 (buttercup-define-matcher :not (obj matcher &rest args)
   (let ((result (buttercup--apply-matcher matcher (cons obj args
 (if (consp result)



[nongnu] elpa/buttercup b1bcedc 032/340: Add docstrings where missing.

2021-12-16 Thread ELPA Syncer
branch: elpa/buttercup
commit b1bcedcc5e0acc78a4664d95350b390546ceb5b7
Author: Jorgen Schaefer 
Commit: Jorgen Schaefer 

Add docstrings where missing.
---
 buttercup.el | 41 -
 1 file changed, 40 insertions(+), 1 deletion(-)

diff --git a/buttercup.el b/buttercup.el
index 66cbf74..d5b2f5f 100644
--- a/buttercup.el
+++ b/buttercup.el
@@ -295,37 +295,45 @@ form.")
 ;;; Setup and Teardown
 
 (defmacro before-each (&rest body)
+  "Run BODY before each spec in the current suite."
   (declare (indent 0))
   `(buttercup-before-each (lambda () ,@body)))
 
 (defun buttercup-before-each (function)
+  "The function to handle a `before-each' form."
   (setf (buttercup-suite-before-each buttercup--current-suite)
 (append (buttercup-suite-before-each buttercup--current-suite)
 (list function
 
 (defmacro after-each (&rest body)
+  "Run BODY after each spec in the current suite."
   (declare (indent 0))
   `(buttercup-after-each (lambda () ,@body)))
 
 (defun buttercup-after-each (function)
+  "The function to handle an `after-each' form."
   (setf (buttercup-suite-after-each buttercup--current-suite)
 (append (buttercup-suite-after-each buttercup--current-suite)
 (list function
 
 (defmacro before-all (&rest body)
+  "Run BODY before every spec in the current suite."
   (declare (indent 0))
   `(buttercup-before-all (lambda () ,@body)))
 
 (defun buttercup-before-all (function)
+  "The function to handle a `before-all' form."
   (setf (buttercup-suite-before-all buttercup--current-suite)
 (append (buttercup-suite-before-all buttercup--current-suite)
 (list function
 
 (defmacro after-all (&rest body)
+  "Run BODY after every spec in the current suite."
   (declare (indent 0))
   `(buttercup-after-all (lambda () ,@body)))
 
 (defun buttercup-after-all (function)
+  "The function to handle an `after-all' form."
   (setf (buttercup-suite-after-all buttercup--current-suite)
 (append (buttercup-suite-after-all buttercup--current-suite)
 (list function
@@ -366,7 +374,8 @@ A disabled spec is not run."
 ;;; Spies
 
 (defvar buttercup--spy-calls (make-hash-table :test 'eq
-  :weakness 'key))
+  :weakness 'key)
+  "A mapping of currently-defined spies to their contexts.")
 
 (cl-defstruct spy-context
   args
@@ -374,6 +383,24 @@ A disabled spec is not run."
   current-buffer)
 
 (defun spy-on (symbol &optional keyword arg)
+  "Create a spy (mock) for the function SYMBOL.
+
+KEYWORD can have one of the following values:
+
+  :and-call-through -- Track calls, but call the original
+  function.
+
+  :and-return-value -- Track calls, but return ARG instead of
+  calling the original function.
+
+  :and-call-fake -- Track calls, but call ARG instead of the
+  original function.
+
+  :and-throw-error -- Signal ARG as an error instead of calling
+  the original function.
+
+  nil -- Track calls, but simply return nil instead of calling
+  the original function."
   (cond
((eq keyword :and-call-through)
 (let ((orig (symbol-function symbol)))
@@ -397,12 +424,14 @@ A disabled spec is not run."
nil)
 
 (defun buttercup--spy-on-and-call-fake (spy fake-function)
+  "Replace the function in symbol SPY with a spy that calls FAKE-FUNCTION."
   (let ((orig-function (symbol-function spy)))
 (fset spy (buttercup--make-spy fake-function))
 (buttercup--add-cleanup (lambda ()
   (fset spy orig-function)
 
 (defun buttercup--make-spy (fake-function)
+  "Create a new spy function which tracks calls to itself."
   (let (this-spy-function)
 (setq this-spy-function
   (lambda (&rest args)
@@ -423,12 +452,14 @@ A disabled spec is not run."
   (list function)
 
 (defun buttercup--spy-add-call (spy context)
+  "Add CONTEXT to the recorded calls to SPY."
   (puthash spy
(append (buttercup--spy-calls spy)
(list context))
buttercup--spy-calls))
 
 (defun buttercup--spy-calls (spy)
+  "Return the contexts of calls to SPY."
   (gethash spy buttercup--spy-calls))
 
 (buttercup-define-matcher :to-have-been-called (spy)
@@ -449,14 +480,17 @@ A disabled spec is not run."
   nil)))
 
 (defun spy-calls-any (spy)
+  "Return t iff SPY has been called at all, nil otherwise."
   (if (buttercup--spy-calls (symbol-function spy))
   t
 nil))
 
 (defun spy-calls-count (spy)
+  "Return the number of times SPY has been called so far."
   (length (buttercup--spy-calls (symbol-function spy
 
 (defun spy-calls-args-for (spy index)
+  "Return the context of the INDEXth call to SPY."
   (let ((context (elt (buttercup--spy-calls (symbol-function spy))
   index)))
 (if context
@@ -464,18 +498,23 @@ A disabled spec is not 

[nongnu] elpa/buttercup 548df0d 030/340: Spies: Other tracking properties.

2021-12-16 Thread ELPA Syncer
branch: elpa/buttercup
commit 548df0db2cca32ca6c20f48f3f62c59e6627ba4f
Author: Jorgen Schaefer 
Commit: Jorgen Schaefer 

Spies: Other tracking properties.
---
 README.md | 113 
 buttercup-test.el | 190 --
 buttercup.el  |  67 ---
 3 files changed, 270 insertions(+), 100 deletions(-)

diff --git a/README.md b/README.md
index 03c3f87..f56d3b2 100644
--- a/README.md
+++ b/README.md
@@ -452,6 +452,119 @@ will `signal` the specified value as an error.
   :to-throw 'error
 ```
 
+### Other tracking properties
+
+Every call to a spy is tracked and exposed using the `spy-calls`
+accessor.
+
+`spy-calls-any` returns `nil` if the spy has not been called at all,
+and then `t` once at least one call happens. `spy-calls-count` returns
+the number of times the spy was called. `spy-calls-args-for` returns
+the arguments passed to a given call (by index). `spy-calls-all-args`
+returns the arguments to all calls. `spy-calls-all` returns the
+current buffer and arguments passed to all calls.
+`spy-calls-most-recent` returns the current buffer and arguments for
+the most recent call. `spy-calls-first` returns the current buffer and
+arguments for the first call.
+
+Finally, `spy-calls-reset` clears all tracking for a spy.
+
+```Lisp
+(describe "A spy"
+  (let (set-foo foo)
+(before-each
+  (fset 'set-foo (lambda (val &rest ignored)
+   (setq foo val)))
+  (spy-on 'set-foo))
+
+(it "tracks if it was called at all"
+  (expect (spy-calls-any 'set-foo)
+  :to-equal
+  nil)
+
+  (set-foo 5)
+
+  (expect (spy-calls-any 'set-foo)
+  :to-equal
+  t))
+
+(it "tracks the number of times it was called"
+  (expect (spy-calls-count 'set-foo)
+  :to-equal
+  0)
+
+  (set-foo 2)
+  (set-foo 3)
+
+  (expect (spy-calls-count 'set-foo)
+  :to-equal
+  2))
+
+(it "tracks the arguments of each call"
+  (set-foo 123)
+  (set-foo 456 "baz")
+
+  (expect (spy-calls-args-for 'set-foo 0)
+  :to-equal
+  '(123))
+
+  (expect (spy-calls-args-for 'set-foo 1)
+  :to-equal
+  '(456 "baz")))
+
+(it "tracks the arguments of all calls"
+  (set-foo 123)
+  (set-foo 456 "baz")
+
+  (expect (spy-calls-all-args 'set-foo)
+  :to-equal
+  '((123)
+(456 "baz"
+
+(it "can provide the context and arguments to all calls"
+  (set-foo 123)
+
+  (expect (spy-calls-all 'set-foo)
+  :to-equal
+  `(,(make-spy-context :current-buffer (current-buffer)
+   :args '(123)
+   :return-value nil
+
+(it "has a shortcut to the most recent call"
+  (set-foo 123)
+  (set-foo 456 "baz")
+
+  (expect (spy-calls-most-recent 'set-foo)
+  :to-equal
+  (make-spy-context :current-buffer (current-buffer)
+:args '(456 "baz")
+:return-value nil)))
+
+(it "has a shortcut to the first call"
+  (set-foo 123)
+  (set-foo 456 "baz")
+
+  (expect (spy-calls-first 'set-foo)
+  :to-equal
+  (make-spy-context :current-buffer (current-buffer)
+:args '(123)
+:return-value nil)))
+
+(it "can be reset"
+  (set-foo 123)
+  (set-foo 456 "baz")
+
+  (expect (spy-calls-any 'set-foo)
+  :to-be
+  t)
+
+  (spy-calls-reset 'set-foo)
+
+  (expect (spy-calls-any 'set-foo)
+  :to-be
+  nil
+```
+
 
 ## Test Runners
 
diff --git a/buttercup-test.el b/buttercup-test.el
index fc8d10c..c361a0b 100644
--- a/buttercup-test.el
+++ b/buttercup-test.el
@@ -328,103 +328,113 @@
 ;
 ;;; Spies
 
-(defun test-function (a b)
-  (+ a b))
-
-(describe "The `spy-on' function"
-  (it "replaces a symbol's function slot"
-(spy-on 'test-function)
-(expect (test-function 1 2) :to-be nil))
-
-  (it "restores the old value after a spec run"
-(expect (test-function 1 2) :to-equal 3)))
-
-(describe "The :to-have-been-called matcher"
-  (before-each
-(spy-on 'test-function))
-
-  (it "returns false if the spy was not called"
-(expect (buttercup--apply-matcher :to-have-been-called '(test-function))
-:to-be
-nil))
-
-  (it "returns true if the spy was called at all"
-(test-function 1 2 3)
-(expect (buttercup--apply-matcher :to-have-been-called '(test-function))
-:to-be
-t)))
-
-(describe "The :to-have-been-called-with matcher"
-  (before-each
-(spy-on 'test-function))
-
-  (it "returns false if the spy was not called at all"
-(expect (buttercup--apply-matcher

[nongnu] elpa/buttercup d580e5c 011/340: Add build status badge.

2021-12-16 Thread ELPA Syncer
branch: elpa/buttercup
commit d580e5c690fbe99aa7c22034f85518dee6b8d265
Author: Jorgen Schaefer 
Commit: Jorgen Schaefer 

Add build status badge.
---
 README.md | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/README.md b/README.md
index 23a1d26..ac773d9 100644
--- a/README.md
+++ b/README.md
@@ -1,5 +1,7 @@
 # Buttercup — Behavior-Driven Emacs Lisp Testing
 
+[![Build 
Status](https://api.travis-ci.org/jorgenschaefer/emacs-buttercup.png?branch=master)](https://travis-ci.org/jorgenschaefer/emacs-buttercup)
+
 Buttercup is a behavior-driven development framework for testing Emacs
 Lisp code. It is heavily inspired by
 [Jasmine](https://jasmine.github.io/). So heavily inspired, in fact,



[nongnu] elpa/buttercup c5a9f26 003/340: Add first set of unit tests.

2021-12-16 Thread ELPA Syncer
branch: elpa/buttercup
commit c5a9f265087b04f06089568e5f4a268ae23d6a22
Author: Jorgen Schaefer 
Commit: Jorgen Schaefer 

Add first set of unit tests.
---
 Makefile  |  1 +
 buttercup-test.el | 91 +++
 buttercup.el  | 84 +++---
 3 files changed, 159 insertions(+), 17 deletions(-)

diff --git a/Makefile b/Makefile
index 5fc7198..fc542ac 100644
--- a/Makefile
+++ b/Makefile
@@ -4,3 +4,4 @@ all: test
 
 test:
emacs -batch -L . -l buttercup.el -f buttercup-markdown-runner README.md
+   emacs -batch -L . -l buttercup-test.el -f buttercup-run
diff --git a/buttercup-test.el b/buttercup-test.el
index a7296d6..0b123b9 100644
--- a/buttercup-test.el
+++ b/buttercup-test.el
@@ -1 +1,92 @@
 (require 'buttercup)
+
+(describe "The buttercup-failed signal"
+  (it "can be raised"
+(expect (lambda ()
+  (signal 'buttercup-failed t))
+:to-throw
+'buttercup-failed)))
+
+(describe "The buttercup-error signal"
+  (it "can be raised"
+(expect (lambda ()
+  (signal 'buttercup-error t))
+:to-throw
+'buttercup-error)))
+
+(describe "The `expect' form"
+  (it "with a matcher should translate directly to the function call"
+(expect (macroexpand '(expect (+ 1 1) :to-equal 2))
+:to-equal
+'(buttercup-expect (+ 1 1) :to-equal 2)))
+
+  (it "with a form argument should extract the matcher from the form"
+(expect (macroexpand '(expect (equal (+ 1 1) 2)))
+:to-equal
+'(buttercup-expect (+ 1 1) #'equal 2)))
+
+  (it "with a single argument should pass it to the function"
+(expect (macroexpand '(expect t))
+:to-equal
+'(buttercup-expect t
+
+(describe "The `buttercup-expect' function"
+  (describe "with a single argument"
+(it "should not raise an error if the argument is true"
+  (expect (lambda ()
+(buttercup-expect t))
+  :not :to-throw
+  'buttercup-failed))
+
+(it "should raise an error if the argument is false"
+  (expect (lambda ()
+(buttercup-expect nil))
+  :to-throw
+  'buttercup-failed
+  "Expected nil to be non-nil")))
+
+  (describe "with a function as a matcher argument"
+(it "should not raise an error if the function returns true"
+  (expect (lambda ()
+(buttercup-expect t #'eq t))
+  :not :to-throw
+  'buttercup-failed))
+
+(it "should raise an error if the function returns false"
+  (expect (lambda ()
+(buttercup-expect t #'eq nil))
+  :to-throw
+  'buttercup-failed)))
+
+  (describe "with a matcher argument"
+(buttercup-define-matcher :always-true (a) t)
+(buttercup-define-matcher :always-false (a) nil)
+
+(it "should not raise an error if the matcher returns true"
+  (expect (lambda ()
+(buttercup-expect 1 :always-true))
+  :not :to-throw
+  'buttercup-failed))
+
+(it "should raise an error if the matcher returns false"
+  (expect (lambda ()
+(buttercup-expect 1 :always-false))
+  :to-throw
+  'buttercup-failed
+
+(describe "The `buttercup-fail' function"
+  (it "should raise a signal with its arguments"
+(expect (lambda ()
+  (buttercup-fail "Explanation" ))
+:to-throw
+'buttercup-failed "Explanation")))
+
+(describe "The `buttercup-define-matcher' macro"
+  (it "should add a buttercup-matcher property"
+(buttercup-define-matcher :test-matcher (a b)
+  (+ a b))
+
+(expect (funcall (get :test-matcher 'buttercup-matcher)
+ 1 2)
+:to-equal
+3)))
diff --git a/buttercup.el b/buttercup.el
index 4e6ad5b..4997e6d 100644
--- a/buttercup.el
+++ b/buttercup.el
@@ -38,29 +38,58 @@
 (define-error 'buttercup-error
   "Buttercup test raised an error")
 
-(defun expect (arg &optional matcher &rest args)
+(defmacro expect (arg &optional matcher &rest args)
+  "Expect a condition to be true.
+
+This macro knows three forms:
+
+\(expect arg :matcher args...)
+  Fail the current test iff the matcher does not match these arguments.
+  See `buttercup-define-matcher' for more information on matchers.
+
+\(expect (function arg...))
+  Fail the current test iff the function call does not return a true value.
+
+\(expect ARG)
+  Fail the current test iff ARG is not true."
+  (cond
+   ((and (not matcher)
+ (consp arg))
+`(buttercup-expect ,(cadr arg)
+   #',(car arg)
+   ,@(cddr arg)))
+   ((and (not matcher)
+ (not (consp arg)))
+`(buttercup-expect ,arg))
+   (t
+`(buttercup-expect ,arg ,matcher ,@args
+
+(defun buttercup-expect (arg &optional matcher &rest args)
+  "The function for the 

[nongnu] elpa/buttercup 3637e3d 015/340: Add more extensive matcher tests to the README.

2021-12-16 Thread ELPA Syncer
branch: elpa/buttercup
commit 3637e3d16bf3de29718beb25ba6a55a4cd337f1d
Author: Jorgen Schaefer 
Commit: Jorgen Schaefer 

Add more extensive matcher tests to the README.
---
 README.md | 21 -
 buttercup-test.el | 28 +++-
 2 files changed, 31 insertions(+), 18 deletions(-)

diff --git a/README.md b/README.md
index ac773d9..6d3d202 100644
--- a/README.md
+++ b/README.md
@@ -137,11 +137,22 @@ that are not included below.
   (expect pi :not :to-be-close-to e 2)
   (expect pi :to-be-close-to e 0)))
 
-  (it "The :to-throw matcher is for testing if a function throws an exception"
-(let ((foo (lambda () (+ 1 2)))
-  (bar (lambda () (+ a 1
-  (expect foo :not :to-throw)
-  (expect bar :to-throw
+  (describe "The :to-throw matcher"
+(it "is for testing if a function throws an exception"
+  (let ((foo (lambda () (+ 1 2)))
+(bar (lambda () (+ a 1
+(expect foo :not :to-throw)
+(expect bar :to-throw)))
+(it "accepts a symbol to check for the signal thrown"
+  (let ((foo (lambda () (/ 1 0)))
+(bar (lambda () (+ a 1
+(expect foo :not :to-throw 'void-variable)
+(expect bar :to-throw 'void-variable)))
+(it "optionally matches arguments to signals"
+  (let ((foo (lambda () (+ a 1)))
+(bar (lambda () (+ a 1
+(expect foo :not :to-throw 'void-variable '(b))
+(expect bar :to-throw 'void-variable '(a))
 ```
 
 ## Spies
diff --git a/buttercup-test.el b/buttercup-test.el
index 7e4ae99..ba9b266 100644
--- a/buttercup-test.el
+++ b/buttercup-test.el
@@ -107,20 +107,22 @@
   (it "should create a matcher usable by apply-matcher"
 (expect (buttercup--apply-matcher :test-matcher '(1 2))
 :to-equal
+3)))
+
+(describe "The `buttercup--apply-matcher'"
+  (it "should work with functions"
+(expect (buttercup--apply-matcher #'+ '(1 2))
+:to-equal
 3))
 
-  (describe "The `buttercup--apply-matcher'"
-(it "should work with functions"
-  (expect (buttercup--apply-matcher #'+ '(1 2))
-  :to-equal
-  3))
+  (it "should work with matchers"
+(expect (buttercup--apply-matcher :test-matcher '(1 2))
+:to-equal
+3))
 
-(it "should work with matchers"
-  (expect (buttercup--apply-matcher :test-matcher '(1 2))
-  :to-equal
-  3))
+  (it "should fail if the matcher is not defined"
+(expect (lambda ()
+  (buttercup--apply-matcher :not-defined '(1 2)))
+:to-throw)))
 
-(it "should fail if the matcher is not defined"
-  (expect (lambda ()
-(buttercup--apply-matcher :not-defined '(1 2)))
-  :to-throw
+;; Built-in matchers are tested in README.md



[nongnu] elpa/buttercup 1882d6f 013/340: Comment cleanup. Also, make elisp lexically scoped.

2021-12-16 Thread ELPA Syncer
branch: elpa/buttercup
commit 1882d6fd762979fa7334c1a828ba9a8decf26cc9
Author: Jorgen Schaefer 
Commit: Jorgen Schaefer 

Comment cleanup. Also, make elisp lexically scoped.
---
 buttercup-test.el | 19 +++
 buttercup.el  |  4 ++--
 2 files changed, 21 insertions(+), 2 deletions(-)

diff --git a/buttercup-test.el b/buttercup-test.el
index abc6daf..7e4ae99 100644
--- a/buttercup-test.el
+++ b/buttercup-test.el
@@ -1,3 +1,22 @@
+;;; buttercup-test.el --- Tests for buttercup.el -*-lexical-binding:t-*-
+
+;; Copyright (C) 2015  Jorgen Schaefer 
+
+;; 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 .
+
+;;; Code:
+
 (require 'buttercup)
 
 (describe "The buttercup-failed signal"
diff --git a/buttercup.el b/buttercup.el
index 0243f52..41c9016 100644
--- a/buttercup.el
+++ b/buttercup.el
@@ -1,4 +1,4 @@
-;;; buttercup.el --- Behavior-Driven Emacs Lisp Testing
+;;; buttercup.el --- Behavior-Driven Emacs Lisp Testing -*-lexical-binding:t-*-
 
 ;; Copyright (C) 2015  Jorgen Schaefer 
 
@@ -228,7 +228,7 @@ MATCHER is either a matcher defined with
(cons t (format "Expected %S not to throw an error" function)))
 
 
-;;; describe: Suites
+;;; Suites: describe
 
 (cl-defstruct buttercup-suite
   description



[nongnu] branch elpa/buttercup created (now 108d229)

2021-12-16 Thread ELPA Syncer
elpasync pushed a change to branch elpa/buttercup.

at  108d229   Fix property comparisons in unit tests.

This branch includes the following new commits:

   new  e10955c   Initial commit.
   new  fd70ccf   Specs are now structs.
   new  c5a9f26   Add first set of unit tests.
   new  f44e65d   Unit tests for define-matcher and apply-matcher.
   new  821cfa6   Comment separating built-in matchers from the rest.
   new  36522b9   Add .travis.yml
   new  5d369cd   Do not use emacs-snapshot from EVM, that's slow.
   new  07b1ee6   Add compatibility definition for define-error
   new  89c00aa   Makefile: Make the emacs command configurable
   new  a7d9813   Add cl-defstruct compatibility alias.
   new  d580e5c   Add build status badge.
   new  67df4b1   Remove Cask file. It's unused.
   new  1882d6f   Comment cleanup. Also, make elisp lexically scoped.
   new  3772ad5   Use eval-region instead of eval-buffer.
   new  3637e3d   Add more extensive matcher tests to the README.
   new  695e444   buttercup-markdown-runner: Use setq, not setq-local.
   new  77d1dac   Test buttercup-suite-add-child.
   new  683614d   Tests for the describe macro.
   new  d3cd12a   Tests for the buttercup-describe function
   new  764d6aa   Tests for the it macro and buttercup-it function.
   new  7e20ff1   ROADMAP.md: New file.
   new  a277b0e   Setup and teardown: before-each, after-each, before-all, 
after-all
   new  0221830   Remove setup and teardown from ROADMAP.md.
   new  8e30284   Disabled suites, pending specs.
   new  5db449f   Spies
   new  8aa87c8   Spy :and-call-through
   new  ba40ff8   Spies: :and-return-value
   new  7cdb219   Spies: :and-call-fake
   new  7526198   Spies: :and-throw-error
   new  548df0d   Spies: Other tracking properties.
   new  20b87dd   Refactoring of spy-on to be more concise and DRY.
   new  b1bcedc   Add docstrings where missing.
   new  c1abc2a   Refactoring of spy context accessors.
   new  d5572a6   Refactoring of the cleanup code.
   new  f314737   ROADMAP.md: Remove spies section, as it is done.
   new  b75b3e9   Add a discovery test runner.
   new  4bd24e7   ROADMAP cleanup.
   new  7eecb96   Remove commented-out backtrace code from buttercup.el.
   new  55b87ec   Removed ROADMAP.md. This is now tracked in issues.
   new  993ddda   Add .gitignore
   new  1dcd2cd   Prepare release, add bumpversion and pkg.el
   new  f046eef   Bump version: 0.1 → 1.0
   new  bb31c85   Edebugable.
   new  537b729   Merge pull request #6 from myeffort/master
   new  3483449   Typo fix.
   new  bcaa087   Add buttercup executable to run buttercup tests more 
easily.
   new  7250873   Rename patch to minor in bumpversion.cfg
   new  7fa79c4   Expand and improve the package commentary.
   new  bf0e1da   Rename tar target to release and add compile and clean 
targets.
   new  13c463a   Add more extensive usage instructions to the README.
   new  329d2f9   Add autoload markers to test runners.
   new  c783259   Add MELPA Stable badge.
   new  3deb9a4   Test discovery: Ignore files in dot directories.
   new  84002e9   Add parent relations to specs and suites.
   new  79286cf   Test for the batch reporter.
   new  bdc3721   Documentation for the buttercup-reporter variable.
   new  0c5cc32   The buttercup-suites-total-specs-defined function.
   new  562cdb0   The buttercup-suite-full-name function.
   new  4f68f0b   The buttercup-spec-full-name function.
   new  162b862   The buttercup--funcall function.
   new  638a836   The batch reporter now displays failures and stack traces.
   new  17f3cf5   Remove error in favor of failed.
   new  ef7b730   Various improvements of the batch reporter.
   new  a55a638   More and better tests for the batch reporter.
   new  3a0a58f   Test buttercup--print.
   new  c61a69a   A rudimentary interactive reporter.
   new  8c486e6   Move print settings to the batch reporter where they 
belong.
   new  182a974   Pending specs and disabled suites.
   new  c7df9f6   Add 24.5.
   new  b3bb12a   buttercup-run-discover: Fix regexp.
   new  26f8117   Rename buttercup-test.el and move it to the right 
directory.
   new  d6cf530   Clean up the interactive reporter.
   new  87e0c0d   Bump version: 1.0 → 1.1
   new  f3d6709   Use relative path when testing for dotfiles in current 
project
   new  d264da3   Merge pull request #17 from Fuco1/master
   new  68c5ef5   Only load .el files during discovery.
   new  512b82b   Rework documentation to make the readme more concise.
   new  0f3eb63   Show actual function arguments when a spy fails.
   new  444716b   Handle windows better in interactive runs.
   new  d7ab592   Bump version: 1.1 → 1.2
   new  14718c0   Use the new

[nongnu] elpa/buttercup 36522b9 006/340: Add .travis.yml

2021-12-16 Thread ELPA Syncer
branch: elpa/buttercup
commit 36522b9feee2a9c213f165e505747e209a4dd39c
Author: Jorgen Schaefer 
Commit: Jorgen Schaefer 

Add .travis.yml
---
 .travis.yml | 15 +++
 1 file changed, 15 insertions(+)

diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 000..fe3ebce
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,15 @@
+language: emacs-lisp
+env:
+  - EVM_EMACS=emacs-24.1-bin
+  - EVM_EMACS=emacs-24.2-bin
+  - EVM_EMACS=emacs-24.3-bin
+  - EVM_EMACS=emacs-24.4-bin
+  - EVM_EMACS=emacs-git-snapshot
+before_install:
+  - sudo mkdir /usr/local/evm
+  - sudo chown "$(id -u)":"$(id -g)" /usr/local/evm
+  - curl -fsSkL https://raw.github.com/rejeep/evm/master/go | bash
+  - export PATH="$HOME/.evm/bin:$PATH"
+  - evm install "$EVM_EMACS" --use
+script:
+  - make test



[nongnu] elpa/buttercup 8e30284 024/340: Disabled suites, pending specs.

2021-12-16 Thread ELPA Syncer
branch: elpa/buttercup
commit 8e3028403c7da8fac277cefaee2a866841989b0e
Author: Jorgen Schaefer 
Commit: Jorgen Schaefer 

Disabled suites, pending specs.
---
 README.md | 35 +++
 ROADMAP.md|  9 +
 buttercup-test.el | 34 ++
 buttercup.el  | 31 +++
 4 files changed, 109 insertions(+)

diff --git a/README.md b/README.md
index db8149b..32c36d5 100644
--- a/README.md
+++ b/README.md
@@ -272,6 +272,41 @@ walks through the `after-each` functions similarly.
   (expect foo :to-equal bar))
 ```
 
+## Disabling Suites
+
+Suites and specs can be disabled with the `xdescribe` and `xit`
+macros, respectively. These suites and any specs inside them are
+skipped when run and thus their results will not appear in the
+results.
+
+```Lisp
+(xdescribe "A spec"
+  (let (foo)
+(before-each
+  (setq foo 0)
+  (setq foo (1+ foo)))
+
+(it "is just a function, so it can contain any code"
+  (expect foo :to-equal 1
+```
+
+## Pending Specs
+
+Pending specs do not run.
+
+Any spec declared with `xit` is marked as pending.
+
+Any spec declared without a function body will also be marked as
+pending in results.
+
+```Lisp
+(describe "Pending specs"
+  (xit "can be declared using `xit'"
+(expect t :to-be nil))
+
+  (it "can be declared with `it' but without a body"))
+```
+
 ## Test Runners
 
 Evaluating `describe` forms just stores the suites. You need to use a
diff --git a/ROADMAP.md b/ROADMAP.md
index 9431264..ddd76a7 100644
--- a/ROADMAP.md
+++ b/ROADMAP.md
@@ -50,6 +50,15 @@ Example code:
 
 # Version 1.1: The Missing Features
 
+## Pending Specs
+
+The following phrases were left out from `introduction.js`, and should
+be implemented still:
+
+> Pending specs do not run, _but their names will show up in the results as 
pending._
+
+> And if you call the function `pending` anywhere in the spec body, no matter 
the expectations, the spec will be marked pending. A string passed to pending 
will be treated as a reason and displayed when the suite finishes.
+
 ## Return of the Backtrace
 
 Suite execution should catch errors and include a backtrace in the
diff --git a/buttercup-test.el b/buttercup-test.el
index b3e4cb9..1f33e54 100644
--- a/buttercup-test.el
+++ b/buttercup-test.el
@@ -290,3 +290,37 @@
   (expect (buttercup-suite-after-all suite)
   :to-equal
   (list 23)
+
+;;
+;;; Disabled Suites: xdescribe
+
+(describe "The `xdescribe' macro"
+  (it "expands directly to a function call"
+(expect (macroexpand '(xdescribe "bla bla" (+ 1 1)))
+:to-equal
+'(buttercup-xdescribe "bla bla" (lambda () (+ 1 1))
+
+(describe "The `buttercup-xdescribe' function"
+  (it "should be a no-op"
+(expect (lambda ()
+  (buttercup-xdescribe
+   "bla bla"
+   (lambda () (error "should not happen"
+:not :to-throw)))
+
+;;
+;;; Pending Specs: xit
+
+(describe "The `xit' macro"
+  (it "expands directly to a function call"
+(expect (macroexpand '(xit "bla bla" (+ 1 1)))
+:to-equal
+'(buttercup-xit "bla bla" (lambda () (+ 1 1))
+
+(describe "The `buttercup-xit' function"
+  (it "should be a no-op"
+(expect (lambda ()
+  (buttercup-xit
+   "bla bla"
+   (lambda () (error "should not happen"
+:not :to-throw)))
diff --git a/buttercup.el b/buttercup.el
index f0b2b7f..bb400ad 100644
--- a/buttercup.el
+++ b/buttercup.el
@@ -330,6 +330,37 @@ form.")
 (append (buttercup-suite-after-all buttercup--current-suite)
 (list function
 
+;;
+;;; Disabled Suites: xdescribe
+
+(defmacro xdescribe (description &rest body)
+  "Like `describe', but mark the suite as disabled.
+
+A disabled suite is not run."
+  (declare (indent 1))
+  `(buttercup-xdescribe ,description (lambda () ,@body)))
+
+(defun buttercup-xdescribe (description function)
+  "Like `buttercup-describe', but mark the suite as disabled.
+
+A disabled suite is not run."
+  nil)
+
+;;
+;;; Pending Specs: xit
+
+(defmacro xit (description &rest body)
+  "Like `it', but mark the spec as disabled.
+
+A disabled spec is not run."
+  (declare (indent 1))
+  `(buttercup-xit ,description (lambda () ,@body)))
+
+(defun buttercup-xit (description function)
+  "Like `buttercup-it', but mark the spec as disabled.
+
+A disabled spec is not run."
+  nil)
 
 ;; (let* ((buttercup--descriptions (cons description
 ;;   buttercup--descriptions))



[nongnu] elpa/buttercup d3cd12a 019/340: Tests for the buttercup-describe function

2021-12-16 Thread ELPA Syncer
branch: elpa/buttercup
commit d3cd12add2f6dc2caea15e09a9c1d2aba8239e03
Author: Jorgen Schaefer 
Commit: Jorgen Schaefer 

Tests for the buttercup-describe function
---
 buttercup-test.el | 35 +++
 1 file changed, 35 insertions(+)

diff --git a/buttercup-test.el b/buttercup-test.el
index 27c797f..d6e43b2 100644
--- a/buttercup-test.el
+++ b/buttercup-test.el
@@ -151,3 +151,38 @@
 (expect (macroexpand '(describe "description" (+ 1 1)))
 :to-equal
 '(buttercup-describe "description" (lambda () (+ 1 1))
+
+(describe "The `buttercup-describe' function"
+  (it "should run the enclosing body"
+(let ((it-ran nil))
+  (buttercup-describe "foo" (lambda () (setq it-ran t)))
+  (expect it-ran)))
+
+  (it "should set the `buttercup-suites' variable"
+(let ((buttercup-suites nil)
+  (description "test to set global value"))
+  (buttercup-describe description (lambda () nil))
+  (expect (buttercup-suite-description (car buttercup-suites))
+  :to-equal
+  description)))
+
+  (it "should add child suites when called nested"
+(let ((buttercup-suites nil)
+  (desc1 "description1")
+  (desc2 "description2"))
+
+  (buttercup-describe
+   desc1
+   (lambda ()
+ (buttercup-describe
+  desc2
+  (lambda () nil
+
+  (expect (buttercup-suite-description (car buttercup-suites))
+  :to-equal
+  desc1)
+  (let ((child-suite (car (buttercup-suite-children
+   (car buttercup-suites)
+(expect (buttercup-suite-description child-suite)
+:to-equal
+desc2)



[nongnu] elpa/buttercup 89c00aa 009/340: Makefile: Make the emacs command configurable

2021-12-16 Thread ELPA Syncer
branch: elpa/buttercup
commit 89c00aa99b4c68f1d1ca3de873cf9266aa099067
Author: Jorgen Schaefer 
Commit: Jorgen Schaefer 

Makefile: Make the emacs command configurable
---
 Makefile | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index fc542ac..7d2d6ab 100644
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,9 @@
+EMACS := emacs
+
 .PHONY: test
 
 all: test
 
 test:
-   emacs -batch -L . -l buttercup.el -f buttercup-markdown-runner README.md
-   emacs -batch -L . -l buttercup-test.el -f buttercup-run
+   $(EMACS) -batch -L . -l buttercup.el -f buttercup-markdown-runner 
README.md
+   $(EMACS) -batch -L . -l buttercup-test.el -f buttercup-run



[nongnu] elpa/buttercup 7526198 029/340: Spies: :and-throw-error

2021-12-16 Thread ELPA Syncer
branch: elpa/buttercup
commit 752619812cd9f0d4d954cc31a87e46607a72e3dc
Author: Jorgen Schaefer 
Commit: Jorgen Schaefer 

Spies: :and-throw-error
---
 README.md | 21 +
 buttercup-test.el |  9 +
 buttercup.el  |  4 
 3 files changed, 34 insertions(+)

diff --git a/README.md b/README.md
index 8eaad06..03c3f87 100644
--- a/README.md
+++ b/README.md
@@ -431,6 +431,27 @@ function.
   (expect fetched-bar :to-equal 1001
 ```
 
+### Spies: `:and-throw-error`
+
+With the keyword argument `:and-throw-error`, all calls to the spy
+will `signal` the specified value as an error.
+
+```Lisp
+(describe "A spy, when configured to throw an error"
+  (let (bar set-bar get-bar fetched-bar)
+(before-each
+  (fset 'set-bar (lambda (val)
+   (setq bar val)))
+  (fset 'get-bar (lambda ()
+   bar))
+
+  (spy-on 'get-bar :and-throw-error 'error))
+
+(it "throws the error"
+  (expect (lambda () (get-bar))
+  :to-throw 'error
+```
+
 
 ## Test Runners
 
diff --git a/buttercup-test.el b/buttercup-test.el
index 3fc2119..fc8d10c 100644
--- a/buttercup-test.el
+++ b/buttercup-test.el
@@ -419,3 +419,12 @@
 (expect (test-function 2 3)
 :to-equal
 1001)))
+
+(describe "The :and-throw-error keyword functionality"
+  (before-each
+(spy-on 'test-function :and-throw-error 'error))
+
+  (it "throws an error when called"
+(expect (lambda () (test-function 1 2))
+:to-throw
+'error "Stubbed error")))
diff --git a/buttercup.el b/buttercup.el
index 83e3c6e..d02bc07 100644
--- a/buttercup.el
+++ b/buttercup.el
@@ -384,6 +384,10 @@ A disabled spec is not run."
   (setq new-value (lambda (&rest args)
 (buttercup--spy-add-call new-value args)
 (apply arg args
+ ((eq keyword :and-throw-error)
+  (setq new-value (lambda (&rest args)
+(buttercup--spy-add-call new-value args)
+(signal arg "Stubbed error"
  ((not keyword)
   (setq new-value (lambda (&rest args)
 (buttercup--spy-add-call new-value args)



[nongnu] elpa/buttercup 683614d 018/340: Tests for the describe macro.

2021-12-16 Thread ELPA Syncer
branch: elpa/buttercup
commit 683614d0276c9d1ea8e9b20e04a30b963bd07a70
Author: Jorgen Schaefer 
Commit: Jorgen Schaefer 

Tests for the describe macro.
---
 buttercup-test.el | 6 ++
 buttercup.el  | 4 ++--
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/buttercup-test.el b/buttercup-test.el
index c31d2f6..27c797f 100644
--- a/buttercup-test.el
+++ b/buttercup-test.el
@@ -145,3 +145,9 @@
   (expect (buttercup-suite-children suite)
   :to-equal
   '(23)
+
+(describe "The `describe' macro"
+  (it "should expand to a simple call to the describe function"
+(expect (macroexpand '(describe "description" (+ 1 1)))
+:to-equal
+'(buttercup-describe "description" (lambda () (+ 1 1))
diff --git a/buttercup.el b/buttercup.el
index c482539..ec852e6 100644
--- a/buttercup.el
+++ b/buttercup.el
@@ -252,9 +252,9 @@ form.")
 (defmacro describe (description &rest body)
   "Describe a suite of tests."
   (declare (indent 1))
-  `(buttercup--describe-internal ,description (lambda () ,@body)))
+  `(buttercup-describe ,description (lambda () ,@body)))
 
-(defun buttercup--describe-internal (description body-function)
+(defun buttercup-describe (description body-function)
   "Function to handle a `describe' form."
   (let* ((enclosing-suite buttercup--current-suite)
  (buttercup--current-suite (make-buttercup-suite



[nongnu] elpa/buttercup 764d6aa 020/340: Tests for the it macro and buttercup-it function.

2021-12-16 Thread ELPA Syncer
branch: elpa/buttercup
commit 764d6aab96ea3a267d34e36360a4827db157225a
Author: Jorgen Schaefer 
Commit: Jorgen Schaefer 

Tests for the it macro and buttercup-it function.
---
 buttercup-test.el | 25 +
 buttercup.el  |  6 +++---
 2 files changed, 28 insertions(+), 3 deletions(-)

diff --git a/buttercup-test.el b/buttercup-test.el
index d6e43b2..933c770 100644
--- a/buttercup-test.el
+++ b/buttercup-test.el
@@ -186,3 +186,28 @@
 (expect (buttercup-suite-description child-suite)
 :to-equal
 desc2)
+
+(describe "The `it' macro"
+  (it "should expand to a call to the `buttercup-it' function"
+(expect (macroexpand '(it "description" body))
+:to-equal
+'(buttercup-it "description" (lambda () body)
+
+(describe "The `buttercup-it' function"
+  (it "should fail if not called from within a describe form"
+(expect (lambda ()
+  (let ((buttercup--current-suite nil))
+(buttercup-it "" (lambda ()
+:to-throw))
+
+  (it "should add a spec to the current suite"
+(let ((buttercup--current-suite (make-buttercup-suite)))
+  (buttercup-it "the test spec"
+(lambda () 23))
+  (let ((spec (car (buttercup-suite-children buttercup--current-suite
+(expect (buttercup-spec-description spec)
+:to-equal
+"the test spec")
+(expect (funcall (buttercup-spec-function spec))
+:to-equal
+23)
diff --git a/buttercup.el b/buttercup.el
index ec852e6..6b73a3d 100644
--- a/buttercup.el
+++ b/buttercup.el
@@ -276,11 +276,11 @@ form.")
 (defmacro it (description &rest body)
   "Define a spec."
   (declare (indent 1))
-  `(buttercup--it-internal ,description (lambda () ,@body)))
+  `(buttercup-it ,description (lambda () ,@body)))
 
-(defun buttercup--it-internal (description body-function)
+(defun buttercup-it (description body-function)
   "Function to handle an `it' form."
-  (when (not description)
+  (when (not buttercup--current-suite)
 (error "`it' has to be called from within a `describe' form."))
   (buttercup-suite-add-child buttercup--current-suite
  (make-buttercup-spec



[nongnu] elpa/buttercup c1abc2a 033/340: Refactoring of spy context accessors.

2021-12-16 Thread ELPA Syncer
branch: elpa/buttercup
commit c1abc2af748437943720d8fe7f266b67a519e9c4
Author: Jorgen Schaefer 
Commit: Jorgen Schaefer 

Refactoring of spy context accessors.
---
 buttercup.el | 64 ++--
 1 file changed, 28 insertions(+), 36 deletions(-)

diff --git a/buttercup.el b/buttercup.el
index d5b2f5f..2f66314 100644
--- a/buttercup.el
+++ b/buttercup.el
@@ -373,8 +373,8 @@ A disabled spec is not run."
 ;
 ;;; Spies
 
-(defvar buttercup--spy-calls (make-hash-table :test 'eq
-  :weakness 'key)
+(defvar buttercup--spy-contexts (make-hash-table :test 'eq
+ :weakness 'key)
   "A mapping of currently-defined spies to their contexts.")
 
 (cl-defstruct spy-context
@@ -436,7 +436,7 @@ KEYWORD can have one of the following values:
 (setq this-spy-function
   (lambda (&rest args)
 (let ((return-value (apply fake-function args)))
-  (buttercup--spy-add-call
+  (buttercup--spy-calls-add
this-spy-function
(make-spy-context :args args
  :return-value return-value
@@ -451,47 +451,49 @@ KEYWORD can have one of the following values:
   (append buttercup--cleanup-forms
   (list function)
 
-(defun buttercup--spy-add-call (spy context)
+(defun spy-calls-all (spy)
+  "Return the contexts of calls to SPY."
+  (gethash (symbol-function spy)
+   buttercup--spy-contexts))
+
+(defun buttercup--spy-calls-add (spy-function context)
   "Add CONTEXT to the recorded calls to SPY."
-  (puthash spy
-   (append (buttercup--spy-calls spy)
+  (puthash spy-function
+   (append (gethash spy-function
+buttercup--spy-contexts)
(list context))
-   buttercup--spy-calls))
+   buttercup--spy-contexts))
 
-(defun buttercup--spy-calls (spy)
-  "Return the contexts of calls to SPY."
-  (gethash spy buttercup--spy-calls))
+(defun spy-calls-reset (spy)
+  "Reset SPY, removing all recorded calls."
+  (puthash (symbol-function spy)
+   nil
+   buttercup--spy-contexts))
 
 (buttercup-define-matcher :to-have-been-called (spy)
-  (let ((spy (if (symbolp spy)
- (symbol-function spy)
-   spy)))
-(if (buttercup--spy-calls spy)
-t
-  nil)))
+  (if (spy-calls-all spy)
+  t
+nil))
 
 (buttercup-define-matcher :to-have-been-called-with (spy &rest args)
-  (let* ((spy (if (symbolp spy)
-  (symbol-function spy)
-spy))
- (calls (mapcar 'spy-context-args (buttercup--spy-calls spy
+  (let* ((calls (mapcar 'spy-context-args (spy-calls-all spy
 (if (member args calls)
 t
   nil)))
 
 (defun spy-calls-any (spy)
   "Return t iff SPY has been called at all, nil otherwise."
-  (if (buttercup--spy-calls (symbol-function spy))
+  (if (spy-calls-all spy)
   t
 nil))
 
 (defun spy-calls-count (spy)
   "Return the number of times SPY has been called so far."
-  (length (buttercup--spy-calls (symbol-function spy
+  (length (spy-calls-all spy)))
 
 (defun spy-calls-args-for (spy index)
   "Return the context of the INDEXth call to SPY."
-  (let ((context (elt (buttercup--spy-calls (symbol-function spy))
+  (let ((context (elt (spy-calls-all spy)
   index)))
 (if context
 (spy-context-args context)
@@ -499,25 +501,15 @@ KEYWORD can have one of the following values:
 
 (defun spy-calls-all-args (spy)
   "Return the arguments to all calls to SPY."
-  (mapcar 'spy-context-args (buttercup--spy-calls (symbol-function spy
-
-(defun spy-calls-all (spy)
-  "Return the contexts of all calls to SPY."
-  (buttercup--spy-calls (symbol-function spy)))
+  (mapcar 'spy-context-args (spy-calls-all spy)))
 
 (defun spy-calls-most-recent (spy)
   "Return the context of the most recent call to SPY."
-  (car (last (buttercup--spy-calls (symbol-function spy)
+  (car (last (spy-calls-all spy
 
 (defun spy-calls-first (spy)
   "Return the context of the first call to SPY."
-  (car (buttercup--spy-calls (symbol-function spy
-
-(defun spy-calls-reset (spy)
-  "Reset SPY, removing all recorded calls."
-  (puthash (symbol-function spy)
-   nil
-   buttercup--spy-calls))
+  (car (spy-calls-all spy)))
 
 ;; (let* ((buttercup--descriptions (cons description
 ;;   buttercup--descriptions))



[nongnu] elpa/buttercup d5572a6 034/340: Refactoring of the cleanup code.

2021-12-16 Thread ELPA Syncer
branch: elpa/buttercup
commit d5572a6acdcb70b16fb36c804fa984bb33382c7b
Author: Jorgen Schaefer 
Commit: Jorgen Schaefer 

Refactoring of the cleanup code.
---
 buttercup.el | 39 ---
 1 file changed, 20 insertions(+), 19 deletions(-)

diff --git a/buttercup.el b/buttercup.el
index 2f66314..3679ccd 100644
--- a/buttercup.el
+++ b/buttercup.el
@@ -444,12 +444,18 @@ KEYWORD can have one of the following values:
   return-value)))
 this-spy-function))
 
+(defvar buttercup--cleanup-functions nil)
+
+(defmacro buttercup--with-cleanup (&rest body)
+  `(let ((buttercup--cleanup-functions nil))
+ (unwind-protect (progn ,@body)
+   (dolist (fun buttercup--cleanup-functions)
+ (ignore-errors
+   (funcall fun))
+
 (defun buttercup--add-cleanup (function)
-  (if buttercup--current-suite
-  (buttercup-after-each function)
-(setq buttercup--cleanup-forms
-  (append buttercup--cleanup-forms
-  (list function)
+  (setq buttercup--cleanup-functions
+(cons function buttercup--cleanup-functions)))
 
 (defun spy-calls-all (spy)
   "Return the contexts of calls to SPY."
@@ -581,21 +587,16 @@ Do not change the global value.")
   (funcall f))
 (message "")))
 
-(defvar buttercup--cleanup-forms nil
-  "")
-
 (defun buttercup-run-spec (spec level)
-  (let ((buttercup--cleanup-forms nil))
-(message "%s%s"
- (make-string (* 2 level) ?\s)
- (buttercup-spec-description spec))
-(dolist (f buttercup--before-each)
-  (funcall f))
-(funcall (buttercup-spec-function spec))
-(dolist (f buttercup--cleanup-forms)
-  (funcall f))
-(dolist (f buttercup--after-each)
-  (funcall f
+  (message "%s%s"
+   (make-string (* 2 level) ?\s)
+   (buttercup-spec-description spec))
+  (buttercup--with-cleanup
+   (dolist (f buttercup--before-each)
+ (funcall f))
+   (funcall (buttercup-spec-function spec))
+   (dolist (f buttercup--after-each)
+ (funcall f
 
 (defun buttercup-run-at-point ()
   (let ((buttercup-suites nil)



[nongnu] elpa/buttercup b75b3e9 036/340: Add a discovery test runner.

2021-12-16 Thread ELPA Syncer
branch: elpa/buttercup
commit b75b3e98b8d65096b614e77a96e503a5f7b11d8c
Author: Jorgen Schaefer 
Commit: Jorgen Schaefer 

Add a discovery test runner.
---
 Makefile|  4 +--
 ROADMAP.md  | 20 ---
 buttercup-compat.el | 97 
 buttercup.el| 98 +++--
 4 files changed, 141 insertions(+), 78 deletions(-)

diff --git a/Makefile b/Makefile
index 7d2d6ab..ffea9bb 100644
--- a/Makefile
+++ b/Makefile
@@ -5,5 +5,5 @@ EMACS := emacs
 all: test
 
 test:
-   $(EMACS) -batch -L . -l buttercup.el -f buttercup-markdown-runner 
README.md
-   $(EMACS) -batch -L . -l buttercup-test.el -f buttercup-run
+   $(EMACS) -batch -L . -l buttercup.el -f buttercup-run-markdown README.md
+   $(EMACS) -batch -L . -l buttercup.el -f buttercup-run-discover
diff --git a/ROADMAP.md b/ROADMAP.md
index 524a1de..cf48d28 100644
--- a/ROADMAP.md
+++ b/ROADMAP.md
@@ -1,23 +1,3 @@
-# Version 1.0: Jasmine’s introduction.html
-
-I will declare buttercup ready to be used once it implements most of
-the stuff in
-[Jasmine’s introduction](https://jasmine.github.io/edge/introduction.html).
-At this time, this is missing:
-
-## Test Runners
-
-This would also be a great time to write useful test runners. For the
-first release, there should be `buttercup-run-discover`,
-`buttercup-run-markdown`, and `buttercup-run-at-point`.
-
-## Suite Execution
-
-All of those can use the same `buttercup-run` function, which should
-run a list of suites and call a reporter with results. All execution
-should happen with `debug-on-error` set. We’ll deal with backtraces
-later.
-
 # Version 1.1: The Missing Features
 
 ## Pending Specs
diff --git a/buttercup-compat.el b/buttercup-compat.el
new file mode 100644
index 000..4a0a682
--- /dev/null
+++ b/buttercup-compat.el
@@ -0,0 +1,97 @@
+;;; buttercup-compat.el --- Compatibility definitions for buttercup
+
+;; Copyright (C) 2015  Jorgen Schaefer 
+
+;; Author: Jorgen Schaefer 
+
+;; 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:
+
+;; This file provides compatibility definitions for buttercup. These
+;; are primarily backported features of later versions of Emacs that
+;; are not available in earlier ones.
+
+;;; Code:
+
+;
+;; Introduced in 24.3
+
+(when (not (fboundp 'cl-defstruct))
+  (defalias 'cl-defstruct 'defstruct))
+
+;
+;; Introduced in 24.4
+
+(when (not (fboundp 'define-error))
+  (defun define-error (name message &optional parent)
+"Define NAME as a new error signal.
+MESSAGE is a string that will be output to the echo area if such an error
+is signaled without being caught by a `condition-case'.
+PARENT is either a signal or a list of signals from which it inherits.
+Defaults to `error'."
+(unless parent (setq parent 'error))
+(let ((conditions
+   (if (consp parent)
+   (apply #'append
+  (mapcar (lambda (parent)
+(cons parent
+  (or (get parent 'error-conditions)
+  (error "Unknown signal `%s'" 
parent
+  parent))
+ (cons parent (get parent 'error-conditions)
+  (put name 'error-conditions
+   (delete-dups (copy-sequence (cons name conditions
+  (when message (put name 'error-message message)
+
+;
+;; Introduced in 25.1
+
+(when (not (fboundp 'directory-files-recursively))
+  (defun directory-files-recursively (dir match &optional include-directories)
+"Return all files under DIR that have file names matching MATCH (a regexp).
+This function works recursively.  Files are returned in \"depth first\"
+and alphabetical order.
+If INCLUDE-DIRECTORIES, also include directories that have matching names."
+(let ((result nil)
+  (files nil)
+  ;; When DIR is "/", remote file names like "/method:" could
+  ;; also be offered.  We shall suppress them.
+  (tramp-mode (and tramp-mode (file-remote-p dir
+  (dolist (file (sort (file-name-all-completions "" dir)
+  'string<))
+(unless (member file '("./" "../"))
+  (if (directory-name-p file)
+  (let* ((leaf (substring file

[nongnu] elpa/buttercup 7e20ff1 021/340: ROADMAP.md: New file.

2021-12-16 Thread ELPA Syncer
branch: elpa/buttercup
commit 7e20ff17df84024bec2d377bc93d3034e06d522a
Author: Jorgen Schaefer 
Commit: Jorgen Schaefer 

ROADMAP.md: New file.
---
 ROADMAP.md | 97 ++
 1 file changed, 97 insertions(+)

diff --git a/ROADMAP.md b/ROADMAP.md
new file mode 100644
index 000..43727df
--- /dev/null
+++ b/ROADMAP.md
@@ -0,0 +1,97 @@
+# Version 1.0: Jasmine’s introduction.html
+
+I will declare buttercup ready to be used once it implements most of
+the stuff in
+[Jasmine’s introduction](https://jasmine.github.io/edge/introduction.html).
+At this time, this is missing:
+
+## Setup and Teardown
+
+The forms `(before-each body ...)` and `(after-each body ...)`
+(likewise, `before-all` and `after-all`) to add functions to the
+current suite. Test runners will then call these in turn for each spec
+being run.
+
+## Test Runners
+
+This would also be a great time to write useful test runners. For the
+first release, there should be `buttercup-run-discover`,
+`buttercup-run-markdown`, and `buttercup-run-at-point`.
+
+## Suite Execution
+
+All of those can use the same `buttercup-run` function, which should
+run a list of suites and call a reporter with results. All execution
+should happen with `debug-on-error` set. We’ll deal with backtraces
+later.
+
+## Spies
+
+It’s only sensible for Emacs Lisp to spy on functions, so that’s what
+we should support. The best way of tracking the calls for a function
+is likely a key-weak hash table of function objects to a call list.
+
+Of the following, `:and-call-fake` is probably going to be the
+primitive version. The basic stub would record any arguments in the
+hash table.
+
+Example code:
+
+```Lisp
+(spy-on 'function-name)
+(spy-on 'function-name :and-call-through)
+(spy-on 'function-name :and-return-value 23)
+(spy-on 'function-name :and-call-fake function)
+(spy-on 'function-name :and-throw-error 'arith-error)
+
+(expect 'spied-function :to-have-been-called)
+(expect 'spied-function :to-have-been-called-with 1 2 3)
+(spy-calls-any 'spied-function)
+(spy-calls-count 'spied-function)
+(spy-calls-args-for 'spied-function index)
+(spy-calls-all-args 'spied-function)
+(spy-calls-most-recent 'spied-function)
+(spy-calls-first 'spied-function)
+(spy-calls-reset 'spied-function)
+```
+
+# Version 1.1: The Missing Features
+
+## Return of the Backtrace
+
+Suite execution should catch errors and include a backtrace in the
+result.
+
+## Reporter
+
+A reporter is a function that is called with various events during the
+execution of a test run. See
+[the Jasmine 
documentation](https://jasmine.github.io/edge/custom_reporter.html)
+for a list of useful events.
+
+By default, I’d like to have a `buttercup-reporter-batch` and
+`buttercup-reporter-interactive`.
+
+## Disabling Suites and Pending Specs
+
+The `xdescribe`/`xit` macros and associated functions. A possible
+initial implementation would be just noops. We’ll deal with them fully
+in 1.2.
+
+# Version 1.2: Nice to Have
+
+## Disabled Suites and Pending Specs, again
+
+The `xdescribe`/`xit` macros should get their respective entries
+reported as actually disabled/pending, not just ignored.
+
+## defspy
+
+Syntactic sugar for `:and-call-fake`:
+
+```Lisp
+(defspy function-name (args ...)
+  body...
+  (spy-original 1 2)
+  ...)
+```



[nongnu] elpa/buttercup ba40ff8 027/340: Spies: :and-return-value

2021-12-16 Thread ELPA Syncer
branch: elpa/buttercup
commit ba40ff8a23a3e4bd6b6de458bb993d823df728a8
Author: Jorgen Schaefer 
Commit: Jorgen Schaefer 

Spies: :and-return-value
---
 README.md | 34 +-
 buttercup-test.el | 14 ++
 buttercup.el  | 10 +++---
 3 files changed, 54 insertions(+), 4 deletions(-)

diff --git a/README.md b/README.md
index 34a56a2..70c6bbd 100644
--- a/README.md
+++ b/README.md
@@ -367,7 +367,39 @@ call the original function instead of returning `nil`.
   (expect 'get-bar :to-have-been-called))
 
 (it "should not affect other functions"
-  (expect bar :to-equal 123
+  (expect bar :to-equal 123))
+
+(it "when called returns the requested value"
+  (expect fetched-bar :to-equal 123
+```
+
+### Spies: `:and-return-value`
+
+The keyword argument `:and-return-value` specifies the value the
+spied-on function should return.
+
+```Lisp
+(describe "A spy, when configured to fake a return value"
+  (let (bar set-bar get-bar fetched-bar)
+(before-each
+  (fset 'set-bar (lambda (val)
+   (setq bar val)))
+  (fset 'get-bar (lambda ()
+   bar))
+
+  (spy-on 'get-bar :and-return-value 745)
+
+  (set-bar 123)
+  (setq fetched-bar (get-bar)))
+
+(it "tracks that the spy was called"
+  (expect 'get-bar :to-have-been-called))
+
+(it "should not affect other functions"
+  (expect bar :to-equal 123))
+
+(it "when called returns the requested value"
+  (expect fetched-bar :to-equal 745
 ```
 
 ## Test Runners
diff --git a/buttercup-test.el b/buttercup-test.el
index bb30b9c..5fe85b8 100644
--- a/buttercup-test.el
+++ b/buttercup-test.el
@@ -391,3 +391,17 @@
 (expect (test-function 2 3)
 :to-equal
 5)))
+
+(describe "The :and-return-value keyword functionality"
+  (before-each
+(spy-on 'test-function :and-return-value 23))
+
+  (it "tracks calls to the function"
+(test-function 42 23)
+
+(expect 'test-function :to-have-been-called))
+
+  (it "returns the specified value"
+(expect (test-function 2 3)
+:to-equal
+23)))
diff --git a/buttercup.el b/buttercup.el
index 916dbc8..72f02c7 100644
--- a/buttercup.el
+++ b/buttercup.el
@@ -368,15 +368,19 @@ A disabled spec is not run."
 (defvar buttercup--spy-calls (make-hash-table :test 'eq
   :weakness 'key))
 
-(defun spy-on (symbol &rest keyword-args)
+(defun spy-on (symbol &optional keyword arg)
   (let ((old-value (symbol-function symbol))
 (new-value nil))
 (cond
- ((equal keyword-args '(:and-call-through))
+ ((eq keyword :and-call-through)
   (setq new-value (lambda (&rest args)
 (buttercup--spy-add-call new-value args)
 (apply old-value args
- ((equal keyword-args nil)
+ ((eq keyword :and-return-value)
+  (setq new-value (lambda (&rest args)
+(buttercup--spy-add-call new-value args)
+arg)))
+ ((not keyword)
   (setq new-value (lambda (&rest args)
 (buttercup--spy-add-call new-value args)
 nil



[nongnu] elpa/buttercup f046eef 042/340: Bump version: 0.1 → 1.0

2021-12-16 Thread ELPA Syncer
branch: elpa/buttercup
commit f046eef099fd2095bac582bb1d0b9bb80f5de62f
Author: Jorgen Schaefer 
Commit: Jorgen Schaefer 

Bump version: 0.1 → 1.0
---
 .bumpversion.cfg | 3 ++-
 buttercup-pkg.el | 2 +-
 buttercup.el | 2 +-
 3 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/.bumpversion.cfg b/.bumpversion.cfg
index c5234ef..5232864 100644
--- a/.bumpversion.cfg
+++ b/.bumpversion.cfg
@@ -1,7 +1,8 @@
 [bumpversion]
-current_version = 0.1
+current_version = 1.0
 parse = (?P\d+)\.(?P.*)
 serialize = {major}.{patch}
 files = buttercup.el buttercup-pkg.el
 commit = True
 tag = True
+
diff --git a/buttercup-pkg.el b/buttercup-pkg.el
index 930ab49..1e1912a 100644
--- a/buttercup-pkg.el
+++ b/buttercup-pkg.el
@@ -1,2 +1,2 @@
-(define-package "buttercup" "0.1"
+(define-package "buttercup" "1.0"
   "Behavior-Driven Emacs Lisp Testing")
diff --git a/buttercup.el b/buttercup.el
index fd43fc9..c1b0be1 100644
--- a/buttercup.el
+++ b/buttercup.el
@@ -2,7 +2,7 @@
 
 ;; Copyright (C) 2015  Jorgen Schaefer 
 
-;; Version: 0.1
+;; Version: 1.0
 ;; Author: Jorgen Schaefer 
 
 ;; This program is free software; you can redistribute it and/or



[nongnu] elpa/buttercup 1dcd2cd 041/340: Prepare release, add bumpversion and pkg.el

2021-12-16 Thread ELPA Syncer
branch: elpa/buttercup
commit 1dcd2cd338a368f5f344d50be92eec1f11336fea
Author: Jorgen Schaefer 
Commit: Jorgen Schaefer 

Prepare release, add bumpversion and pkg.el
---
 .bumpversion.cfg | 7 +++
 Makefile | 7 +++
 buttercup-pkg.el | 2 ++
 3 files changed, 16 insertions(+)

diff --git a/.bumpversion.cfg b/.bumpversion.cfg
new file mode 100644
index 000..c5234ef
--- /dev/null
+++ b/.bumpversion.cfg
@@ -0,0 +1,7 @@
+[bumpversion]
+current_version = 0.1
+parse = (?P\d+)\.(?P.*)
+serialize = {major}.{patch}
+files = buttercup.el buttercup-pkg.el
+commit = True
+tag = True
diff --git a/Makefile b/Makefile
index ffea9bb..f5f7909 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,7 @@
 EMACS := emacs
+VERSION = $(shell sed -ne 's/^;; Version: \(.*\)/\1/p' buttercup.el)
+DISTFILES = buttercup.el buttercup-compat.el buttercup-pkg.el README.md
+
 
 .PHONY: test
 
@@ -7,3 +10,7 @@ all: test
 test:
$(EMACS) -batch -L . -l buttercup.el -f buttercup-run-markdown README.md
$(EMACS) -batch -L . -l buttercup.el -f buttercup-run-discover
+
+tar:
+   mkdir -p dist
+   tar -c $(DISTFILES) --transform "s,^,buttercup-$(VERSION)/," 
--transform 's/README.md/README.txt/' > "dist/buttercup-$(VERSION).tar"
diff --git a/buttercup-pkg.el b/buttercup-pkg.el
new file mode 100644
index 000..930ab49
--- /dev/null
+++ b/buttercup-pkg.el
@@ -0,0 +1,2 @@
+(define-package "buttercup" "0.1"
+  "Behavior-Driven Emacs Lisp Testing")



[nongnu] elpa/buttercup 7250873 047/340: Rename patch to minor in bumpversion.cfg

2021-12-16 Thread ELPA Syncer
branch: elpa/buttercup
commit 7250873968d13829fe4f242e2571d7ad77a4e45e
Author: Jorgen Schaefer 
Commit: Jorgen Schaefer 

Rename patch to minor in bumpversion.cfg
---
 .bumpversion.cfg | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/.bumpversion.cfg b/.bumpversion.cfg
index 5232864..1424e65 100644
--- a/.bumpversion.cfg
+++ b/.bumpversion.cfg
@@ -1,8 +1,7 @@
 [bumpversion]
 current_version = 1.0
-parse = (?P\d+)\.(?P.*)
-serialize = {major}.{patch}
+parse = (?P\d+)\.(?P.*)
+serialize = {major}.{minor}
 files = buttercup.el buttercup-pkg.el
 commit = True
 tag = True
-



[nongnu] elpa/buttercup f314737 035/340: ROADMAP.md: Remove spies section, as it is done.

2021-12-16 Thread ELPA Syncer
branch: elpa/buttercup
commit f314737ab9cacd6f4a94e97798ef3abbcd7548bb
Author: Jorgen Schaefer 
Commit: Jorgen Schaefer 

ROADMAP.md: Remove spies section, as it is done.
---
 ROADMAP.md | 30 --
 1 file changed, 30 deletions(-)

diff --git a/ROADMAP.md b/ROADMAP.md
index ddd76a7..524a1de 100644
--- a/ROADMAP.md
+++ b/ROADMAP.md
@@ -18,36 +18,6 @@ run a list of suites and call a reporter with results. All 
execution
 should happen with `debug-on-error` set. We’ll deal with backtraces
 later.
 
-## Spies
-
-It’s only sensible for Emacs Lisp to spy on functions, so that’s what
-we should support. The best way of tracking the calls for a function
-is likely a key-weak hash table of function objects to a call list.
-
-Of the following, `:and-call-fake` is probably going to be the
-primitive version. The basic stub would record any arguments in the
-hash table.
-
-Example code:
-
-```Lisp
-(spy-on 'function-name)
-(spy-on 'function-name :and-call-through)
-(spy-on 'function-name :and-return-value 23)
-(spy-on 'function-name :and-call-fake function)
-(spy-on 'function-name :and-throw-error 'arith-error)
-
-(expect 'spied-function :to-have-been-called)
-(expect 'spied-function :to-have-been-called-with 1 2 3)
-(spy-calls-any 'spied-function)
-(spy-calls-count 'spied-function)
-(spy-calls-args-for 'spied-function index)
-(spy-calls-all-args 'spied-function)
-(spy-calls-most-recent 'spied-function)
-(spy-calls-first 'spied-function)
-(spy-calls-reset 'spied-function)
-```
-
 # Version 1.1: The Missing Features
 
 ## Pending Specs



[nongnu] elpa/buttercup 7eecb96 038/340: Remove commented-out backtrace code from buttercup.el.

2021-12-16 Thread ELPA Syncer
branch: elpa/buttercup
commit 7eecb962171d28cbf2513e479194b13e677369f4
Author: Jorgen Schaefer 
Commit: Jorgen Schaefer 

Remove commented-out backtrace code from buttercup.el.

Adding a backtrace functionality, and this code, is now tracked by
issue #2.
---
 buttercup.el | 31 ---
 1 file changed, 31 deletions(-)

diff --git a/buttercup.el b/buttercup.el
index 891026e..fd43fc9 100644
--- a/buttercup.el
+++ b/buttercup.el
@@ -489,37 +489,6 @@ KEYWORD can have one of the following values:
   "Return the context of the first call to SPY."
   (car (spy-calls-all spy)))
 
-;; (let* ((buttercup--descriptions (cons description
-;;   buttercup--descriptions))
-;;(debugger (lambda (&rest args)
-;;(let ((backtrace (buttercup--backtrace)))
-;;  ;; If we do not do this, Emacs will not this
-;;  ;; handler on subsequent calls. Thanks to ert
-;;  ;; for this.
-;;  (cl-incf num-nonmacro-input-events)
-;;  (signal 'buttercup-error (cons args backtrace)
-;;(debug-on-error t)
-;;(debug-ignored-errors '(buttercup-failed buttercup-error)))
-;;   (buttercup-report 'enter nil buttercup--descriptions)
-;;   (condition-case sig
-;;   (progn
-;; (funcall body-function)
-;; (buttercup-report 'success nil buttercup--descriptions))
-;; (buttercup-failed
-;;  (buttercup-report 'failure (cdr sig) buttercup--descriptions))
-;; (buttercup-error
-;;  (buttercup-report 'error (cdr sig) buttercup--descriptions
-
-;; (defun buttercup--backtrace ()
-;;   (let* ((n 5)
-;;  (frame (backtrace-frame n))
-;;  (frame-list nil))
-;; (while frame
-;;   (push frame frame-list)
-;;   (setq n (1+ n)
-;; frame (backtrace-frame n)))
-;; frame-list))
-
 
 ;;; Test Runners
 



[nongnu] elpa/buttercup 84002e9 054/340: Add parent relations to specs and suites.

2021-12-16 Thread ELPA Syncer
branch: elpa/buttercup
commit 84002e9feed4d428c0204b0d79cce138ecfbb021
Author: Jorgen Schaefer 
Commit: Jorgen Schaefer 

Add parent relations to specs and suites.

Also, add a basic reporter functionality that makes use of this.
Will expand the reporter interface later.
---
 buttercup-test.el | 51 +
 buttercup.el  | 97 ---
 2 files changed, 123 insertions(+), 25 deletions(-)

diff --git a/buttercup-test.el b/buttercup-test.el
index 5e01ecd..6d2ebd3 100644
--- a/buttercup-test.el
+++ b/buttercup-test.el
@@ -138,22 +138,61 @@
 
 (describe "The `buttercup-suite-add-child' function"
   (it "should add an element at the end of the list"
-(let ((suite (make-buttercup-suite :children '(1 2 3
+(let* ((specs (list (make-buttercup-spec)
+(make-buttercup-spec)
+(make-buttercup-spec)))
+   (suite (make-buttercup-suite :children specs))
+   (spec (make-buttercup-spec)))
 
-  (buttercup-suite-add-child suite 4)
+  (buttercup-suite-add-child suite spec)
 
   (expect (buttercup-suite-children suite)
   :to-equal
-  '(1 2 3 4
+  (append specs (list spec)
 
   (it "should add an element even if the list is empty"
-(let ((suite (make-buttercup-suite :children nil)))
+(let ((suite (make-buttercup-suite :children nil))
+  (spec (make-buttercup-spec)))
 
-  (buttercup-suite-add-child suite 23)
+  (buttercup-suite-add-child suite spec)
 
   (expect (buttercup-suite-children suite)
   :to-equal
-  '(23)
+  (list spec
+
+  (it "should add the parent to the child"
+(let ((parent (make-buttercup-suite))
+  (child (make-buttercup-suite)))
+
+  (buttercup-suite-add-child parent child)
+
+  (expect (buttercup-suite-parent child)
+  :to-equal
+  parent
+
+(describe "The `buttercup-suite-parents' function"
+  (it "should return the list of parents for a suite"
+(let ((grandparent (make-buttercup-suite))
+  (parent (make-buttercup-suite))
+  (child (make-buttercup-suite)))
+  (buttercup-suite-add-child grandparent parent)
+  (buttercup-suite-add-child parent child)
+
+  (expect (buttercup-suite-parents child)
+  :to-equal
+  (list parent grandparent)
+
+(describe "The `buttercup-spec-parents' function"
+  (it "should return the list of parents for a spec"
+(let ((grandparent (make-buttercup-suite))
+  (parent (make-buttercup-suite))
+  (child (make-buttercup-spec)))
+  (buttercup-suite-add-child grandparent parent)
+  (buttercup-suite-add-child parent child)
+
+  (expect (buttercup-spec-parents child)
+  :to-equal
+  (list parent grandparent)
 
 (describe "The `describe' macro"
   (it "should expand to a simple call to the describe function"
diff --git a/buttercup.el b/buttercup.el
index 73fe6f0..05837ae 100644
--- a/buttercup.el
+++ b/buttercup.el
@@ -217,16 +217,43 @@ MATCHER is either a matcher defined with
 (cl-defstruct buttercup-suite
   description
   children
+  parent
   before-each
   after-each
   before-all
   after-all)
 
+;; Have to define the spec up here instead of with the specs where it
+;; belongs because we `setf' to it here.
+(cl-defstruct buttercup-spec
+  description
+  parent
+  function)
+
 (defun buttercup-suite-add-child (parent child)
   "Add a CHILD suite to a PARENT suite."
   (setf (buttercup-suite-children parent)
 (append (buttercup-suite-children parent)
-(list child
+(list child)))
+  (if (buttercup-suite-p child)
+  (setf (buttercup-suite-parent child)
+parent)
+(setf (buttercup-spec-parent child)
+  parent)))
+
+(defun buttercup-suite-parents (suite)
+  "Return a list of parents of SUITE."
+  (if (buttercup-suite-parent suite)
+  (cons (buttercup-suite-parent suite)
+(buttercup-suite-parents (buttercup-suite-parent suite)))
+nil))
+
+(defun buttercup-spec-parents (spec)
+  "Return a list of parents of SPEC."
+  (if (buttercup-spec-parent spec)
+  (cons (buttercup-spec-parent spec)
+(buttercup-suite-parents (buttercup-spec-parent spec)))
+nil))
 
 (defvar buttercup-suites nil
   "The list of all currently defined Buttercup suites.")
@@ -257,10 +284,6 @@ form.")
 ;
 ;;; Specs: it
 
-(cl-defstruct buttercup-spec
-  description
-  function)
-
 (defmacro it (description &rest body)
   "Define a spec."
   (declare (indent 1) (debug (&define sexp def-body)))
@@ -546,7 +569,10 @@ current directory."
 
 (defun buttercup-run ()
   (if buttercup-suites
-  (mapc #'buttercup--run-suite buttercup-suites)
+  (progn
+(funcall buttercup-reporter 'buttercup-started buttercup-suites)
+(mapc #'buttercup--run-suit

[nongnu] elpa/buttercup 4bd24e7 037/340: ROADMAP cleanup.

2021-12-16 Thread ELPA Syncer
branch: elpa/buttercup
commit 4bd24e727ed4b7ae9dbbec2667056f82aa8a3072
Author: Jorgen Schaefer 
Commit: Jorgen Schaefer 

ROADMAP cleanup.
---
 ROADMAP.md | 12 +++-
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/ROADMAP.md b/ROADMAP.md
index cf48d28..74d8b33 100644
--- a/ROADMAP.md
+++ b/ROADMAP.md
@@ -9,11 +9,6 @@ be implemented still:
 
 > And if you call the function `pending` anywhere in the spec body, no matter 
 > the expectations, the spec will be marked pending. A string passed to 
 > pending will be treated as a reason and displayed when the suite finishes.
 
-## Return of the Backtrace
-
-Suite execution should catch errors and include a backtrace in the
-result.
-
 ## Reporter
 
 A reporter is a function that is called with various events during the
@@ -24,11 +19,10 @@ for a list of useful events.
 By default, I’d like to have a `buttercup-reporter-batch` and
 `buttercup-reporter-interactive`.
 
-## Disabling Suites and Pending Specs
+## Return of the Backtrace
 
-The `xdescribe`/`xit` macros and associated functions. A possible
-initial implementation would be just noops. We’ll deal with them fully
-in 1.2.
+Suite execution should catch errors and include a backtrace in the
+result.
 
 # Version 1.2: Nice to Have
 



[nongnu] elpa/buttercup 3483449 045/340: Typo fix.

2021-12-16 Thread ELPA Syncer
branch: elpa/buttercup
commit 3483449d1487a7fc37dea0e9daf4efe3173242d8
Author: Jorgen Schaefer 
Commit: Jorgen Schaefer 

Typo fix.
---
 README.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/README.md b/README.md
index f56d3b2..50ff056 100644
--- a/README.md
+++ b/README.md
@@ -230,7 +230,7 @@ your specs so that they erroneously pass or fail.
 (after-all
  (setq foo 0))
 
-(it "sets the iniital value of foo before specs run"
+(it "sets the initial value of foo before specs run"
   (expect foo :to-equal 1)
   (setq foo (1+ foo)))
 



[nongnu] elpa/buttercup 329d2f9 051/340: Add autoload markers to test runners.

2021-12-16 Thread ELPA Syncer
branch: elpa/buttercup
commit 329d2f979bc2a9c988c20c7528966f53eacdc986
Author: Jorgen Schaefer 
Commit: Jorgen Schaefer 

Add autoload markers to test runners.
---
 buttercup.el | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/buttercup.el b/buttercup.el
index ec578cf..de07c57 100644
--- a/buttercup.el
+++ b/buttercup.el
@@ -504,6 +504,7 @@ KEYWORD can have one of the following values:
 
 ;;; Test Runners
 
+;;;###autoload
 (defun buttercup-run-at-point ()
   "Run the buttercup suite at point."
   (interactive)
@@ -513,6 +514,7 @@ KEYWORD can have one of the following values:
 (buttercup-run)
 (message "Suite executed successfully")))
 
+;;;###autoload
 (defun buttercup-run-discover ()
   "Discover and load test files, then run all defined suites.
 
@@ -524,6 +526,7 @@ current directory."
   (load file nil t)))
   (buttercup-run))
 
+;;;###autoload
 (defun buttercup-run-markdown ()
   (let ((lisp-buffer (generate-new-buffer "elisp")))
 (dolist (file command-line-args-left)



[nongnu] elpa/buttercup a7d9813 010/340: Add cl-defstruct compatibility alias.

2021-12-16 Thread ELPA Syncer
branch: elpa/buttercup
commit a7d9813517c3ee6f4a881f7c68e23d0535ffc494
Author: Jorgen Schaefer 
Commit: Jorgen Schaefer 

Add cl-defstruct compatibility alias.
---
 buttercup.el | 4 
 1 file changed, 4 insertions(+)

diff --git a/buttercup.el b/buttercup.el
index 55f57dd..0243f52 100644
--- a/buttercup.el
+++ b/buttercup.el
@@ -32,6 +32,10 @@
 ;
 ;;; Compatibility
 
+;; Introduced in 24.3
+(when (not (fboundp 'cl-defstruct))
+  (defalias 'cl-defstruct 'defstruct))
+
 ;; Introduced in 24.4
 (when (not (fboundp 'define-error))
   (defun define-error (name message &optional parent)



[nongnu] elpa/buttercup 7fa79c4 048/340: Expand and improve the package commentary.

2021-12-16 Thread ELPA Syncer
branch: elpa/buttercup
commit 7fa79c407a6a53f2bcda47673a2a5c95d99554b6
Author: Jorgen Schaefer 
Commit: Jorgen Schaefer 

Expand and improve the package commentary.
---
 buttercup.el | 12 
 1 file changed, 12 insertions(+)

diff --git a/buttercup.el b/buttercup.el
index 2bb893f..ec578cf 100644
--- a/buttercup.el
+++ b/buttercup.el
@@ -20,6 +20,18 @@
 
 ;;; Commentary:
 
+;; Buttercup is a behavior-driven development framework for testing
+;; Emacs Lisp code. It is heavily inspired by the Jasmine test
+;; framework for JavaScript.
+
+;; A test suite begins with a call to the Buttercup macro `describe` with
+;; the first parameter describing the suite and the rest being the body
+;; of code that implements the suite.
+
+;; (describe "A suite"
+;;   (it "contains a spec with an expectation"
+;; (expect t :to-be t)))
+
 ;; The ideas for project were shamelessly taken from Jasmine
 ;; .
 



[nongnu] elpa/buttercup 26f8117 071/340: Rename buttercup-test.el and move it to the right directory.

2021-12-16 Thread ELPA Syncer
branch: elpa/buttercup
commit 26f8117b278d5305d781dd658fa551fd0b44e9fa
Author: Jorgen Schaefer 
Commit: Jorgen Schaefer 

Rename buttercup-test.el and move it to the right directory.
---
 buttercup-test.el => tests/test-buttercup.el | 0
 1 file changed, 0 insertions(+), 0 deletions(-)

diff --git a/buttercup-test.el b/tests/test-buttercup.el
similarity index 100%
rename from buttercup-test.el
rename to tests/test-buttercup.el



[nongnu] elpa/buttercup 0221830 023/340: Remove setup and teardown from ROADMAP.md.

2021-12-16 Thread ELPA Syncer
branch: elpa/buttercup
commit 0221830f7a8fa6574eb6d47750d1593b8c67b604
Author: Jorgen Schaefer 
Commit: Jorgen Schaefer 

Remove setup and teardown from ROADMAP.md.
---
 ROADMAP.md | 7 ---
 1 file changed, 7 deletions(-)

diff --git a/ROADMAP.md b/ROADMAP.md
index 43727df..9431264 100644
--- a/ROADMAP.md
+++ b/ROADMAP.md
@@ -5,13 +5,6 @@ the stuff in
 [Jasmine’s introduction](https://jasmine.github.io/edge/introduction.html).
 At this time, this is missing:
 
-## Setup and Teardown
-
-The forms `(before-each body ...)` and `(after-each body ...)`
-(likewise, `before-all` and `after-all`) to add functions to the
-current suite. Test runners will then call these in turn for each spec
-being run.
-
 ## Test Runners
 
 This would also be a great time to write useful test runners. For the



[nongnu] elpa/buttercup afbaae1 091/340: Document file names for test discovery

2021-12-16 Thread ELPA Syncer
branch: elpa/buttercup
commit afbaae1009d2068a077a583fe65ad9d192f8b694
Author: Jorgen Schaefer 
Commit: Jorgen Schaefer 

Document file names for test discovery

Fixes #18
---
 buttercup.el  | 2 +-
 docs/running-tests.md | 7 +--
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/buttercup.el b/buttercup.el
index 7a60143..2b80947 100644
--- a/buttercup.el
+++ b/buttercup.el
@@ -661,7 +661,7 @@ current directory."
 (setq command-line-args-left nil)
 (dolist (dir (or dirs '(".")))
   (dolist (file (directory-files-recursively
- dir "\\`test-.*\\.el\\'\\|-test\\.el\\'"))
+ dir "\\`test-.*\\.el\\'\\|-tests?\\.el\\'"))
 (when (not (string-match "/\\." (file-relative-name file)))
   (load file nil t
 (when patterns
diff --git a/docs/running-tests.md b/docs/running-tests.md
index 2cbc2e3..ab8ed3a 100644
--- a/docs/running-tests.md
+++ b/docs/running-tests.md
@@ -25,7 +25,7 @@ for tests. It should look roughly like this:
 ```
 feature/feature.el
 Cask
-tests/feature.el
+tests/test-feature.el
 ```
 
 **feature.el**
@@ -94,7 +94,10 @@ The feature
 Ran 1 specs, 0 failed, in 0.0 seconds.
 ```
 
-That’s it.
+That’s it. Buttercup’s built-in discover test runner looks for files
+named `test-*.el`, `*-test.el` or `*-tests.el`. You can specify a
+different pattern using the `--pattern` command line argument to the
+`buttercup` program.
 
 You can run this command whichever way you like. Common choices
 include a makefile or shell scripts.



[nongnu] elpa/buttercup a277b0e 022/340: Setup and teardown: before-each, after-each, before-all, after-all

2021-12-16 Thread ELPA Syncer
branch: elpa/buttercup
commit a277b0e7d1860cb0880c701267e32c56c534763d
Author: Jorgen Schaefer 
Commit: Jorgen Schaefer 

Setup and teardown: before-each, after-each, before-all, after-all
---
 README.md | 136 --
 buttercup-test.el |  81 +++-
 buttercup.el  |  81 ++--
 3 files changed, 280 insertions(+), 18 deletions(-)

diff --git a/README.md b/README.md
index 6d3d202..db8149b 100644
--- a/README.md
+++ b/README.md
@@ -155,11 +155,122 @@ that are not included below.
 (expect bar :to-throw 'void-variable '(a))
 ```
 
-## Spies
+## Grouping Related Specs with `describe`
 
-Buttercup provides a way of _spying_ on a function, something usually
-called mocking, but Jasmine calls it _spies_, and so do we. Did I
-mention Buttercup is heavily inspired by Jasmine?
+The `describe` macro is for grouping related specs. The string
+parameter is for naming the collection of specs, and will be
+concatenated with specs to make a spec’s full name. This aids in
+finding specs in a large suite. If you name them well, your specs read
+as full sentences in traditional
+[BDD](http://en.wikipedia.org/wiki/Behavior-driven_development) style.
+
+```Lisp
+(describe "A spec"
+  (it "is just a function, so it can contain any code"
+(let ((foo 0))
+  (setq foo (1+ foo))
+
+  (expect foo :to-equal 1)))
+
+  (it "can have more than one expectation"
+(let ((foo 0))
+  (setq foo (1+ foo))
+
+  (expect foo :to-equal 1)
+  (expect t :to-equal t
+```
+
+### Setup and Teardown
+
+To help a test suite DRY up any duplicated setup and teardown code,
+Buttercup provides the `before-each`, `after-each`, `before-all` and
+`after-all` special forms.
+
+As the name implies, code blocks defined with `before-each` are called
+once before each spec in the `describe` is run, and the `after-each`
+code blocks are called once after each spec.
+
+Here is the same set of specs written a little differently. The
+variable under test is defined at the top-level scope — the `describe`
+block — and initialization code is moved into a `before-each` block.
+The `after-each` block resets the variable before continuing.
+
+```Lisp
+(describe "A spec using `before-each' and `after-each'"
+  (let ((foo 0))
+(before-each
+ (setq foo (1+ foo)))
+
+(after-each
+ (setq foo 0))
+
+(it "is just a function, so it can contain any code"
+  (expect foo :to-equal 1))
+
+(it "can have more than one expectation"
+  (expect foo :to-equal 1)
+  (expect t :to-equal t
+```
+
+The `before-all` form is called only once before all the specs in
+`describe` are run, and the `after-all` form is called after all specs
+finish. These functions can be used to speed up test suites with
+expensive setup and teardown.
+
+However, be careful using `before-all` and `after-all`! Since they are
+not reset between specs, it is easy to accidentally leak state between
+your specs so that they erroneously pass or fail.
+
+```Lisp
+(describe "A spec using `before-all' and `after-all'"
+  (let (foo)
+(before-all
+ (setq foo 1))
+
+(after-all
+ (setq foo 0))
+
+(it "sets the iniital value of foo before specs run"
+  (expect foo :to-equal 1)
+  (setq foo (1+ foo)))
+
+(it "does not reset foo between specs"
+  (expect foo :to-equal 2
+```
+
+### Nesting `describe` Blocks
+
+Calls to `describe` can be nested, with specs defined at any level.
+This allows a suite to be composed as a tree of functions. Before a
+spec is executed, Buttercup walks down the tree executing each
+`before-each` function in order. After the spec is executed, Buttercup
+walks through the `after-each` functions similarly.
+
+```Lisp
+(describe "A spec"
+  (let (foo)
+(before-each
+ (setq foo 0)
+ (setq foo (1+ foo)))
+
+(after-each
+ (setq foo 0))
+
+(it "is just a function, so it can contain any code"
+  (expect foo :to-equal 1))
+
+(it "can have more than one expectation"
+  (expect foo :to-equal 1)
+  (expect t :to-equal t))
+
+(describe "nested inside a second describe"
+  (let (bar)
+(before-each
+ (setq bar 1))
+
+(it "can reference both scopes as needed"
+  (expect foo :to-equal bar))
+```
 
 ## Test Runners
 
@@ -167,13 +278,12 @@ Evaluating `describe` forms just stores the suites. You 
need to use a
 test runner to actually evaluate them. Buttercup comes with two test
 runners by default:
 
-- `buttercup-run-suite-at-point` — Evaluate the topmost `describe`
-  form at point and run the suite it creates directly. Useful for
-  interactive development. But be careful, this uses your current
-  environment, which might not be clean (due to said interactive
-  development).
-- `buttercup-discover` — Find files in directories specified on the
-  command line, load them, and then run all suites defined therei

[nongnu] elpa/buttercup bb31c85 043/340: Edebugable.

2021-12-16 Thread ELPA Syncer
branch: elpa/buttercup
commit bb31c853d7eca3b6572349ca84ec88f932a5c587
Author: myeffort 
Commit: myeffort 

Edebugable.
---
 buttercup.el | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/buttercup.el b/buttercup.el
index c1b0be1..2bb893f 100644
--- a/buttercup.el
+++ b/buttercup.el
@@ -227,7 +227,7 @@ form.")
 
 (defmacro describe (description &rest body)
   "Describe a suite of tests."
-  (declare (indent 1))
+  (declare (indent 1) (debug (&define sexp def-body)))
   `(buttercup-describe ,description (lambda () ,@body)))
 
 (defun buttercup-describe (description body-function)
@@ -251,7 +251,7 @@ form.")
 
 (defmacro it (description &rest body)
   "Define a spec."
-  (declare (indent 1))
+  (declare (indent 1) (debug (&define sexp def-body)))
   `(buttercup-it ,description (lambda () ,@body)))
 
 (defun buttercup-it (description body-function)
@@ -268,7 +268,7 @@ form.")
 
 (defmacro before-each (&rest body)
   "Run BODY before each spec in the current suite."
-  (declare (indent 0))
+  (declare (indent 0) (debug (&define def-body)))
   `(buttercup-before-each (lambda () ,@body)))
 
 (defun buttercup-before-each (function)
@@ -279,7 +279,7 @@ form.")
 
 (defmacro after-each (&rest body)
   "Run BODY after each spec in the current suite."
-  (declare (indent 0))
+  (declare (indent 0) (debug (&define def-body)))
   `(buttercup-after-each (lambda () ,@body)))
 
 (defun buttercup-after-each (function)
@@ -290,7 +290,7 @@ form.")
 
 (defmacro before-all (&rest body)
   "Run BODY before every spec in the current suite."
-  (declare (indent 0))
+  (declare (indent 0) (debug (&define def-body)))
   `(buttercup-before-all (lambda () ,@body)))
 
 (defun buttercup-before-all (function)
@@ -301,7 +301,7 @@ form.")
 
 (defmacro after-all (&rest body)
   "Run BODY after every spec in the current suite."
-  (declare (indent 0))
+  (declare (indent 0) (debug (&define def-body)))
   `(buttercup-after-all (lambda () ,@body)))
 
 (defun buttercup-after-all (function)



[nongnu] elpa/buttercup cef9988 110/340: Merge pull request #61 from spwhitton/fix-regexp

2021-12-16 Thread ELPA Syncer
branch: elpa/buttercup
commit cef998879676fa118af486fb3e9b79c5958dcc77
Merge: b120003 abf2abe
Author: Jorgen Schäfer 
Commit: Jorgen Schäfer 

Merge pull request #61 from spwhitton/fix-regexp

Exclude hidden files and dirs in test root
---
 buttercup.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/buttercup.el b/buttercup.el
index 6d5a130..09a39c7 100644
--- a/buttercup.el
+++ b/buttercup.el
@@ -683,7 +683,7 @@ current directory."
 (dolist (dir (or dirs '(".")))
   (dolist (file (directory-files-recursively
  dir "\\`test-.*\\.el\\'\\|-tests?\\.el\\'"))
-(when (not (string-match "/\\." (file-relative-name file)))
+(when (not (string-match "\\(^\\|/\\)\\." (file-relative-name file)))
   (load file nil t
 (when patterns
   (let ((suites-or-specs buttercup-suites))



[nongnu] elpa/buttercup 55b87ec 039/340: Removed ROADMAP.md. This is now tracked in issues.

2021-12-16 Thread ELPA Syncer
branch: elpa/buttercup
commit 55b87eccc5de92858b683b86cfa8ec5e94523c5c
Author: Jorgen Schaefer 
Commit: Jorgen Schaefer 

Removed ROADMAP.md. This is now tracked in issues.
---
 ROADMAP.md | 43 ---
 1 file changed, 43 deletions(-)

diff --git a/ROADMAP.md b/ROADMAP.md
deleted file mode 100644
index 74d8b33..000
--- a/ROADMAP.md
+++ /dev/null
@@ -1,43 +0,0 @@
-# Version 1.1: The Missing Features
-
-## Pending Specs
-
-The following phrases were left out from `introduction.js`, and should
-be implemented still:
-
-> Pending specs do not run, _but their names will show up in the results as 
pending._
-
-> And if you call the function `pending` anywhere in the spec body, no matter 
the expectations, the spec will be marked pending. A string passed to pending 
will be treated as a reason and displayed when the suite finishes.
-
-## Reporter
-
-A reporter is a function that is called with various events during the
-execution of a test run. See
-[the Jasmine 
documentation](https://jasmine.github.io/edge/custom_reporter.html)
-for a list of useful events.
-
-By default, I’d like to have a `buttercup-reporter-batch` and
-`buttercup-reporter-interactive`.
-
-## Return of the Backtrace
-
-Suite execution should catch errors and include a backtrace in the
-result.
-
-# Version 1.2: Nice to Have
-
-## Disabled Suites and Pending Specs, again
-
-The `xdescribe`/`xit` macros should get their respective entries
-reported as actually disabled/pending, not just ignored.
-
-## defspy
-
-Syntactic sugar for `:and-call-fake`:
-
-```Lisp
-(defspy function-name (args ...)
-  body...
-  (spy-original 1 2)
-  ...)
-```



[nongnu] elpa/buttercup 4f68f0b 059/340: The buttercup-spec-full-name function.

2021-12-16 Thread ELPA Syncer
branch: elpa/buttercup
commit 4f68f0bfcebd8ffcd852466baa71b7e6136b667b
Author: Jorgen Schaefer 
Commit: Jorgen Schaefer 

The buttercup-spec-full-name function.
---
 buttercup-test.el | 20 
 buttercup.el  |  9 +
 2 files changed, 29 insertions(+)

diff --git a/buttercup-test.el b/buttercup-test.el
index 06f7a56..574c03b 100644
--- a/buttercup-test.el
+++ b/buttercup-test.el
@@ -225,6 +225,26 @@
   :to-equal
   "su1 su2"
 
+(describe "The `buttercup-spec-full-name' function"
+  (let (su1 su2 sp1)
+(before-each
+  (setq su1 (make-buttercup-suite :description "su1")
+su2 (make-buttercup-suite :description "su2")
+sp1 (make-buttercup-spec :description "sp1")
+sp2 (make-buttercup-spec :description "sp2"))
+  (buttercup-suite-add-child su1 su2)
+  (buttercup-suite-add-child su2 sp2))
+
+(it "should return the full name of a spec without parents"
+  (expect (buttercup-spec-full-name sp1)
+  :to-equal
+  "sp1"))
+
+(it "should return the full name of a spec with parents"
+  (expect (buttercup-spec-full-name sp2)
+  :to-equal
+  "su1 su2 sp2"
+
 
 ;;; Suites: describe
 
diff --git a/buttercup.el b/buttercup.el
index 7b42d71..9012789 100644
--- a/buttercup.el
+++ b/buttercup.el
@@ -278,6 +278,15 @@ MATCHER is either a matcher defined with
(reverse name-parts)
" ")))
 
+(defun buttercup-spec-full-name (spec)
+  "Return the full name of SPEC, which includes the full name of its suite."
+  (let ((parent (buttercup-spec-parent spec)))
+(if parent
+(concat (buttercup-suite-full-name parent)
+" "
+(buttercup-spec-description spec))
+  (buttercup-spec-description spec
+
 
 ;;; Suites: describe
 



[nongnu] elpa/buttercup 5db07c9 112/340: Merge pull request #63 from ebpa/patch-1

2021-12-16 Thread ELPA Syncer
branch: elpa/buttercup
commit 5db07c940e3acbd20111391c72edfa847e7a5409
Merge: cef9988 ab2a558
Author: Jorgen Schäfer 
Commit: GitHub 

Merge pull request #63 from ebpa/patch-1

Add projectile integration info to Readme
---
 docs/running-tests.md | 14 ++
 1 file changed, 14 insertions(+)

diff --git a/docs/running-tests.md b/docs/running-tests.md
index ab8ed3a..bb77b9f 100644
--- a/docs/running-tests.md
+++ b/docs/running-tests.md
@@ -102,6 +102,20 @@ different pattern using the `--pattern` command line 
argument to the
 You can run this command whichever way you like. Common choices
 include a makefile or shell scripts.
 
+## Projectile
+
+If you use [Projectile](https://github.com/bbatsov/projectile) for interacting 
with your projects you can set the "default" project test command to be 
available when you invoke `projectile-test-project`.  Create a `.dir-locals.el` 
file in the the root of your project tree (next to your Cask file).  An example:
+
+**.dir-locals.el**
+
+```
+((nil . ((eval . (progn
+   (require 'projectile)
+   (puthash (projectile-project-root)
+"cask exec buttercup -L ."
+projectile-test-cmd-map))
+```
+
 ## Travis
 
 If your project is hosted on github, you can use



[nongnu] elpa/buttercup 537b729 044/340: Merge pull request #6 from myeffort/master

2021-12-16 Thread ELPA Syncer
branch: elpa/buttercup
commit 537b729d4b7eb6400994f9559709e7fb0d28c90b
Merge: f046eef bb31c85
Author: Jorgen Schäfer 
Commit: Jorgen Schäfer 

Merge pull request #6 from myeffort/master

Enabling macros for inspection with edebug.
---
 buttercup.el | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/buttercup.el b/buttercup.el
index c1b0be1..2bb893f 100644
--- a/buttercup.el
+++ b/buttercup.el
@@ -227,7 +227,7 @@ form.")
 
 (defmacro describe (description &rest body)
   "Describe a suite of tests."
-  (declare (indent 1))
+  (declare (indent 1) (debug (&define sexp def-body)))
   `(buttercup-describe ,description (lambda () ,@body)))
 
 (defun buttercup-describe (description body-function)
@@ -251,7 +251,7 @@ form.")
 
 (defmacro it (description &rest body)
   "Define a spec."
-  (declare (indent 1))
+  (declare (indent 1) (debug (&define sexp def-body)))
   `(buttercup-it ,description (lambda () ,@body)))
 
 (defun buttercup-it (description body-function)
@@ -268,7 +268,7 @@ form.")
 
 (defmacro before-each (&rest body)
   "Run BODY before each spec in the current suite."
-  (declare (indent 0))
+  (declare (indent 0) (debug (&define def-body)))
   `(buttercup-before-each (lambda () ,@body)))
 
 (defun buttercup-before-each (function)
@@ -279,7 +279,7 @@ form.")
 
 (defmacro after-each (&rest body)
   "Run BODY after each spec in the current suite."
-  (declare (indent 0))
+  (declare (indent 0) (debug (&define def-body)))
   `(buttercup-after-each (lambda () ,@body)))
 
 (defun buttercup-after-each (function)
@@ -290,7 +290,7 @@ form.")
 
 (defmacro before-all (&rest body)
   "Run BODY before every spec in the current suite."
-  (declare (indent 0))
+  (declare (indent 0) (debug (&define def-body)))
   `(buttercup-before-all (lambda () ,@body)))
 
 (defun buttercup-before-all (function)
@@ -301,7 +301,7 @@ form.")
 
 (defmacro after-all (&rest body)
   "Run BODY after every spec in the current suite."
-  (declare (indent 0))
+  (declare (indent 0) (debug (&define def-body)))
   `(buttercup-after-all (lambda () ,@body)))
 
 (defun buttercup-after-all (function)



[nongnu] elpa/buttercup 13c463a 050/340: Add more extensive usage instructions to the README.

2021-12-16 Thread ELPA Syncer
branch: elpa/buttercup
commit 13c463aca1b45f1eeb64607177386837f3272858
Author: Jorgen Schaefer 
Commit: Jorgen Schaefer 

Add more extensive usage instructions to the README.

Fixes #8
---
 README.md | 66 +++
 1 file changed, 66 insertions(+)

diff --git a/README.md b/README.md
index 50ff056..aa79d38 100644
--- a/README.md
+++ b/README.md
@@ -12,6 +12,72 @@ All code in this file can be run by Buttercup’s built-in 
markdown test
 runner. Just use `make test` in the project directory to see the
 output.
 
+## Getting Started
+
+You can install buttercup from
+[MELPA Stable](http://stable.melpa.org/). Add the following to your
+`init.el` or `.emacs` file:
+
+```
+(require 'package)
+(add-to-list 'package-archives
+ '("melpa-stable" . "http://stable.melpa.org/packages/";) t)
+```
+
+This should allow you to `M-x package-install RET buttercup RET`.
+Afterwards, in an otherwise empty directory, create a file called
+`some-test.el` with the following contents:
+
+```Lisp
+(describe "A suite"
+  (it "contains a spec with an expectation"
+(expect t :to-be t)))
+```
+
+You can now use buttercup to run this test:
+
+```
+$ emacs -batch -f package-initialize -l buttercup -f buttercup-run-discover
+A suite
+  contains a spec with an expectation
+```
+
+Congratulations, you just ran your first tests!
+
+## Full Project Example
+
+Tests should be run in an environment separate from your interactive
+Emacs. To get such an environment and install packages into it, you
+can use [Cask](https://github.com/cask/cask). For installation
+instructions see there.
+
+In the directory from above, create a new file called `Cask` with the
+following contents:
+
+```
+(source gnu)
+(source melpa-stable)
+
+(development
+ (depends-on "buttercup"))
+```
+
+Now you can tell cask to download and install the depended-on packages
+in the environment of the current directory:
+
+```
+$ cask install
+```
+
+You only need to do this once. Subsequently, you can run buttercup
+tests simply by invoking buttercup using cask:
+
+```
+$ cask exec buttercup
+A suite
+  contains a spec with an expectation
+```
+
 ## Suites: `describe` Your Tests
 
 A test suite begins with a call to the Buttercup macro `describe` with



[nongnu] elpa/buttercup 562cdb0 058/340: The buttercup-suite-full-name function.

2021-12-16 Thread ELPA Syncer
branch: elpa/buttercup
commit 562cdb0393185e122bff673ff2259fa638c818b2
Author: Jorgen Schaefer 
Commit: Jorgen Schaefer 

The buttercup-suite-full-name function.
---
 buttercup-test.el | 17 +
 buttercup.el  |  8 
 2 files changed, 25 insertions(+)

diff --git a/buttercup-test.el b/buttercup-test.el
index d27bdf2..06f7a56 100644
--- a/buttercup-test.el
+++ b/buttercup-test.el
@@ -208,6 +208,23 @@
   :to-equal
   2
 
+(describe "The `buttercup-suite-full-name' function"
+  (let (su1 su2)
+(before-each
+  (setq su1 (make-buttercup-suite :description "su1")
+su2 (make-buttercup-suite :description "su2"))
+  (buttercup-suite-add-child su1 su2))
+
+(it "should return the full name of a suite without parents"
+  (expect (buttercup-suite-full-name su1)
+  :to-equal
+  "su1"))
+
+(it "should return the full name of a suite with parents"
+  (expect (buttercup-suite-full-name su2)
+  :to-equal
+  "su1 su2"
+
 
 ;;; Suites: describe
 
diff --git a/buttercup.el b/buttercup.el
index a81ea6d..7b42d71 100644
--- a/buttercup.el
+++ b/buttercup.el
@@ -270,6 +270,14 @@ MATCHER is either a matcher defined with
 (apply #'+ (mapcar #'buttercup--total-specs-defined
(buttercup-suite-children suite-or-spec)
 
+(defun buttercup-suite-full-name (suite)
+  "Return the full name of SUITE, which includes the names of the parents."
+  (let ((name-parts (mapcar #'buttercup-suite-description
+(cons suite (buttercup-suite-parents suite)
+(mapconcat #'identity
+   (reverse name-parts)
+   " ")))
+
 
 ;;; Suites: describe
 



[nongnu] elpa/buttercup 162b862 060/340: The buttercup--funcall function.

2021-12-16 Thread ELPA Syncer
branch: elpa/buttercup
commit 162b862c603bed00637efdb88780d188df538307
Author: Jorgen Schaefer 
Commit: Jorgen Schaefer 

The buttercup--funcall function.
---
 buttercup-test.el | 18 ++
 buttercup.el  | 48 
 2 files changed, 66 insertions(+)

diff --git a/buttercup-test.el b/buttercup-test.el
index 574c03b..12c859d 100644
--- a/buttercup-test.el
+++ b/buttercup-test.el
@@ -576,3 +576,21 @@
 
 (it "should handle the end event"
   (buttercup-reporter-batch 'buttercup-done nil
+
+;
+;;; Utilities
+
+(describe "The `buttercup--funcall' function'"
+  (it "should return passed if everything works fine"
+(let ((res (buttercup--funcall (lambda () (+ 2 3)
+  (expect res
+  :to-equal
+  (list 'passed 5 nil
+
+  (it "should return failed with the correct stack if an exception occurred"
+(let ((res (buttercup--funcall (lambda () (/ 1 0)
+  (expect res
+  :to-equal
+  (list 'failed
+'(error (arith-error))
+(list '(t / 1 0)))
diff --git a/buttercup.el b/buttercup.el
index 9012789..5f2ae75 100644
--- a/buttercup.el
+++ b/buttercup.el
@@ -707,5 +707,53 @@ buttercup-done -- All suites have run, the test run is 
over.")
 (t
  (error "Unknown event %s" event
 
+;
+;;; Utilities
+
+(defun buttercup--funcall (function &rest arguments)
+  "Call FUNCTION with ARGUMENTS.
+
+Returns a list of three values. The first is the state:
+
+passed -- The second value is the return value of the function
+  call, the third is nil.
+
+failed -- The second value is the error that occurred, the third
+  is the stack trace."
+  (catch 'buttercup-debugger-continue
+(let ((debugger #'buttercup--debugger)
+  (debug-on-error t)
+  (debug-ignored-errors nil))
+  (list 'passed
+(apply function arguments)
+nil
+
+(defun buttercup--debugger (&rest args)
+  ;; If we do not do this, Emacs will not run this handler on
+  ;; subsequent calls. Thanks to ert for this.
+  (setq num-nonmacro-input-events (1+ num-nonmacro-input-events))
+  (throw 'buttercup-debugger-continue
+ (list 'failed args (buttercup--backtrace
+
+
+(defun buttercup--backtrace ()
+  (let* ((n 0)
+ (frame (backtrace-frame n))
+ (frame-list nil)
+ (in-program-stack nil))
+(while frame
+  (when in-program-stack
+(push frame frame-list))
+  (when (eq (elt frame 1)
+'buttercup--debugger)
+(setq in-program-stack t))
+  (when (eq (elt frame 1)
+'buttercup--funcall)
+(setq in-program-stack nil
+  frame-list (nthcdr 6 frame-list)))
+  (setq n (1+ n)
+frame (backtrace-frame n)))
+frame-list))
+
 (provide 'buttercup)
 ;;; buttercup.el ends here



[nongnu] elpa/buttercup ed649d7 125/340: Merge pull request #76 from DamienCassou/make-buttercup--with-cleanup-public

2021-12-16 Thread ELPA Syncer
branch: elpa/buttercup
commit ed649d722aeb20683705a2378438833efd96e271
Merge: 54696b0 d5c9a19
Author: Jorgen Schäfer 
Commit: GitHub 

Merge pull request #76 from DamienCassou/make-buttercup--with-cleanup-public

Make --with-cleanup public so spies can be used without specs
---
 buttercup.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/buttercup.el b/buttercup.el
index 5c6c55a..fb8564d 100644
--- a/buttercup.el
+++ b/buttercup.el
@@ -564,7 +564,7 @@ KEYWORD can have one of the following values:
 
 (defvar buttercup--cleanup-functions nil)
 
-(defmacro buttercup--with-cleanup (&rest body)
+(defmacro buttercup-with-cleanup (&rest body)
   `(let ((buttercup--cleanup-functions nil))
  (unwind-protect (progn ,@body)
(dolist (fun buttercup--cleanup-functions)
@@ -765,7 +765,7 @@ Do not change the global value.")
 
 (defun buttercup--run-spec (spec)
   (funcall buttercup-reporter 'spec-started spec)
-  (buttercup--with-cleanup
+  (buttercup-with-cleanup
(dolist (f buttercup--before-each)
  (buttercup--update-with-funcall spec f))
(buttercup--update-with-funcall spec (buttercup-spec-function spec))



[nongnu] elpa/buttercup 182a974 068/340: Pending specs and disabled suites.

2021-12-16 Thread ELPA Syncer
branch: elpa/buttercup
commit 182a974140fcdd6fcf94e4845d3d96cb7bb68147
Author: Jorgen Schaefer 
Commit: Jorgen Schaefer 

Pending specs and disabled suites.
---
 buttercup-test.el | 51 ++-
 buttercup.el  | 81 ++-
 2 files changed, 94 insertions(+), 38 deletions(-)

diff --git a/buttercup-test.el b/buttercup-test.el
index 20b7a42..8cc48d8 100644
--- a/buttercup-test.el
+++ b/buttercup-test.el
@@ -29,6 +29,13 @@
 :to-throw
 'buttercup-failed)))
 
+(describe "The buttercup-pending signal"
+  (it "can be raised"
+(expect (lambda ()
+  (signal 'buttercup-pending t))
+:to-throw
+'buttercup-pending)))
+
 (describe "The `expect' form"
   (it "with a matcher should translate directly to the function call"
 (expect (macroexpand '(expect (+ 1 1) :to-equal 2))
@@ -304,7 +311,13 @@
   (it "should expand to a call to the `buttercup-it' function"
 (expect (macroexpand '(it "description" body))
 :to-equal
-'(buttercup-it "description" (lambda () body)
+'(buttercup-it "description" (lambda () body
+
+  (it "without argument should expand to a pending signal raiser."
+(expect (macroexpand '(it "description"))
+:to-equal
+'(buttercup-it "description"
+   (lambda () (signal 'buttercup-pending t))
 
 (describe "The `buttercup-it' function"
   (it "should fail if not called from within a describe form"
@@ -407,7 +420,17 @@
   (buttercup-xdescribe
"bla bla"
(lambda () (error "should not happen"
-:not :to-throw)))
+:not :to-throw))
+
+  (it "should add a pending suite"
+(let ((buttercup--current-suite nil)
+  (buttercup-suites nil))
+  (buttercup-xdescribe
+   "bla bla"
+   (lambda () nil))
+  (expect (buttercup-suite-status (car buttercup-suites))
+  :to-be
+  'pending
 
 ;;
 ;;; Pending Specs: xit
@@ -421,10 +444,19 @@
 (describe "The `buttercup-xit' function"
   (it "should be a no-op"
 (expect (lambda ()
-  (buttercup-xit
-   "bla bla"
-   (lambda () (error "should not happen"
-:not :to-throw)))
+  (let ((buttercup--current-suite (make-buttercup-suite)))
+(buttercup-xit
+ "bla bla"
+ (lambda () (error "should not happen")
+:not :to-throw))
+
+  (it "should add a function that raises a pending signal"
+(let ((buttercup--current-suite (make-buttercup-suite)))
+  (buttercup-xit "bla bla" (lambda ()
+ (error "should not happen")))
+  (expect (buttercup-spec-function
+   (car (buttercup-suite-children buttercup--current-suite)))
+  :to-throw 'buttercup-pending
 
 ;
 ;;; Spies
@@ -651,13 +683,6 @@
 (error "Expected passing buttercup--funcall not to return %S"
res)))
 
-(let ((res (buttercup--funcall (lambda () (buttercup-fail "Bla")
-  (when (not (equal res (list 'failed
-  "Bla"
-  nil)))
-(error "Expected failing buttercup--funcall not to return %S"
-   res)))
-
 (let ((res (buttercup--funcall (lambda () (/ 1 0)
   (when (not (equal res (list 'failed
   '(error (arith-error))
diff --git a/buttercup.el b/buttercup.el
index 402c886..492b435 100644
--- a/buttercup.el
+++ b/buttercup.el
@@ -48,6 +48,9 @@
 (define-error 'buttercup-failed
   "Buttercup test failed")
 
+(define-error 'buttercup-pending
+  "Buttercup test is pending")
+
 (defmacro expect (arg &optional matcher &rest args)
   "Expect a condition to be true.
 
@@ -337,7 +340,11 @@ form.")
   (let* ((enclosing-suite buttercup--current-suite)
  (buttercup--current-suite (make-buttercup-suite
 :description description)))
-(funcall body-function)
+(condition-case err
+(funcall body-function)
+  (buttercup-pending
+   (setf (buttercup-suite-status buttercup--current-suite)
+ 'pending)))
 (if enclosing-suite
 (buttercup-suite-add-child enclosing-suite
buttercup--current-suite)
@@ -350,7 +357,10 @@ form.")
 (defmacro it (description &rest body)
   "Define a spec."
   (declare (indent 1) (debug (&define sexp def-body)))
-  `(buttercup-it ,description (lambda () ,@body)))
+  (if body
+  `(buttercup-it ,description (lambda () ,@body))
+`(buttercup-it ,description (lambda ()
+  (signal 'buttercup-pending t)
 
 (defun buttercup-it (description body-function)
   "Function to handle an `it' form."
@@ -422,7 +432,8 @@ A disabled suite is not run."
   "Like `buttercup-describe', but mark th

[nongnu] elpa/buttercup 0c5cc32 057/340: The buttercup-suites-total-specs-defined function.

2021-12-16 Thread ELPA Syncer
branch: elpa/buttercup
commit 0c5cc3251442d69b1d7edcb443120ad09451e698
Author: Jorgen Schaefer 
Commit: Jorgen Schaefer 

The buttercup-suites-total-specs-defined function.
---
 buttercup-test.el | 21 +++--
 buttercup.el  | 22 --
 2 files changed, 39 insertions(+), 4 deletions(-)

diff --git a/buttercup-test.el b/buttercup-test.el
index 22b750c..d27bdf2 100644
--- a/buttercup-test.el
+++ b/buttercup-test.el
@@ -133,8 +133,8 @@
 
 ;; Are tested in README.md
 
-
-;;; Suites: describe
+;;
+;;; Suite and spec data structures
 
 (describe "The `buttercup-suite-add-child' function"
   (it "should add an element at the end of the list"
@@ -194,6 +194,23 @@
   :to-equal
   (list parent grandparent)
 
+(describe "The `buttercup-suites-total-specs-defined' function"
+  (it "should return the number of specs in a list of suites"
+(let ((su1 (make-buttercup-suite :description "su1"))
+  (su2 (make-buttercup-suite :description "su2"))
+  (sp1 (make-buttercup-spec :description "sp1"))
+  (sp2 (make-buttercup-spec :description "sp2")))
+  (buttercup-suite-add-child su1 su2)
+  (buttercup-suite-add-child su1 sp1)
+  (buttercup-suite-add-child su2 sp2)
+
+  (expect (buttercup-suites-total-specs-defined (list su1))
+  :to-equal
+  2
+
+
+;;; Suites: describe
+
 (describe "The `describe' macro"
   (it "should expand to a simple call to the describe function"
 (expect (macroexpand '(describe "description" (+ 1 1)))
diff --git a/buttercup.el b/buttercup.el
index 2791e6b..a81ea6d 100644
--- a/buttercup.el
+++ b/buttercup.el
@@ -211,8 +211,8 @@ MATCHER is either a matcher defined with
   (t
(cons t (format "Expected %S not to throw an error" function)))
 
-
-;;; Suites: describe
+;;
+;;; Suite and spec data structures
 
 (cl-defstruct buttercup-suite
   description
@@ -255,6 +255,24 @@ MATCHER is either a matcher defined with
 (buttercup-suite-parents (buttercup-spec-parent spec)))
 nil))
 
+(defun buttercup-suites-total-specs-defined (suite-list)
+  "Return the number of specs defined in all suites in SUITE-LIST."
+  (let ((nspecs 0))
+(dolist (suite suite-list)
+  (setq nspecs (+ nspecs
+  (buttercup--total-specs-defined suite
+nspecs))
+
+(defun buttercup--total-specs-defined (suite-or-spec)
+  "Return the number of specs defined in SUITE-OR-SPEC and its children."
+  (if (buttercup-spec-p suite-or-spec)
+  1
+(apply #'+ (mapcar #'buttercup--total-specs-defined
+   (buttercup-suite-children suite-or-spec)
+
+
+;;; Suites: describe
+
 (defvar buttercup-suites nil
   "The list of all currently defined Buttercup suites.")
 



[nongnu] elpa/buttercup 3deb9a4 053/340: Test discovery: Ignore files in dot directories.

2021-12-16 Thread ELPA Syncer
branch: elpa/buttercup
commit 3deb9a4f4ebf68f3dea264afa4867782a44030b5
Author: Jorgen Schaefer 
Commit: Jorgen Schaefer 

Test discovery: Ignore files in dot directories.

We could find tests in .cask subdirectories, that's not the point.
---
 buttercup.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/buttercup.el b/buttercup.el
index de07c57..73fe6f0 100644
--- a/buttercup.el
+++ b/buttercup.el
@@ -523,7 +523,8 @@ current directory."
   (dolist (dir (or command-line-args-left '(".")))
 (dolist (file (directory-files-recursively dir
"\\'test-\\|-test.el\\'"))
-  (load file nil t)))
+  (when (not (string-match "/\\." file))
+(load file nil t
   (buttercup-run))
 
 ;;;###autoload



[nongnu] elpa/buttercup 07c525e 116/340: Merge pull request #68 from ebpa/report-load-errors

2021-12-16 Thread ELPA Syncer
branch: elpa/buttercup
commit 07c525eaf9c1a9f1b48928b64e1802b1f1b25be3
Merge: 794afbf ce75b50
Author: Jorgen Schäfer 
Commit: GitHub 

Merge pull request #68 from ebpa/report-load-errors

Report load errors in buttercup-run-discover
---
 buttercup.el | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/buttercup.el b/buttercup.el
index 09a39c7..0def52d 100644
--- a/buttercup.el
+++ b/buttercup.el
@@ -684,7 +684,10 @@ current directory."
   (dolist (file (directory-files-recursively
  dir "\\`test-.*\\.el\\'\\|-tests?\\.el\\'"))
 (when (not (string-match "\\(^\\|/\\)\\." (file-relative-name file)))
-  (load file nil t
+  (condition-case err
+  (load file nil t)
+(error
+ (message (format "Error while loading %s:\n%s" file 
(error-message-string err
 (when patterns
   (let ((suites-or-specs buttercup-suites))
 (while suites-or-specs



[nongnu] elpa/buttercup a55a638 064/340: More and better tests for the batch reporter.

2021-12-16 Thread ELPA Syncer
branch: elpa/buttercup
commit a55a6386c5ac75d5055a9195813760491323e655
Author: Jorgen Schaefer 
Commit: Jorgen Schaefer 

More and better tests for the batch reporter.
---
 buttercup-test.el | 96 ---
 1 file changed, 70 insertions(+), 26 deletions(-)

diff --git a/buttercup-test.el b/buttercup-test.el
index ec5068e..735bd9e 100644
--- a/buttercup-test.el
+++ b/buttercup-test.el
@@ -548,42 +548,86 @@
   (buttercup-suite-add-child child-suite spec)
   (spy-on 'buttercup--print))
 
-(it "should handle the start event"
-  (buttercup-reporter-batch 'buttercup-started nil))
+(describe "on the buttercup-started event"
+  (it "should emit the number of specs"
+(let ((buttercup-reporter-batch--start-time nil))
+  (buttercup-reporter-batch 'buttercup-started (list parent-suite)))
 
-(it "should emit an indented suite description on suite start"
-  (buttercup-reporter-batch 'suite-started child-suite)
+(expect 'buttercup--print
+:to-have-been-called-with
+"Running %s specs.\n\n"
+1)))
 
-  (expect 'buttercup--print
-  :to-have-been-called-with
-  "%s%s\n"
-  "  "
-  "child-suite"))
+(describe "on the suite-started event"
+  (it "should emit an indented suite description"
+(buttercup-reporter-batch 'suite-started child-suite)
 
-(it "should emit an indented spec description on spec start"
-  (buttercup-reporter-batch 'spec-started spec)
+(expect 'buttercup--print
+:to-have-been-called-with
+"%s%s\n"
+"  "
+"child-suite")))
 
-  (expect 'buttercup--print
-  :to-have-been-called-with
-  "%s%s"
-  ""
-  "spec"))
+(describe "on the spec-started event"
+  (it "should emit an indented spec description"
+(buttercup-reporter-batch 'spec-started spec)
 
-(it "should handle the spec done event"
-  (buttercup-reporter-batch 'spec-done spec))
+(expect 'buttercup--print
+:to-have-been-called-with
+"%s%s"
+""
+"spec")))
 
-(it "should emit a newline at the end of the top-level suite"
-  (buttercup-reporter-batch 'suite-done parent-suite)
+(describe "on the spec-done event"
+  (it "should simply emit a newline for a passed spec"
+(buttercup-reporter-batch 'spec-done spec)
 
-  (expect 'buttercup--print :to-have-been-called-with "\n"))
+(expect 'buttercup--print :to-have-been-called-with "\n"))
 
-(it "should not emit anything at the end of other suites"
-  (buttercup-reporter-batch 'suite-done child-suite)
+  (it "should say FAILED for a failed spec"
+(setf (buttercup-spec-status spec) 'failed)
 
-  (expect 'buttercup--print :not :to-have-been-called))
+(let ((buttercup-reporter-batch--failures nil))
+  (buttercup-reporter-batch 'spec-done spec))
 
-(it "should handle the end event"
-  (buttercup-reporter-batch 'buttercup-done nil
+(expect 'buttercup--print :to-have-been-called-with "  FAILED\n"))
+
+  (it "should throw an error for an unknown spec status"
+(setf (buttercup-spec-status spec) 'unknown)
+
+(expect (lambda ()
+  (buttercup-reporter-batch 'spec-done spec))
+:to-throw)))
+
+(describe "on the suite-done event"
+  (it "should emit a newline at the end of the top-level suite"
+(buttercup-reporter-batch 'suite-done parent-suite)
+
+(expect 'buttercup--print :to-have-been-called-with "\n"))
+
+  (it "should not emit anything at the end of other suites"
+(buttercup-reporter-batch 'suite-done child-suite)
+
+(expect 'buttercup--print :not :to-have-been-called)))
+
+(describe "on the buttercup-done event"
+  ;; This is a lie. It should do a ton more stuff. We should test
+  ;; that, too.
+  (it "should handle the end event"
+(buttercup-reporter-batch 'buttercup-done nil))
+
+  (it "should raise an error if at least one spec failed"
+(setf (buttercup-spec-status spec) 'failed)
+
+(expect (lambda ()
+  (buttercup-reporter-batch 'buttercup-done (list spec)))
+:to-throw)))
+
+(describe "on an unknown event"
+  (it "should raise an error"
+(expect (lambda ()
+  (buttercup-reporter-batch 'unknown-event nil))
+:to-throw)
 
 ;
 ;;; Utilities



[nongnu] elpa/buttercup c61a69a 066/340: A rudimentary interactive reporter.

2021-12-16 Thread ELPA Syncer
branch: elpa/buttercup
commit c61a69ab62d10d6673893917162a0f2b44f1f82b
Author: Jorgen Schaefer 
Commit: Jorgen Schaefer 

A rudimentary interactive reporter.
---
 buttercup.el | 30 +-
 1 file changed, 29 insertions(+), 1 deletion(-)

diff --git a/buttercup.el b/buttercup.el
index ce23743..4bfc769 100644
--- a/buttercup.el
+++ b/buttercup.el
@@ -686,7 +686,7 @@ Do not change the global value.")
 ;
 ;;; Reporters
 
-(defvar buttercup-reporter #'buttercup-reporter-batch
+(defvar buttercup-reporter #'buttercup-reporter-adaptive
   "The reporter function for buttercup test runs.
 
 During a run of buttercup, the value of this variable is called
@@ -711,6 +711,15 @@ suite-done -- A suite has finished. The argument is the 
spec.
 
 buttercup-done -- All suites have run, the test run is over.")
 
+(defun buttercup-reporter-adaptive (event arg)
+  "A reporter that handles both interactive and noninteractive sessions.
+
+Calls either `buttercup-reporter-batch' or
+`buttercup-reporter-interactive', depending."
+  (if noninteractive
+  (buttercup-reporter-batch event arg)
+(buttercup-reporter-interactive event arg)))
+
 (defvar buttercup-reporter-batch--start-time nil
   "The time the last batch report started.")
 
@@ -790,6 +799,25 @@ buttercup-done -- All suites have run, the test run is 
over.")
 (defun buttercup--print (fmt &rest args)
   (send-string-to-terminal (apply #'format fmt args)))
 
+(defun buttercup-reporter-interactive (event arg)
+  "Reporter for interactive uses."
+  ;; This is a bit rudimentary ...
+  (with-current-buffer (get-buffer-create "*Buttercup*")
+(when (eq event 'buttercup-started)
+  (erase-buffer)
+  (view-mode 1)
+  (display-buffer (current-buffer)))
+(let ((old-print (symbol-function 'buttercup--print))
+  (buf (current-buffer)))
+  (fset 'buttercup--print (lambda (fmt &rest args)
+(with-current-buffer buf
+  (let ((inhibit-read-only t))
+(goto-char (point-max))
+(insert (apply 'format fmt args))
+  (unwind-protect
+  (buttercup-reporter-batch event arg)
+(fset 'buttercup--print old-print)
+
 ;
 ;;; Utilities
 



[nongnu] elpa/buttercup d264da3 075/340: Merge pull request #17 from Fuco1/master

2021-12-16 Thread ELPA Syncer
branch: elpa/buttercup
commit d264da34644fe34dce27ea7b397e353b40eb7f70
Merge: 87e0c0d f3d6709
Author: Jorgen Schäfer 
Commit: Jorgen Schäfer 

Merge pull request #17 from Fuco1/master

Use relative path when testing for dotfiles in current project
---
 buttercup.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/buttercup.el b/buttercup.el
index 3b830e0..dcbb86e 100644
--- a/buttercup.el
+++ b/buttercup.el
@@ -621,7 +621,7 @@ current directory."
   (dolist (dir (or command-line-args-left '(".")))
 (dolist (file (directory-files-recursively dir
"\\`test-\\|-test.el\\'"))
-  (when (not (string-match "/\\." file))
+  (when (not (string-match "/\\." (file-relative-name file)))
 (load file nil t
   (buttercup-run))
 



[nongnu] elpa/buttercup ef7b730 063/340: Various improvements of the batch reporter.

2021-12-16 Thread ELPA Syncer
branch: elpa/buttercup
commit ef7b730c0c6b0f45716bf473f90a1530aa587ec0
Author: Jorgen Schaefer 
Commit: Jorgen Schaefer 

Various improvements of the batch reporter.
---
 buttercup-test.el |  2 +-
 buttercup.el  | 62 ++-
 2 files changed, 44 insertions(+), 20 deletions(-)

diff --git a/buttercup-test.el b/buttercup-test.el
index 9d8bd4d..ec5068e 100644
--- a/buttercup-test.el
+++ b/buttercup-test.el
@@ -565,7 +565,7 @@
 
   (expect 'buttercup--print
   :to-have-been-called-with
-  "%s%s\n"
+  "%s%s"
   ""
   "spec"))
 
diff --git a/buttercup.el b/buttercup.el
index e82950e..ce23743 100644
--- a/buttercup.el
+++ b/buttercup.el
@@ -632,7 +632,8 @@ current directory."
 
 (defun buttercup-run ()
   (if buttercup-suites
-  (progn
+  (let ((print-escape-newlines t)
+(print-escape-nonascii t))
 (funcall buttercup-reporter 'buttercup-started buttercup-suites)
 (mapc #'buttercup--run-suite buttercup-suites)
 (funcall buttercup-reporter 'buttercup-done buttercup-suites))
@@ -710,9 +711,16 @@ suite-done -- A suite has finished. The argument is the 
spec.
 
 buttercup-done -- All suites have run, the test run is over.")
 
+(defvar buttercup-reporter-batch--start-time nil
+  "The time the last batch report started.")
+
+(defvar buttercup-reporter-batch--failures nil
+  "List of failed specs of the current batch report.")
+
 (defun buttercup-reporter-batch (event arg)
   (pcase event
 (`buttercup-started
+ (setq buttercup-reporter-batch--start-time (float-time))
  (buttercup--print "Running %s specs.\n\n"
(buttercup-suites-total-specs-defined arg)))
 
@@ -724,38 +732,55 @@ buttercup-done -- All suites have run, the test run is 
over.")
 
 (`spec-started
  (let ((level (length (buttercup-spec-parents arg
-   (buttercup--print "%s%s\n"
+   (buttercup--print "%s%s"
  (make-string (* 2 level) ?\s)
  (buttercup-spec-description arg
 
 (`spec-done
  (cond
   ((eq (buttercup-spec-status arg) 'passed)
-   t)
+   (buttercup--print "\n"))
   ((eq (buttercup-spec-status arg) 'failed)
-   (let ((description (buttercup-spec-failure-description arg))
- (stack (buttercup-spec-failure-stack arg)))
- (when stack
-   (buttercup--print "\nTraceback (most recent call last):\n")
-   (dolist (frame stack)
- (buttercup--print "  %S\n" (cdr frame
- (if (stringp description)
- (buttercup--print "FAILED: %s\n"
-   (buttercup-spec-failure-description arg))
-   (buttercup--print "%S: %S\n\n" (car err) (cdr err)))
- (buttercup--print "\n")))
+   (buttercup--print "  FAILED\n")
+   (setq buttercup-reporter-batch--failures
+ (append buttercup-reporter-batch--failures
+ (list arg
   (t
-   (buttercup--print "??? %S\n" (buttercup-spec-status arg)
+   (error "Unknown spec status %s" (buttercup-spec-status arg)
 
 (`suite-done
  (when (= 0 (length (buttercup-suite-parents arg)))
(buttercup--print "\n")))
 
 (`buttercup-done
- (buttercup--print "Ran %s specs, %s failed.\n"
+ (dolist (failed buttercup-reporter-batch--failures)
+   (let ((description (buttercup-spec-failure-description failed))
+ (stack (buttercup-spec-failure-stack failed)))
+ (buttercup--print "%s\n" (make-string 40 ?=))
+ (buttercup--print "%s\n" (buttercup-spec-full-name failed))
+ (when stack
+   (buttercup--print "\nTraceback (most recent call last):\n")
+   (dolist (frame stack)
+ (let ((line (format "  %S" (cdr frame
+   (when (> (length line) 79)
+ (setq line (concat (substring line 0 76)
+"...")))
+   (buttercup--print "%s\n" line
+ (cond
+  ((stringp description)
+   (buttercup--print "FAILED: %s\n" description))
+  ((eq (car description) 'error)
+   (buttercup--print "%S: %S\n\n"
+ (car description)
+ (cadr description)))
+  (t
+   (buttercup--print "FAILED: %S\n" description)))
+ (buttercup--print "\n")))
+ (buttercup--print "Ran %s specs, %s failed, in %.1f seconds.\n"
(buttercup-suites-total-specs-defined arg)
(buttercup-suites-total-specs-failed arg)
-   )
+   (- (float-time)
+  buttercup-reporter-batch--start-time))
  (when (> (buttercup-suites-total-specs-failed arg) 0)
(error "")))
 
@@ -763,8 +788,7 @@ buttercup-done -- All suites have run, the test run is 
over.")
  (

[nongnu] elpa/buttercup 2aa840c 088/340: Merge pull request #40 from lunaryorn/assume-form

2021-12-16 Thread ELPA Syncer
branch: elpa/buttercup
commit 2aa840cb0e99251d299507859e98eb7341758fc9
Merge: e1f71ac 673f84d
Author: Jorgen Schäfer 
Commit: Jorgen Schäfer 

Merge pull request #40 from lunaryorn/assume-form

Add assume form to cancel tests if conditions fail
---
 buttercup.el| 14 ++
 tests/test-buttercup.el | 25 +
 2 files changed, 39 insertions(+)

diff --git a/buttercup.el b/buttercup.el
index a2eb57e..7a60143 100644
--- a/buttercup.el
+++ b/buttercup.el
@@ -104,6 +104,20 @@ This is the mechanism underlying `expect'. You can use it
 directly if you want to write your own testing functionality."
   (signal 'buttercup-failed (apply #'format format args)))
 
+(defun buttercup-skip (format &rest args)
+  "Skip the current test with the given description."
+  (signal 'buttercup-pending (apply #'format format args)))
+
+(defmacro assume (condition &optional message)
+  "Assume CONDITIION for the current test.
+
+Assume that CONDITION evaluates to non-nil in the current test.
+If it evaluates to nil cancel the current test with MESSAGE.  If
+MESSAGE is omitted or nil show the condition form instead."
+  (let ((message (or message (format "%S => nil" condition
+`(unless ,condition
+   (buttercup-skip "!! CANCELLED !! %s" ,message
+
 (defmacro buttercup-define-matcher (matcher args &rest body)
   "Define a matcher to be used in `expect'.
 
diff --git a/tests/test-buttercup.el b/tests/test-buttercup.el
index ec8d037..eb8ca14 100644
--- a/tests/test-buttercup.el
+++ b/tests/test-buttercup.el
@@ -103,6 +103,31 @@
 :to-throw
 'buttercup-failed "Explanation")))
 
+(describe "The `assume' form"
+  (it "should raise a signal if the condition is nil"
+(expect (lambda ()
+  (assume nil "Explanation"))
+:to-throw
+'buttercup-pending "!! CANCELLED !! Explanation"))
+
+  (it "should show the format if no message is given"
+(expect (lambda ()
+  (assume (< 1 0)))
+:to-throw
+'buttercup-pending "!! CANCELLED !! (< 1 0) => nil"))
+
+  (it "should not raise a signal if the condition is non-nil"
+(expect (lambda ()
+  (assume 'non-nil "Explanation"))
+:not :to-throw)))
+
+(describe "The `buttercup-skip function"
+  (it "should raise a signal with its arguments"
+(expect (lambda ()
+  (buttercup-skip "Explanation" ))
+:to-throw
+'buttercup-pending "Explanation")))
+
 (buttercup-define-matcher :test-matcher (a b)
   (+ a b))
 



[nongnu] elpa/buttercup b120003 108/340: Merge pull request #60 from howdoicomputer/feature/windows-bin-support

2021-12-16 Thread ELPA Syncer
branch: elpa/buttercup
commit b1200036bb9eb5a3d6a104ce4391960a0ff6b9b4
Merge: ba8cd05 cc52444
Author: Jorgen Schäfer 
Commit: Jorgen Schäfer 

Merge pull request #60 from howdoicomputer/feature/windows-bin-support

feature/windows-bin-support: Added a batch script that execs the buttercup 
script
---
 bin/buttercup.bat | 1 +
 1 file changed, 1 insertion(+)

diff --git a/bin/buttercup.bat b/bin/buttercup.bat
new file mode 100644
index 000..b1a0da1
--- /dev/null
+++ b/bin/buttercup.bat
@@ -0,0 +1 @@
+@bash %~dp0buttercup



[nongnu] elpa/buttercup 357e73b 085/340: Remove debug message

2021-12-16 Thread ELPA Syncer
branch: elpa/buttercup
commit 357e73b79ceaf00f134f41089ecf882daf93f4b7
Author: Jorgen Schaefer 
Commit: Jorgen Schaefer 

Remove debug message
---
 buttercup.el | 1 -
 1 file changed, 1 deletion(-)

diff --git a/buttercup.el b/buttercup.el
index 71d60dc..efbcc9a 100644
--- a/buttercup.el
+++ b/buttercup.el
@@ -634,7 +634,6 @@ current directory."
   (let ((dirs nil)
 (patterns nil)
 (args command-line-args-left))
-(message "c-l-a-l: %S" args)
 (while args
   (cond
((member (car args) '("-p" "--pattern"))



[nongnu] elpa/buttercup c7df9f6 069/340: Add 24.5.

2021-12-16 Thread ELPA Syncer
branch: elpa/buttercup
commit c7df9f6f5dd046a94ac386cfa1d06285e02cf9cd
Author: Jorgen Schaefer 
Commit: Jorgen Schaefer 

Add 24.5.
---
 .travis.yml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.travis.yml b/.travis.yml
index 228c8b2..f265342 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -4,6 +4,7 @@ env:
   - EVM_EMACS=emacs-24.2-bin
   - EVM_EMACS=emacs-24.3-bin
   - EVM_EMACS=emacs-24.4-bin
+  - EVM_EMACS=emacs-24.5-bin
 #  - EVM_EMACS=emacs-git-snapshot
 before_install:
   - sudo mkdir /usr/local/evm



[nongnu] elpa/buttercup 512b82b 077/340: Rework documentation to make the readme more concise.

2021-12-16 Thread ELPA Syncer
branch: elpa/buttercup
commit 512b82b22ff3fe98baff23d93ef8733850558864
Author: Jorgen Schaefer 
Commit: Jorgen Schaefer 

Rework documentation to make the readme more concise.

Fixes #12 by adding an "why not ERT?" section.
---
 Makefile  |   2 +-
 README.md | 684 --
 docs/images/buttercup.jpg | Bin 0 -> 21461 bytes
 README.md => docs/introduction.md |  97 +-
 docs/testrunners.md   |  15 +
 docs/usage.md | 129 +++
 6 files changed, 221 insertions(+), 706 deletions(-)

diff --git a/Makefile b/Makefile
index 2192f61..8c82578 100644
--- a/Makefile
+++ b/Makefile
@@ -8,7 +8,7 @@ DISTFILES = buttercup.el buttercup-compat.el buttercup-pkg.el 
README.md
 all: test
 
 test:
-   $(EMACS) -batch -L . -l buttercup.el -f buttercup-run-markdown README.md
+   $(EMACS) -batch -L . -l buttercup.el -f buttercup-run-markdown 
docs/introduction.md
./bin/buttercup -L .
 
 compile:
diff --git a/README.md b/README.md
index 5eaa3b8..7c5a662 100644
--- a/README.md
+++ b/README.md
@@ -3,31 +3,22 @@
 [![Build 
Status](https://api.travis-ci.org/jorgenschaefer/emacs-buttercup.png?branch=master)](https://travis-ci.org/jorgenschaefer/emacs-buttercup)
 [![MELPA 
Stable](http://stable.melpa.org/packages/buttercup-badge.svg)](http://stable.melpa.org/#/buttercup)
 
+![Build Status](docs/images/buttercup.jpg)
+
 Buttercup is a behavior-driven development framework for testing Emacs
-Lisp code. It is heavily inspired by
-[Jasmine](https://jasmine.github.io/). So heavily inspired, in fact,
-that half this page is more or less a verbatim copy of the
-[Jasmine introduction](https://jasmine.github.io/edge/introduction.html).
+Lisp code. It allows to group related tests so they can share common
+set-up and tear-down code, and allows the programmer to “spy” on
+functions to ensure they are called with the right arguments during
+testing.
 
-All code in this file can be run by Buttercup’s built-in markdown test
-runner. Just use `make test` in the project directory to see the
-output.
+The framework is heavily inspired by
+[Jasmine](https://jasmine.github.io/edge/introduction.html).
 
-## Getting Started
+## Example
 
-You can install buttercup from
-[MELPA Stable](http://stable.melpa.org/). Add the following to your
-`init.el` or `.emacs` file:
+*Full article: [Introduction](docs/introduction.md)*
 
-```
-(require 'package)
-(add-to-list 'package-archives
- '("melpa-stable" . "http://stable.melpa.org/packages/";) t)
-```
-
-This should allow you to `M-x package-install RET buttercup RET`.
-Afterwards, in an otherwise empty directory, create a file called
-`some-test.el` with the following contents:
+A simple test looks like this.
 
 ```Lisp
 (describe "A suite"
@@ -35,55 +26,23 @@ Afterwards, in an otherwise empty directory, create a file 
called
 (expect t :to-be t)))
 ```
 
-You can now use buttercup to run this test:
-
-```
-$ emacs -batch -f package-initialize -l buttercup -f buttercup-run-discover
-A suite
-  contains a spec with an expectation
-```
-
-Congratulations, you just ran your first tests!
-
-## Full Project Example
-
-Tests should be run in an environment separate from your interactive
-Emacs. To get such an environment and install packages into it, you
-can use [Cask](https://github.com/cask/cask). For installation
-instructions see there.
-
-In the directory from above, create a new file called `Cask` with the
-following contents:
-
-```
-(source gnu)
-(source melpa-stable)
-
-(development
- (depends-on "buttercup"))
-```
+## Installation and Usage
 
-Now you can tell cask to download and install the depended-on packages
-in the environment of the current directory:
+*Full article: [Usage](docs/usage.md)*
 
-```
-$ cask install
-```
-
-You only need to do this once. Subsequently, you can run buttercup
-tests simply by invoking buttercup using cask:
+You can install buttercup from
+[MELPA Stable](http://stable.melpa.org/). Add the following to your
+`init.el` or `.emacs` file:
 
 ```
-$ cask exec buttercup
-A suite
-  contains a spec with an expectation
+(require 'package)
+(add-to-list 'package-archives
+ '("melpa-stable" . "http://stable.melpa.org/packages/";) t)
 ```
 
-## Suites: `describe` Your Tests
+This should allow you to `M-x package-install RET buttercup RET`.
 
-A test suite begins with a call to the Buttercup macro `describe` with
-the first parameter describing the suite and the rest being the body
-of code that implements the suite.
+Now create a file called `test-feature.el` with these contents:
 
 ```Lisp
 (describe "A suite"
@@ -91,560 +50,55 @@ of code that implements the suite.
 (expect t :to-be t)))
 ```
 
-## Specs
-
-Specs are defined by calling the Buttercup macro `it`, which, like
-`describe` takes a string and code. The string is the title of the
-spec and the code is the spec, or test. A spec contains one or more
-e

[nongnu] elpa/buttercup 8c486e6 067/340: Move print settings to the batch reporter where they belong.

2021-12-16 Thread ELPA Syncer
branch: elpa/buttercup
commit 8c486e68f001ea066cf70b38e182f9c9deaf653b
Author: Jorgen Schaefer 
Commit: Jorgen Schaefer 

Move print settings to the batch reporter where they belong.
---
 buttercup.el | 139 ++-
 1 file changed, 70 insertions(+), 69 deletions(-)

diff --git a/buttercup.el b/buttercup.el
index 4bfc769..402c886 100644
--- a/buttercup.el
+++ b/buttercup.el
@@ -632,8 +632,7 @@ current directory."
 
 (defun buttercup-run ()
   (if buttercup-suites
-  (let ((print-escape-newlines t)
-(print-escape-nonascii t))
+  (progn
 (funcall buttercup-reporter 'buttercup-started buttercup-suites)
 (mapc #'buttercup--run-suite buttercup-suites)
 (funcall buttercup-reporter 'buttercup-done buttercup-suites))
@@ -727,74 +726,76 @@ Calls either `buttercup-reporter-batch' or
   "List of failed specs of the current batch report.")
 
 (defun buttercup-reporter-batch (event arg)
-  (pcase event
-(`buttercup-started
- (setq buttercup-reporter-batch--start-time (float-time))
- (buttercup--print "Running %s specs.\n\n"
-   (buttercup-suites-total-specs-defined arg)))
-
-(`suite-started
- (let ((level (length (buttercup-suite-parents arg
-   (buttercup--print "%s%s\n"
- (make-string (* 2 level) ?\s)
- (buttercup-suite-description arg
-
-(`spec-started
- (let ((level (length (buttercup-spec-parents arg
-   (buttercup--print "%s%s"
- (make-string (* 2 level) ?\s)
- (buttercup-spec-description arg
-
-(`spec-done
- (cond
-  ((eq (buttercup-spec-status arg) 'passed)
-   (buttercup--print "\n"))
-  ((eq (buttercup-spec-status arg) 'failed)
-   (buttercup--print "  FAILED\n")
-   (setq buttercup-reporter-batch--failures
- (append buttercup-reporter-batch--failures
- (list arg
-  (t
-   (error "Unknown spec status %s" (buttercup-spec-status arg)
-
-(`suite-done
- (when (= 0 (length (buttercup-suite-parents arg)))
-   (buttercup--print "\n")))
-
-(`buttercup-done
- (dolist (failed buttercup-reporter-batch--failures)
-   (let ((description (buttercup-spec-failure-description failed))
- (stack (buttercup-spec-failure-stack failed)))
- (buttercup--print "%s\n" (make-string 40 ?=))
- (buttercup--print "%s\n" (buttercup-spec-full-name failed))
- (when stack
-   (buttercup--print "\nTraceback (most recent call last):\n")
-   (dolist (frame stack)
- (let ((line (format "  %S" (cdr frame
-   (when (> (length line) 79)
- (setq line (concat (substring line 0 76)
-"...")))
-   (buttercup--print "%s\n" line
- (cond
-  ((stringp description)
-   (buttercup--print "FAILED: %s\n" description))
-  ((eq (car description) 'error)
-   (buttercup--print "%S: %S\n\n"
- (car description)
- (cadr description)))
-  (t
-   (buttercup--print "FAILED: %S\n" description)))
+  (let ((print-escape-newlines t)
+(print-escape-nonascii t))
+(pcase event
+  (`buttercup-started
+   (setq buttercup-reporter-batch--start-time (float-time))
+   (buttercup--print "Running %s specs.\n\n"
+ (buttercup-suites-total-specs-defined arg)))
+
+  (`suite-started
+   (let ((level (length (buttercup-suite-parents arg
+ (buttercup--print "%s%s\n"
+   (make-string (* 2 level) ?\s)
+   (buttercup-suite-description arg
+
+  (`spec-started
+   (let ((level (length (buttercup-spec-parents arg
+ (buttercup--print "%s%s"
+   (make-string (* 2 level) ?\s)
+   (buttercup-spec-description arg
+
+  (`spec-done
+   (cond
+((eq (buttercup-spec-status arg) 'passed)
+ (buttercup--print "\n"))
+((eq (buttercup-spec-status arg) 'failed)
+ (buttercup--print "  FAILED\n")
+ (setq buttercup-reporter-batch--failures
+   (append buttercup-reporter-batch--failures
+   (list arg
+(t
+ (error "Unknown spec status %s" (buttercup-spec-status arg)
+
+  (`suite-done
+   (when (= 0 (length (buttercup-suite-parents arg)))
  (buttercup--print "\n")))
- (buttercup--print "Ran %s specs, %s failed, in %.1f seconds.\n"
-   (buttercup-suites-total-specs-defined arg)
-   (buttercup-suites-total-specs-failed arg)
-   (- (float-time)
-  buttercup-reporter-batch--start-time))
- (when (> (buttercup-suite

[nongnu] elpa/buttercup f593486 092/340: Use pattern _ not t in pcase, as t is deprecated

2021-12-16 Thread ELPA Syncer
branch: elpa/buttercup
commit f5934866b99bd335b312b02f52a45a172e1e8053
Author: Jorgen Schaefer 
Commit: Jorgen Schaefer 

Use pattern _ not t in pcase, as t is deprecated

Fixes #26
---
 buttercup.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/buttercup.el b/buttercup.el
index 2b80947..2f40704 100644
--- a/buttercup.el
+++ b/buttercup.el
@@ -847,7 +847,7 @@ Calls either `buttercup-reporter-batch' or
(list arg
 ((eq (buttercup-spec-status arg) 'pending)
  (buttercup--print "  %s\n" (buttercup-spec-failure-description arg)))
-(t
+(_
  (error "Unknown spec status %s" (buttercup-spec-status arg)
 
   (`suite-done
@@ -886,7 +886,7 @@ Calls either `buttercup-reporter-batch' or
(when (> (buttercup-suites-total-specs-failed arg) 0)
  (error "")))
 
-  (t
+  (_
(error "Unknown event %s" event)
 
 (defun buttercup--print (fmt &rest args)



[nongnu] elpa/buttercup 3ef90b4 100/340: :to-match: Don't switch t/nil!

2021-12-16 Thread ELPA Syncer
branch: elpa/buttercup
commit 3ef90b4e818a49ffbeecc313a8711fbacce954dc
Author: Jorgen Schaefer 
Commit: Jorgen Schaefer 

:to-match: Don't switch t/nil!
---
 buttercup.el | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/buttercup.el b/buttercup.el
index 4dbcc31..bf79357 100644
--- a/buttercup.el
+++ b/buttercup.el
@@ -163,10 +163,10 @@ MATCHER is either a matcher defined with
 
 (buttercup-define-matcher :to-match (text regexp)
   (if (string-match regexp text)
-  (cons nil (format "Expected %S not to match the regexp %S"
-text regexp))
-(cons t (format "Expected %S to match the regexp %S"
-text regexp
+  (cons t (format "Expected %S not to match the regexp %S"
+  text regexp))
+(cons nil (format "Expected %S to match the regexp %S"
+  text regexp
 
 (buttercup-define-matcher :to-be-truthy (arg)
   (if arg



[nongnu] elpa/buttercup ab2a558 111/340: Add projectile integration info to Readme

2021-12-16 Thread ELPA Syncer
branch: elpa/buttercup
commit ab2a558bf5a591631173f0c5735f5d313550a0b6
Author: Erik Anderson 
Commit: GitHub 

Add projectile integration info to Readme

Example integration for projectile using dir-locals.
---
 docs/running-tests.md | 14 ++
 1 file changed, 14 insertions(+)

diff --git a/docs/running-tests.md b/docs/running-tests.md
index ab8ed3a..bb77b9f 100644
--- a/docs/running-tests.md
+++ b/docs/running-tests.md
@@ -102,6 +102,20 @@ different pattern using the `--pattern` command line 
argument to the
 You can run this command whichever way you like. Common choices
 include a makefile or shell scripts.
 
+## Projectile
+
+If you use [Projectile](https://github.com/bbatsov/projectile) for interacting 
with your projects you can set the "default" project test command to be 
available when you invoke `projectile-test-project`.  Create a `.dir-locals.el` 
file in the the root of your project tree (next to your Cask file).  An example:
+
+**.dir-locals.el**
+
+```
+((nil . ((eval . (progn
+   (require 'projectile)
+   (puthash (projectile-project-root)
+"cask exec buttercup -L ."
+projectile-test-cmd-map))
+```
+
 ## Travis
 
 If your project is hosted on github, you can use



[nongnu] elpa/buttercup 444716b 079/340: Handle windows better in interactive runs.

2021-12-16 Thread ELPA Syncer
branch: elpa/buttercup
commit 444716bad7454351663cc7ddeb5094332cfc620a
Author: Jorgen Schaefer 
Commit: Jorgen Schaefer 

Handle windows better in interactive runs.

When running tests interactively, Buttercup now does not change the
input focus to the *Buttercup* buffer when there was an error. Also,
Buttercup now scrolls the test results to the end, as most of
the interesting this are shown at the end.

Fixes #14
---
 buttercup.el| 11 ---
 tests/test-buttercup.el |  6 +++---
 2 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/buttercup.el b/buttercup.el
index f9f0a44..fc990a4 100644
--- a/buttercup.el
+++ b/buttercup.el
@@ -620,8 +620,9 @@ KEYWORD can have one of the following values:
   (interactive)
   (let ((buttercup-suites nil)
 (lexical-binding t))
-(eval-defun nil)
-(buttercup-run)
+(save-selected-window
+  (eval-defun nil)
+  (buttercup-run))
 (message "Suite executed successfully")))
 
 ;;;###autoload
@@ -865,7 +866,11 @@ Calls either `buttercup-reporter-batch' or
 (insert (apply 'format fmt args))
   (unwind-protect
   (buttercup-reporter-batch event arg)
-(fset 'buttercup--print old-print)
+(fset 'buttercup--print old-print)))
+(let ((w (get-buffer-window (current-buffer
+  (when w
+(with-selected-window w
+  (goto-char (point-max)))
 
 ;
 ;;; Utilities
diff --git a/tests/test-buttercup.el b/tests/test-buttercup.el
index 5df1952..7d90b08 100644
--- a/tests/test-buttercup.el
+++ b/tests/test-buttercup.el
@@ -103,10 +103,10 @@
 :to-throw
 'buttercup-failed "Explanation")))
 
-(describe "The `buttercup-define-matcher' macro"
-  (buttercup-define-matcher :test-matcher (a b)
-(+ a b))
+(buttercup-define-matcher :test-matcher (a b)
+  (+ a b))
 
+(describe "The `buttercup-define-matcher' macro"
   (it "should create a matcher usable by apply-matcher"
 (expect (buttercup--apply-matcher :test-matcher '(1 2))
 :to-equal



[nongnu] elpa/buttercup 25cb350 089/340: Rename docs to be more easily understandable

2021-12-16 Thread ELPA Syncer
branch: elpa/buttercup
commit 25cb3500c45cbc898952c961883da7f1ba01c85d
Author: Jorgen Schaefer 
Commit: Jorgen Schaefer 

Rename docs to be more easily understandable

See comments on #40
---
 README.md  |  4 ++--
 docs/{usage.md => running-tests.md}|  4 ++--
 docs/testrunners.md| 15 ---
 docs/{introduction.md => writing-tests.md} |  0
 4 files changed, 4 insertions(+), 19 deletions(-)

diff --git a/README.md b/README.md
index 7c5a662..36b7b53 100644
--- a/README.md
+++ b/README.md
@@ -16,7 +16,7 @@ The framework is heavily inspired by
 
 ## Example
 
-*Full article: [Introduction](docs/introduction.md)*
+*Full article: [Writing Tests](docs/writing-tests.md)*
 
 A simple test looks like this.
 
@@ -28,7 +28,7 @@ A simple test looks like this.
 
 ## Installation and Usage
 
-*Full article: [Usage](docs/usage.md)*
+*Full article: [Running Tests](docs/running-tests.md)*
 
 You can install buttercup from
 [MELPA Stable](http://stable.melpa.org/). Add the following to your
diff --git a/docs/usage.md b/docs/running-tests.md
similarity index 96%
rename from docs/usage.md
rename to docs/running-tests.md
index e6be162..2cbc2e3 100644
--- a/docs/usage.md
+++ b/docs/running-tests.md
@@ -3,8 +3,8 @@
 Buttercup is primarily meant to be used non-interactively, to
 automatically test a project independent of a user’s setup, before a
 commit and on a continuous integration platform. Because of this, the
-workflow for buttercup does not use interactive commands but instead
-the command line.
+recommended workflow for buttercup does not use interactive commands
+but instead the command line.
 
 ## Cask
 
diff --git a/docs/testrunners.md b/docs/testrunners.md
deleted file mode 100644
index 34aae59..000
--- a/docs/testrunners.md
+++ /dev/null
@@ -1,15 +0,0 @@
-# Test Runners
-
-Evaluating `describe` forms just stores the suites. You need to use a
-test runner to actually evaluate them. Buttercup comes with three test
-runners by default:
-
-- `buttercup-run-at-point` — Evaluate the topmost `describe` form at
-  point and run the suite it creates directly. Useful for interactive
-  development. But be careful, this uses your current environment,
-  which might not be clean (due to said interactive development).
-- `buttercup-run-discover` — Find files in directories specified on
-  the command line, load them, and then run all suites defined
-  therein. Useful for being run in batch mode.
-- `buttercup-run-markdown` — Run code in markdown files. Used to
-  run this file’s code.
diff --git a/docs/introduction.md b/docs/writing-tests.md
similarity index 100%
rename from docs/introduction.md
rename to docs/writing-tests.md



[nongnu] elpa/buttercup 0f3eb63 078/340: Show actual function arguments when a spy fails.

2021-12-16 Thread ELPA Syncer
branch: elpa/buttercup
commit 0f3eb636c220ab4b822d309d7a0f6817e0fb9229
Author: Jorgen Schaefer 
Commit: Jorgen Schaefer 

Show actual function arguments when a spy fails.

It's not very helpful to be told that a spy was not called with the
expected arguments without being told what it actually was being
called with.

Fixes #19
---
 buttercup.el| 18 +++---
 tests/test-buttercup.el | 10 ++
 2 files changed, 21 insertions(+), 7 deletions(-)

diff --git a/buttercup.el b/buttercup.el
index 9a67d2d..f9f0a44 100644
--- a/buttercup.el
+++ b/buttercup.el
@@ -565,9 +565,21 @@ KEYWORD can have one of the following values:
 
 (buttercup-define-matcher :to-have-been-called-with (spy &rest args)
   (let* ((calls (mapcar 'spy-context-args (spy-calls-all spy
-(if (member args calls)
-t
-  nil)))
+(cond
+ ((not calls)
+  (cons nil
+(format "Expected `%s' to have been called with %s, but it was not 
called at all" spy args)))
+ ((not (member args calls))
+  (cons nil
+(format "Expected `%s' to have been called with %s, but it was 
called with %s"
+spy
+args
+(mapconcat (lambda (args)
+ (format "%S" args))
+   calls
+   ", "
+ (t
+  t
 
 (defun spy-calls-any (spy)
   "Return t iff SPY has been called at all, nil otherwise."
diff --git a/tests/test-buttercup.el b/tests/test-buttercup.el
index 8cc48d8..5df1952 100644
--- a/tests/test-buttercup.el
+++ b/tests/test-buttercup.el
@@ -499,15 +499,17 @@
   (it "returns false if the spy was not called at all"
 (expect (buttercup--apply-matcher
  :to-have-been-called-with '(test-function 1 2 3))
-:to-be
-nil))
+:to-equal
+(cons nil
+  "Expected `test-function' to have been called with (1 2 
3), but it was not called at all")))
 
   (it "returns false if the spy was called with different arguments"
 (test-function 3 2 1)
 (expect (buttercup--apply-matcher
  :to-have-been-called-with '(test-function 1 2 3))
-:to-be
-nil))
+:to-equal
+(cons nil
+  "Expected `test-function' to have been called with (1 2 
3), but it was called with (3 2 1)")))
 
   (it "returns true if the spy was called with those arguments"
 (test-function 1 2 3)



[nongnu] elpa/buttercup 54696b0 124/340: Merge pull request #78 from Fuco1/feature/buttercup-minor-mode

2021-12-16 Thread ELPA Syncer
branch: elpa/buttercup
commit 54696b033195b804654e496e1567f54b7232ca55
Merge: 11f072f 2b5f53d
Author: Jorgen Schäfer 
Commit: GitHub 

Merge pull request #78 from Fuco1/feature/buttercup-minor-mode

[Fix #72] Add buttercup-minor-mode
---
 buttercup.el| 24 
 tests/test-buttercup.el | 43 +++
 2 files changed, 67 insertions(+)

diff --git a/buttercup.el b/buttercup.el
index 84414b5..5c6c55a 100644
--- a/buttercup.el
+++ b/buttercup.el
@@ -1110,5 +1110,29 @@ failed -- The second value is the description of the 
expectation
 frame (backtrace-frame n)))
 frame-list))
 
+;;;###autoload
+(define-minor-mode buttercup-minor-mode
+  "Activate buttercup minor mode.
+
+With buttercup minor mode active the following is activated:
+
+- `describe' and `it' forms are fontified with
+  `font-lock-keyword-face'.
+- `describe' and `it' forms are available from `imenu' for
+  quicker access."
+  :lighter " ❀"
+  (let ((font-lock-form '(("(\\(describe\\|buttercup-define-matcher\\|it\\) "
+   1 'font-lock-keyword-face)))
+(imenu-forms '(("Test Suites" "\\((describe\\_> 
+\\)\"\\(\\_<.+\\_>\\)\"" 2)
+   ("Spec" "\\((it\\_> +\\)\"\\(\\_<.+\\_>\\)\"" 2
+(if buttercup-minor-mode
+(progn
+  (font-lock-add-keywords nil font-lock-form)
+  (cl-dolist (form imenu-forms)
+(add-to-list 'imenu-generic-expression form)))
+  (font-lock-remove-keywords nil font-lock-form)
+  (cl-dolist (form imenu-forms)
+(setq imenu-generic-expression (delete form 
imenu-generic-expression))
+
 (provide 'buttercup)
 ;;; buttercup.el ends here
diff --git a/tests/test-buttercup.el b/tests/test-buttercup.el
index fee0b09..b03109f 100644
--- a/tests/test-buttercup.el
+++ b/tests/test-buttercup.el
@@ -730,3 +730,46 @@
 (error "Expected erroring buttercup--funcall not to return %S"
res)))
 
+;
+;;; Buttercup-minor-mode
+
+(describe "butter-minor-mode"
+
+  (it "should fontify `describe' special form"
+(with-temp-buffer
+  (emacs-lisp-mode)
+  (buttercup-minor-mode 1)
+  (font-lock-mode)
+  (insert "(describe \"A test suite\" (it \"should fontify special 
keywords\"))")
+  (font-lock-fontify-region (point-min) (point-max))
+  (expect
+   (text-property-any (point-min) (point-max) 'face 
'font-lock-keyword-face)
+   :to-equal 2)))
+
+  (it "should fontify `it' special form"
+(with-temp-buffer
+  (emacs-lisp-mode)
+  (buttercup-minor-mode 1)
+  (font-lock-mode)
+  (insert "(describe \"A test suite\" (it \"should fontify special 
keywords\"))")
+  (font-lock-fontify-region (point-min) (point-max))
+  (expect
+   (text-property-any 15 (point-max) 'face 'font-lock-keyword-face)
+   :to-equal 27)))
+
+  (it "should add special forms to `imenu'"
+(with-temp-buffer
+  (require 'imenu)
+  (emacs-lisp-mode)
+  (buttercup-minor-mode 1)
+  (insert "(describe \"A test suite\"
+  (it \"should fontify special keywords\"))")
+  (imenu--make-index-alist)
+  (let ((suites (assoc "Test Suites" imenu--index-alist))
+(specs (assoc "Spec" imenu--index-alist)))
+(expect suites :to-be-truthy)
+(expect (length (cdr suites)) :to-equal 1)
+(expect (caadr suites) :to-equal "A test suite")
+(expect specs :to-be-truthy)
+(expect (length (cdr specs)) :to-equal 1)
+(expect (caadr specs) :to-equal "should fontify special keywords")



[nongnu] elpa/buttercup 23472e9 099/340: :to-match: Show correct error messages

2021-12-16 Thread ELPA Syncer
branch: elpa/buttercup
commit 23472e901c79c8a2bc336e9f5328d352ac5664ff
Author: Jorgen Schaefer 
Commit: Jorgen Schaefer 

:to-match: Show correct error messages

They were switched around.

Fixes #51
---
 buttercup.el | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/buttercup.el b/buttercup.el
index c8b4400..4dbcc31 100644
--- a/buttercup.el
+++ b/buttercup.el
@@ -163,10 +163,10 @@ MATCHER is either a matcher defined with
 
 (buttercup-define-matcher :to-match (text regexp)
   (if (string-match regexp text)
-  (cons t (format "Expected %S to match the regexp %S"
-  text regexp))
-(cons nil (format "Expected %S not to match the regexp %S"
-  text regexp
+  (cons nil (format "Expected %S not to match the regexp %S"
+text regexp))
+(cons t (format "Expected %S to match the regexp %S"
+text regexp
 
 (buttercup-define-matcher :to-be-truthy (arg)
   (if arg



[nongnu] elpa/buttercup ea8effb 095/340: Add the :var argument to describe

2021-12-16 Thread ELPA Syncer
branch: elpa/buttercup
commit ea8effba4a04878aaa2d955546889ce858abc773
Author: Jorgen Schaefer 
Commit: Jorgen Schaefer 

Add the :var argument to describe

The new argument allows declaring variables that are visible
thorough the whole describe form. This covers a common idiom
where all it forms were enclosed in a let form.

Fixes #5
---
 buttercup.el|   6 +-
 docs/writing-tests.md   | 424 
 tests/test-buttercup.el |   8 +-
 3 files changed, 225 insertions(+), 213 deletions(-)

diff --git a/buttercup.el b/buttercup.el
index 6a77ccb..7e5a521 100644
--- a/buttercup.el
+++ b/buttercup.el
@@ -347,7 +347,11 @@ form.")
 (defmacro describe (description &rest body)
   "Describe a suite of tests."
   (declare (indent 1) (debug (&define sexp def-body)))
-  `(buttercup-describe ,description (lambda () ,@body)))
+  (let ((new-body (if (eq (elt body 0) :var)
+  `((let ,(elt body 1)
+  ,@(cddr body)))
+body)))
+`(buttercup-describe ,description (lambda () ,@new-body
 
 (defun buttercup-describe (description body-function)
   "Function to handle a `describe' form."
diff --git a/docs/writing-tests.md b/docs/writing-tests.md
index 6e2938d..07b0dc4 100644
--- a/docs/writing-tests.md
+++ b/docs/writing-tests.md
@@ -44,10 +44,10 @@ make sure to define your spec file to be lexically scoped.
 
 ```Lisp
 (describe "A suite is just a function"
-  (let ((a nil))
-(it "and so is a spec"
-  (setq a t)
-  (expect a :to-be t
+  :var (a)
+  (it "and so is a spec"
+(setq a t)
+(expect a :to-be t)))
 ```
 
 ## Expectations
@@ -198,19 +198,21 @@ The `after-each` block resets the variable before 
continuing.
 
 ```Lisp
 (describe "A spec using `before-each' and `after-each'"
-  (let ((foo 0))
-(before-each
- (setq foo (1+ foo)))
-
-(after-each
+  :var (foo)
+  (before-each
+   (when (not foo)
  (setq foo 0))
+   (setq foo (1+ foo)))
 
-(it "is just a function, so it can contain any code"
-  (expect foo :to-equal 1))
+  (after-each
+   (setq foo 0))
 
-(it "can have more than one expectation"
-  (expect foo :to-equal 1)
-  (expect t :to-equal t
+  (it "is just a function, so it can contain any code"
+(expect foo :to-equal 1))
+
+  (it "can have more than one expectation"
+(expect foo :to-equal 1)
+(expect t :to-equal t)))
 ```
 
 The `before-all` form is called only once before all the specs in
@@ -224,19 +226,19 @@ your specs so that they erroneously pass or fail.
 
 ```Lisp
 (describe "A spec using `before-all' and `after-all'"
-  (let (foo)
-(before-all
- (setq foo 1))
+  :var (foo)
+  (before-all
+   (setq foo 1))
 
-(after-all
- (setq foo 0))
+  (after-all
+   (setq foo 0))
 
-(it "sets the initial value of foo before specs run"
-  (expect foo :to-equal 1)
-  (setq foo (1+ foo)))
+  (it "sets the initial value of foo before specs run"
+(expect foo :to-equal 1)
+(setq foo (1+ foo)))
 
-(it "does not reset foo between specs"
-  (expect foo :to-equal 2
+  (it "does not reset foo between specs"
+(expect foo :to-equal 2)))
 ```
 
 ### Nesting `describe` Blocks
@@ -249,28 +251,28 @@ walks through the `after-each` functions similarly.
 
 ```Lisp
 (describe "A spec"
-  (let (foo)
-(before-each
- (setq foo 0)
- (setq foo (1+ foo)))
+  :var (foo)
+  (before-each
+   (setq foo 0)
+   (setq foo (1+ foo)))
 
-(after-each
- (setq foo 0))
+  (after-each
+   (setq foo 0))
 
-(it "is just a function, so it can contain any code"
-  (expect foo :to-equal 1))
+  (it "is just a function, so it can contain any code"
+(expect foo :to-equal 1))
 
-(it "can have more than one expectation"
-  (expect foo :to-equal 1)
-  (expect t :to-equal t))
+  (it "can have more than one expectation"
+(expect foo :to-equal 1)
+(expect t :to-equal t))
 
-(describe "nested inside a second describe"
-  (let (bar)
-(before-each
- (setq bar 1))
+  (describe "nested inside a second describe"
+(let (bar)
+  (before-each
+   (setq bar 1))
 
-(it "can reference both scopes as needed"
-  (expect foo :to-equal bar))
+  (it "can reference both scopes as needed"
+(expect foo :to-equal bar)
 ```
 
 ## Disabling Suites
@@ -282,13 +284,13 @@ results.
 
 ```Lisp
 (xdescribe "A spec"
-  (let (foo)
-(before-each
-  (setq foo 0)
-  (setq foo (1+ foo)))
+  :var (foo)
+  (before-each
+(setq foo 0)
+(setq foo (1+ foo)))
 
-(it "is just a function, so it can contain any code"
-  (expect foo :to-equal 1
+  (it "is just a function, so it can contain any code"
+(expect foo :to-equal 1)))
 ```
 
 ## Pending Specs
@@ -323,26 +325,26 @@ the argument list matches any of the recorded calls to 
the spy.
 
 ```Lisp
 (describe "A spy"
-  (let (foo bar)
-(before-eac

[nongnu] elpa/buttercup b6deeff 128/340: Set Emacs 24.3 as minimum and clean outdated code (close #89)

2021-12-16 Thread ELPA Syncer
branch: elpa/buttercup
commit b6deeffe032527696e32623b69bdf07b538a315e
Author: Damien Cassou 
Commit: Jorgen Schäfer 

Set Emacs 24.3 as minimum and clean outdated code (close #89)
---
 .travis.yml |  2 --
 buttercup-compat.el | 12 
 buttercup.el|  2 +-
 3 files changed, 1 insertion(+), 15 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index 6b0d4d8..17b0765 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,8 +1,6 @@
 language: emacs-lisp
 sudo: no
 env:
-  - EVM_EMACS=emacs-24.1-travis
-  - EVM_EMACS=emacs-24.2-travis
   - EVM_EMACS=emacs-24.3-travis
   - EVM_EMACS=emacs-24.4-travis
   - EVM_EMACS=emacs-24.5-travis
diff --git a/buttercup-compat.el b/buttercup-compat.el
index fa9725a..cd1776e 100644
--- a/buttercup-compat.el
+++ b/buttercup-compat.el
@@ -30,18 +30,6 @@
 ;;; Code:
 
 ;
-;; Introduced in 24.3
-
-(when (not (fboundp 'cl-defstruct))
-  (defalias 'cl-defstruct 'defstruct))
-
-(when (not (fboundp 'cl-every))
-  (defalias 'cl-every 'every))
-
-(when (not (fboundp 'cl-subsetp))
-  (defalias 'cl-subsetp 'subsetp))
-
-;
 ;; Introduced in 24.4
 
 (when (not (fboundp 'define-error))
diff --git a/buttercup.el b/buttercup.el
index 8b1eb46..4d5dc3c 100644
--- a/buttercup.el
+++ b/buttercup.el
@@ -39,7 +39,7 @@
 
 ;;; Code:
 
-(require 'cl)
+(require 'cl-lib)
 (require 'buttercup-compat)
 
 ;;



[nongnu] elpa/buttercup ba8cd05 106/340: Merge pull request #59 from immerrr/add-other-emacs-params

2021-12-16 Thread ELPA Syncer
branch: elpa/buttercup
commit ba8cd05313ee29dc097bf21031ccac191c392507
Merge: 06c9699 a6d9bde
Author: Jorgen Schäfer 
Commit: Jorgen Schäfer 

Merge pull request #59 from immerrr/add-other-emacs-params

bin/buttercup: support more emacs parameters useful for pre-test 
initialization
---
 bin/buttercup | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/buttercup b/bin/buttercup
index 71f6740..05929f1 100755
--- a/bin/buttercup
+++ b/bin/buttercup
@@ -13,7 +13,7 @@ BUTTERCUP_ARGS=()
 while [[ "$#" -gt 0 ]]
 do
 case "$1" in
-"-L")
+"-L"|"--directory"|"-f"|"--funcall"|"-l"|"--load"|"--eval"|"--execute")
 EMACS_ARGS+=("$1")
 EMACS_ARGS+=("$2")
 shift



[nongnu] elpa/buttercup 6d96ea3 093/340: Add format specifier to error call with argument

2021-12-16 Thread ELPA Syncer
branch: elpa/buttercup
commit 6d96ea3e923f05ea869bdd96f55072b06520e05e
Author: Jorgen Schaefer 
Commit: Jorgen Schaefer 

Add format specifier to error call with argument
---
 buttercup.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/buttercup.el b/buttercup.el
index 2f40704..6a77ccb 100644
--- a/buttercup.el
+++ b/buttercup.el
@@ -652,7 +652,7 @@ current directory."
   (cond
((member (car args) '("-p" "--pattern"))
 (when (not (cdr args))
-  (error "Option requires argument" (car args)))
+  (error "Option requires argument: %s" (car args)))
 (push (cadr args) patterns)
 (setq args (cddr args)))
(t



[nongnu] elpa/buttercup 07cf64b 140/340: Run test-buttercup.el before tests in writing-tests.md

2021-12-16 Thread ELPA Syncer
branch: elpa/buttercup
commit 07cf64bb0a811c33b537c95a840b5a0374713678
Author: Ryan C. Thompson 
Commit: Jorgen Schäfer 

Run test-buttercup.el before tests in writing-tests.md

Since make stops at the first failed command, and "test-buttercup.el"
contains more low-level tests that are usually more helpful when
debugging, it makes sense to run it first.
---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 1802b07..dddc6f4 100644
--- a/Makefile
+++ b/Makefile
@@ -8,8 +8,8 @@ DISTFILES := $(ELISP_FILES) buttercup-pkg.el README.md
 all: test
 
 test: compile
-   $(EMACS) -batch -L . -l buttercup.el -f buttercup-run-markdown 
docs/writing-tests.md
./bin/buttercup -L .
+   $(EMACS) -batch -L . -l buttercup.el -f buttercup-run-markdown 
docs/writing-tests.md
 
 compile: $(patsubst %.el,%.elc,$(ELISP_FILES))
 



  1   2   3   4   >