emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Martyn Jago <martyn.jago@btinternet.com>
To: emacs-orgmode@gnu.org
Subject: [patch][test] Remove jump.el dependency from test execution
Date: Mon, 12 Sep 2011 17:04:48 +0100	[thread overview]
Message-ID: <m2zki94uhr.fsf@btinternet.com> (raw)

[-- 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

             reply	other threads:[~2011-09-12 16:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-12 16:04 Martyn Jago [this message]
2011-09-12 16:37 ` [patch][test] Remove jump.el dependency from test execution Eric Schulte

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2zki94uhr.fsf@btinternet.com \
    --to=martyn.jago@btinternet.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).