[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 12b7f82 092/177: Add Travis CI and update tests. Start a C
From: |
João Távora |
Subject: |
[elpa] master 12b7f82 092/177: Add Travis CI and update tests. Start a Changelog. |
Date: |
Sat, 28 Mar 2015 15:41:10 +0000 |
branch: master
commit 12b7f82dd8cdac4dc577b6a0b6a91b71b1e61142
Author: Joao Tavora <address@hidden>
Commit: Joao Tavora <address@hidden>
Add Travis CI and update tests. Start a Changelog.
* .travis.yml: new file
* README.mdown: Add Travis CI badge.
* Rakefile: use ert-run-tests-batch-and-exit.
* yasnippet-tests.el (example-for-issue-404-external-emacs): Use
`yas-with-snippet-dirs' to not depend on bundled snippets.
(yas--call-with-temporary-redefinitions): Use `cl-labels' since no
cl-flet in emacs-24.3's cl-lib.el.
(loading-with-cyclic-parenthood): prog-mode doesn't exist in emacs
24.3.
(yas-batch-run-tests): remove it.
* yasnippet.el (require): require cl-lib during byte-compilation
and load.
---
.travis.yml | 23 +++++++++++++++++++++++
ChangeLog | 18 ++++++++++++++++++
README.mdown | 2 ++
Rakefile | 5 ++---
yasnippet-tests.el | 47 +++++++++++++++++++++++------------------------
yasnippet.el | 2 ++
6 files changed, 70 insertions(+), 27 deletions(-)
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 0000000..83990f6
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,23 @@
+language: emacs
+before_install:
+ - echo -e "\ndeb http://us.archive.ubuntu.com/ubuntu raring universe
multiverse main" | sudo tee -a /etc/apt/sources.list
+ - echo -e "\ndeb http://emacs.naquadah.org/ stable/" | sudo tee -a
/etc/apt/sources.list
+ - echo -e "\ndeb-src http://emacs.naquadah.org/ stable/" | sudo tee -a
/etc/apt/sources.list
+ - cat /etc/apt/sources.list
+ - wget -q -O - http://emacs.naquadah.org/key.gpg | sudo apt-key add -
+ - sudo apt-get update
+install:
+ - sudo apt-get install emacs
+ - sudo apt-get -t raring install libgnutls26
+ - sudo apt-get install emacs-snapshot-nox
+ - curl -O
https://raw.github.com/ohler/ert/c619b56c5bc6a866e33787489545b87d79973205/lisp/emacs-lisp/ert.el
+ - curl -O
https://raw.github.com/ohler/ert/c619b56c5bc6a866e33787489545b87d79973205/lisp/emacs-lisp/ert-x.el
+ - curl -o cl-lib.el http://elpa.gnu.org/packages/cl-lib-0.3.el
+before_script:
+script:
+ - export EMACS=emacs; rm *.elc; rake compile; rake tests
+ - rm ert*.el; rm cl-lib.el
+ - export EMACS=emacs-snapshot; rm *.elc; rake compile; rake tests
+notifications:
+ email:
+ - address@hidden
diff --git a/ChangeLog b/ChangeLog
new file mode 100644
index 0000000..483f2ac
--- /dev/null
+++ b/ChangeLog
@@ -0,0 +1,18 @@
+2013-12-31 João Távora <address@hidden>
+
+ * yasnippet.el (require): require cl-lib during byte-compilation
+ and load.
+
+ * yasnippet-tests.el (example-for-issue-404-external-emacs): Use
+ `yas-with-snippet-dirs' to not depend on bundled snippets.
+ (yas--call-with-temporary-redefinitions): Use `cl-labels' since no
+ cl-flet in emacs-24.3's cl-lib.el.
+ (loading-with-cyclic-parenthood): prog-mode doesn't exist in emacs
+ 24.3.
+ (yas-batch-run-tests): remove it.
+
+ * Rakefile: use ert-run-tests-batch-and-exit.
+
+ * README.mdown: Add Travis CI badge.
+
+ * .travis.yml: new file
diff --git a/README.mdown b/README.mdown
index da61284..4a8d597 100644
--- a/README.mdown
+++ b/README.mdown
@@ -1,3 +1,5 @@
+[![Build
Status](https://travis-ci.org/capitaomorte/yasnippet.png)](https://travis-ci.org/capitaomorte/yasnippet)
+
# Intro
**YASnippet** is a template system for Emacs. It allows you to
diff --git a/Rakefile b/Rakefile
index efbea56..2965eb9 100644
--- a/Rakefile
+++ b/Rakefile
@@ -16,9 +16,8 @@ FileUtils.mkdir_p('pkg')
desc "run tests in batch mode"
task :tests do
- batch_run_line = "(yas-batch-run-tests t)"
- sh "#{$EMACS} -Q -L . -l yasnippet-tests.el -nw" +
- " --batch --eval '#{batch_run_line}'"
+ sh "#{$EMACS} -Q -L . -l yasnippet-tests.el" +
+ " --batch -f ert-run-tests-batch-and-exit"
end
desc "create a release package"
diff --git a/yasnippet-tests.el b/yasnippet-tests.el
index 4e2f1bc..d2f3c2c 100644
--- a/yasnippet-tests.el
+++ b/yasnippet-tests.el
@@ -229,20 +229,26 @@
(insert (pp-to-string
`(condition-case _
(progn
- (require 'yasnippet)
- (yas-global-mode)
- (switch-to-buffer "foo.c")
- (c-mode)
- (insert "#include <iostream>\nmain")
- (setq yas-good-grace nil)
- (yas-expand)
- (kill-emacs 0))
+ (require 'yasnippet-tests)
+ (yas-with-snippet-dirs
+ '((".emacs.d/snippets"
+ ("c-mode"
+ ("main" . "int main ()"))))
+ (yas-global-mode)
+ (switch-to-buffer "foo.c")
+ (c-mode)
+ (insert "#include <iostream>\nmain")
+ (setq yas-good-grace nil)
+ (yas-expand)
+ (should (string= (buffer-string)
+ "#include <iostream>\nint main ()"))
+ (kill-emacs 0)))
(error (kill-emacs -1)))))
(write-file fixture-el-file))
(should (= 0
(call-process (concat invocation-directory invocation-name)
nil nil nil
- "-Q" ;; "--batch"
+ "-Q" "--batch"
"-L" "." "-l" fixture-el-file)))))
(ert-deftest middle-of-buffer-snippet-insertion ()
@@ -325,10 +331,10 @@ TODO: correct this bug!"
;; saving all definitions before overriding anything ensures FDEFINITION
;; errors don't cause accidental permanent redefinitions.
;;
- (cl-flet ((set-fdefinitions (names functions)
- (loop for name in names
- for fn in functions
- do (fset name fn))))
+ (cl-labels ((set-fdefinitions (names functions)
+ (loop for name in names
+ for fn in functions
+ do (fset name fn))))
(set-fdefinitions definition-names overriding-functions)
(unwind-protect (funcall function)
(set-fdefinitions definition-names saved-functions)))))
@@ -409,12 +415,14 @@ TODO: correct this bug!"
(yas-reload-all)
(with-temp-buffer
(let* ((major-mode 'c-mode)
- (expected '(c-mode
+ (expected `(c-mode
cc-mode
yet-another-c-mode
and-also-this-one
and-that-one
- prog-mode
+ ;; prog-mode doesn't exit in emacs 24.3
+ ,@(if (fboundp 'prog-mode)
+ '(prog-mode))
emacs-lisp-mode
lisp-interaction-mode))
(observed (yas--modes-to-activate)))
@@ -627,15 +635,6 @@ add the snippets associated with the given mode."
;;; Helpers
;;;
-(defun yas-batch-run-tests (&optional also-external)
- (interactive)
- (with-temp-buffer
- (yas--with-temporary-redefinitions
- ((message (&rest _args) nil))
- (ert (or (and also-external t)
- '(not (tag :external))) (buffer-name (current-buffer)))
- (princ (buffer-string)))))
-
(defun yas-should-expand (keys-and-expansions)
(dolist (key-and-expansion keys-and-expansions)
(yas-exit-all-snippets)
diff --git a/yasnippet.el b/yasnippet.el
index 9348590..98ace6a 100644
--- a/yasnippet.el
+++ b/yasnippet.el
@@ -130,6 +130,8 @@
;;; Code:
(require 'cl)
+(eval-and-compile
+ (require 'cl-lib))
(require 'easymenu)
(require 'help-mode)
- [elpa] master 24d7a67 086/177: fix typo, (continued)
- [elpa] master 24d7a67 086/177: fix typo, João Távora, 2015/03/28
- [elpa] master 78c8b5e 090/177: yas--document-symbol: fix no transform case, João Távora, 2015/03/28
- [elpa] master e190b08 088/177: Rakefile: don't fail with EMACS=t env setting, João Távora, 2015/03/28
- [elpa] master df58222 089/177: yas--document-symbols: respect level arg, raise to 1, João Távora, 2015/03/28
- [elpa] master f94c38e 091/177: Merge pull request #449 from nibua-r/https-submodules, João Távora, 2015/03/28
- [elpa] master 3002043 093/177: Sync git submodule for yasmate repo, João Távora, 2015/03/28
- [elpa] master 0f8c2ab 094/177: Add `yas-after-reload-hook' and run it at the end of `yas-reload-all', João Távora, 2015/03/28
- [elpa] master 987942c 095/177: update snippets submodule, João Távora, 2015/03/28
- [elpa] master c128580 096/177: yasnippet templates don't add newlines, João Távora, 2015/03/28
- [elpa] master 83c174c 097/177: Merge pull request #464 from kidd/master, João Távora, 2015/03/28
- [elpa] master 12b7f82 092/177: Add Travis CI and update tests. Start a Changelog.,
João Távora <=
- [elpa] master 3744f92 098/177: avoid double choices reversing, João Távora, 2015/03/28
- [elpa] master 1fc858f 099/177: Remove experimental Changelog file, João Távora, 2015/03/28
- [elpa] master 4d220f7 100/177: Remove an obsolete hack notice, João Távora, 2015/03/28
- [elpa] master 4470110 101/177: display-fn isn't actually used for filtering, João Távora, 2015/03/28
- [elpa] master c07db05 102/177: yas-x-prompt: remove dead code, João Távora, 2015/03/28
- [elpa] master 43a501a 103/177: remove yas--x-pretty-prompt-templates, João Távora, 2015/03/28
- [elpa] master 8e7295b 108/177: Closes #403: more uniform behaviour for `yas-use-menu', João Távora, 2015/03/28
- [elpa] master 498cbe4 105/177: Closes #469: Don't use `yas--init-minor-keymap', João Távora, 2015/03/28
- [elpa] master e7599b9 104/177: Merge pull request #466 from npostavs/no-reverse, João Távora, 2015/03/28
- [elpa] master a4e04f9 109/177: update doc for org 8.x, João Távora, 2015/03/28