* [patch][test] Remove jump.el dependency from test execution
@ 2011-09-12 16:04 Martyn Jago
2011-09-12 16:37 ` Eric Schulte
0 siblings, 1 reply; 2+ messages in thread
From: Martyn Jago @ 2011-09-12 16:04 UTC (permalink / raw)
To: emacs-orgmode
[-- Attachment #1: Type: text/plain, Size: 427 bytes --]
Currently it is required to install the git submodule jump.el and
dependencies to run tests, and yet these test helpers are not required
in test execution.
This patch removes this dependency, whilst loading the test helpers when
they exist (git submodule init && git submodule update).
The idea is to document the test helper availability to aid development
in the test documentation I am about to generate.
Best, Martyn
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Remove jump.el dependency from test execution --]
[-- Type: text/x-patch, Size: 2281 bytes --]
From b3111a4ea6b2e5b134634c7eebf27a210529df58 Mon Sep 17 00:00:00 2001
From: Martyn Jago <martyn.jago@btinternet.com>
Date: Mon, 12 Sep 2011 16:50:28 +0100
Subject: [PATCH] Remove jump.el dependency from test execution
* testing/org-test.el:
Remove jump.el dependency from test execution removing the need for a
user to install git submodules
---
testing/org-test.el | 23 ++++++++++++++---------
1 files changed, 14 insertions(+), 9 deletions(-)
diff --git a/testing/org-test.el b/testing/org-test.el
index a8b5b49..136a287 100644
--- a/testing/org-test.el
+++ b/testing/org-test.el
@@ -16,11 +16,13 @@
;; called while in a `defun' all ert tests with names matching the
;; name of the function are run.
-;;; Prerequisites:
-
-;; ERT and jump.el are both included as git submodules, install with
-;; $ git submodule init
-;; $ git submodule update
+;;; Test Development
+;; For test development purposes a number of navigation and test
+;; function construction routines are available as a git submodule
+;; (jump.el)
+;; Install with...
+;; $ git submodule init
+;; $ git submodule update
\f
;;;; Code:
@@ -38,13 +40,15 @@
(cons
(expand-file-name "jump" org-test-dir)
load-path))))
+ (require 'cl)
(require 'ert)
(require 'ert-x)
- (require 'jump)
- (require 'which-func)
+ (when (file-exists-p
+ (expand-file-name "jump/jump.el" org-test-dir))
+ (require 'jump)
+ (require 'which-func))
(require 'org)))
-
(defconst org-test-default-test-file-name "tests.el"
"For each defun a separate file with tests may be defined.
tests.el is the fallback or default if you like.")
@@ -136,6 +140,7 @@ files."
\f
;;; Navigation Functions
+(when (featurep 'jump)
(defjump org-test-jump
(("lisp/\\1.el" . "testing/lisp/test-\\1.el")
("lisp/\\1.el" . "testing/lisp/\\1.el/test.*.el")
@@ -178,7 +183,7 @@ files."
" (should-error (error \"errr...\")))\n\n\n"
"(provide '" name ")\n\n"
";;; " file-name " ends here\n") full-path))
- (lambda () ((lambda (res) (if (listp res) (car res) res)) (which-function))))
+ (lambda () ((lambda (res) (if (listp res) (car res) res)) (which-function)))))
(define-key emacs-lisp-mode-map "\M-\C-j" 'org-test-jump)
--
1.7.3.4
[-- Attachment #3: Type: text/plain, Size: 166 bytes --]
---
Org-mode version 7.7 (release_7.7.278.gb3111.dirty)
GNU Emacs 24.0.50.1 (x86_64-apple-darwin, NS apple-appkit-1038.35)
of 2011-08-21 on virtualmac.porkrind.org
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [patch][test] Remove jump.el dependency from test execution
2011-09-12 16:04 [patch][test] Remove jump.el dependency from test execution Martyn Jago
@ 2011-09-12 16:37 ` Eric Schulte
0 siblings, 0 replies; 2+ messages in thread
From: Eric Schulte @ 2011-09-12 16:37 UTC (permalink / raw)
To: Martyn Jago; +Cc: emacs-orgmode
Applied. Thanks! -- Eric
Martyn Jago <martyn.jago@btinternet.com> writes:
> Currently it is required to install the git submodule jump.el and
> dependencies to run tests, and yet these test helpers are not required
> in test execution.
>
> This patch removes this dependency, whilst loading the test helpers when
> they exist (git submodule init && git submodule update).
>
> The idea is to document the test helper availability to aid development
> in the test documentation I am about to generate.
>
> Best, Martyn
>
> From b3111a4ea6b2e5b134634c7eebf27a210529df58 Mon Sep 17 00:00:00 2001
> From: Martyn Jago <martyn.jago@btinternet.com>
> Date: Mon, 12 Sep 2011 16:50:28 +0100
> Subject: [PATCH] Remove jump.el dependency from test execution
> * testing/org-test.el:
> Remove jump.el dependency from test execution removing the need for a
> user to install git submodules
>
> ---
> testing/org-test.el | 23 ++++++++++++++---------
> 1 files changed, 14 insertions(+), 9 deletions(-)
>
> diff --git a/testing/org-test.el b/testing/org-test.el
> index a8b5b49..136a287 100644
> --- a/testing/org-test.el
> +++ b/testing/org-test.el
> @@ -16,11 +16,13 @@
> ;; called while in a `defun' all ert tests with names matching the
> ;; name of the function are run.
>
> -;;; Prerequisites:
> -
> -;; ERT and jump.el are both included as git submodules, install with
> -;; $ git submodule init
> -;; $ git submodule update
> +;;; Test Development
> +;; For test development purposes a number of navigation and test
> +;; function construction routines are available as a git submodule
> +;; (jump.el)
> +;; Install with...
> +;; $ git submodule init
> +;; $ git submodule update
>
> \f
> ;;;; Code:
> @@ -38,13 +40,15 @@
> (cons
> (expand-file-name "jump" org-test-dir)
> load-path))))
> + (require 'cl)
> (require 'ert)
> (require 'ert-x)
> - (require 'jump)
> - (require 'which-func)
> + (when (file-exists-p
> + (expand-file-name "jump/jump.el" org-test-dir))
> + (require 'jump)
> + (require 'which-func))
> (require 'org)))
>
> -
> (defconst org-test-default-test-file-name "tests.el"
> "For each defun a separate file with tests may be defined.
> tests.el is the fallback or default if you like.")
> @@ -136,6 +140,7 @@ files."
>
> \f
> ;;; Navigation Functions
> +(when (featurep 'jump)
> (defjump org-test-jump
> (("lisp/\\1.el" . "testing/lisp/test-\\1.el")
> ("lisp/\\1.el" . "testing/lisp/\\1.el/test.*.el")
> @@ -178,7 +183,7 @@ files."
> " (should-error (error \"errr...\")))\n\n\n"
> "(provide '" name ")\n\n"
> ";;; " file-name " ends here\n") full-path))
> - (lambda () ((lambda (res) (if (listp res) (car res) res)) (which-function))))
> + (lambda () ((lambda (res) (if (listp res) (car res) res)) (which-function)))))
>
> (define-key emacs-lisp-mode-map "\M-\C-j" 'org-test-jump)
--
Eric Schulte
http://cs.unm.edu/~eschulte/
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-09-12 16:37 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-12 16:04 [patch][test] Remove jump.el dependency from test execution Martyn Jago
2011-09-12 16:37 ` Eric Schulte
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).