github
Advanced Search
  • Home
  • Pricing and Signup
  • Explore GitHub
  • Blog
  • Login

ieure / test-case-mode

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 3
    • 0
  • Source
  • Commits
  • Network (0)
  • Issues (0)
  • Downloads (0)
  • Wiki (1)
  • Graphs
  • Tree: cacba6a

click here to add a description

click here to add a homepage

  • Branches (1)
    • master
  • Tags (0)
Sending Request…
Enable Donations

Pledgie Donations

Once activated, we'll place the following badge in your repository's detail box:
Pledgie_example
This service is courtesy of Pledgie.

Emacs unit test front-end — Read more

  cancel

http://nschum.de/src/emacs/test-case-mode/

  cancel
  • Private
  • Read-Only
  • HTTP Read-Only

This URL has Read+Write access

Provide test-case-mode. 
ieure (author)
Sun Jun 07 01:24:49 -0700 2009
commit  cacba6a3d524c75baa6315fce5df87a8496d12dd
tree    aaa144578d9d67e9d39d6d0f4669b6da971e0a87
parent  c1548ff0af1ea018b8ea822647fcf1f242618ce9
test-case-mode / test-case-phpunit.el test-case-phpunit.el
100644 88 lines (76 sloc) 3.033 kb
edit raw blame history
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
;; test-case-phpunit.el --- PHPUnit support for test-case-mode
;;
;; Copyright (C) 2009 Ian Eure
;;
;; Author: Ian Eure <ian.eure@gmail.com>
;; Version: 1.0
;; Keywoards: testing
;; URL: http://github.com/ieure/test-case-mode
;; Compatibility: GNU Emacs 22.x, GNU Emacs 23.x
;; Package-Requires: ((fringe-helper "0.1.1") (test-case-mode "0.1"))
;;
;; This file is NOT part of GNU Emacs.
;;
;; 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 2
;; 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 <http://www.gnu.org/licenses/>
;;
;; Commentary:
;;
;; `test-case-phpunit' adds PHPUnit support to test-case-mode.
;;
;; Installation:
;;
;; Place in your `load-path', then:
;; (require 'test-case-phpunit)
 
(require 'test-case-mode)
 
(defcustom test-case-phpunit-executable (executable-find "phpunit")
  "The phpunit executable used to run PHPUnit tests."
  :group 'test-case
  :type 'file)
 
(defcustom test-case-phpunit-arguments ""
  "The command line arguments used to run PHPUnit tests."
  :group 'test-case
  :type 'string)
 
(defconst test-case-phpunit-failure-pattern
  '("^[0-9]+)\s+\\(.*\\)\n\\(Failed.*\\)\n\\([^:]+\\):\\([0-9]+\\)"
    3 4 nil 2 0)
  "Regular expression for matchin PHPUnit failute output.")
 
(defconst test-case-phpunit-test-pattern
  "\\<extends\\>.*Tests?_?\\(Case\\|Suite\\)?"
  "Regular expression for locating classes which extend PHPUnit.")
 
(defconst test-case-phpunit-font-lock-keywords
  '("\\<$this->assert[^\s(]+\\>"
    (0 'test-case-assertion prepend))
  "Regular expression for PHPUnit assertions.")
 
(defconst test-case-phpunit-class-pattern
  "class\s+\\([^\s]*Test[^\s]*\\)"
  "Regular expression for matchin PHPUnit test class names.")
 
(defun test-case-phpunit-find-test-class ()
  "Determine the name of the test class"
  (test-case-grep test-case-phpunit-class-pattern))
 
(defun test-case-phpunit-backend (command)
  "PHPUnit back-end for `test-case-mode'."
  (case command
    ('name "PHPUnit")
    ('supported (and (derived-mode-p 'php-mode)
                     (test-case-grep test-case-phpunit-test-pattern)
                     t))
    ('command (format "%s %s %s %s" test-case-phpunit-executable
                      test-case-phpunit-arguments
                      (test-case-phpunit-find-test-class)
                      buffer-file-name))
    ('save t)
    ('failure-pattern test-case-phpunit-failure-pattern)
    ('font-lock-keywords test-case-phpunit-font-lock-keywords)))
 
(add-to-list 'test-case-backends 'test-case-phpunit-backend)
 
(provide 'test-case-phpunit)
 
Blog | Support | Training | Contact | API | Status | Twitter | Help | Security
© 2010 GitHub Inc. All rights reserved. | Terms of Service | Privacy Policy
Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
Dedicated Server