emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Martyn Jago <martyn.jago@btinternet.com>
To: emacs-orgmode@gnu.org
Subject: Re: [babel] BUG in :session
Date: Wed, 21 Sep 2011 22:20:25 +0100	[thread overview]
Message-ID: <m2vcsllhie.fsf@btinternet.com> (raw)
In-Reply-To: 80ty85hd3l.fsf@somewhere.org

[-- Attachment #1: Type: text/plain, Size: 1479 bytes --]

Hi Sebastien and Eric

"Sebastien Vauban"
<wxhgmqzgwmuf@spammotel.com> writes:

> Hi Eric and Martyn,
>
> Eric Schulte wrote:
>> Martyn Jago <martyn.jago@btinternet.com> writes:
>>> Unfortunately this test introduces an external dependency for R (which I
>>> haven't currently got on my system so fails here). Not sure if that is
>>> avoidable - I have no problem installing it if not. 
>>
>> Yes, I think we're going to have to start putting some conditional
>> checks into org-test-run-all-tests so that only those code block tests
>> for which the required languages exist on the user's system are run.  I
>> don't know the best way to handle this.
>
> Testing both if:
>
> - the language is activated (`org-babel-load-languages')
> - the interpreter is found on the system (`exec-path')
>
> ?
>
> Just an idea...
>

I was thinking along the same lines, as a stop-gap at least...
 - test for feature ESS
 - test for R
 - If either are missing, 'bypass' the test but add a note to the test
  backtrace to that effect.
 - If dependencies are satisfied, run the test proper.

My main problem is that my 'config-less' tests are now failing across
Emacs 22, 23 and 24 (obviously), and are thus no longer particularly
useful!

I have included a patch that fixes things for me, but are you still
confident Eric that in the short term your test will still catch the
intended failure mode. I have little doubt that ultimately there will be
a more satisfactory solution.

Best, Martyn


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Bypass-test-where-dependencies-missing --]
[-- Type: text/x-patch, Size: 1220 bytes --]

From de40e439d1a4d110a47d5a0701741493a285143c Mon Sep 17 00:00:00 2001
From: Martyn Jago <martyn.jago@btinternet.com>
Date: Wed, 21 Sep 2011 22:01:16 +0100
Subject: [PATCH] Bypass test where dependencies missing
 * testing/lisp/test-ob-R.el:
 If R or ESS are missing don't run test
 but add NOTE to this effect in test
 backtrace

---
 testing/lisp/test-ob-R.el |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/testing/lisp/test-ob-R.el b/testing/lisp/test-ob-R.el
index 1fe63a5..457bf9c 100644
--- a/testing/lisp/test-ob-R.el
+++ b/testing/lisp/test-ob-R.el
@@ -16,9 +16,13 @@
 (require 'ob-R)
 
 (ert-deftest test-ob-R/simple-session ()
-  (org-test-with-temp-text
-      "#+begin_src R :session R\n  paste(\"Yep!\")\n#+end_src\n"
-    (should (string= "Yep!" (org-babel-execute-src-block)))))
+  (if (and (featurep 'ess)
+	   (eql 0 (shell-command org-babel-R-command)))
+      (org-test-with-temp-text
+	  "#+begin_src R :session R\n  paste(\"Yep!\")\n#+end_src\n"
+	(should (string= "Yep!" (org-babel-execute-src-block))))
+    (message "NOTE: =test-ob-R/simple-session= NOT run!
+ R and ESS are required to run =test-ob-R/simple-session=")))
 
 (provide 'test-ob-R)
 
-- 
1.7.3.4


[-- Attachment #3: Type: text/plain, Size: 159 bytes --]


---
Org-mode version 7.7 (release_7.7.315.g20e6)
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-21 21:20 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-21 11:19 [babel] BUG in :session Rainer M Krug
2011-09-21 12:57 ` Eric Schulte
2011-09-21 16:56   ` Martyn Jago
2011-09-21 18:54     ` Sebastien Vauban
2011-09-21 19:32       ` Eric Schulte
2011-09-21 19:32     ` Eric Schulte
2011-09-21 20:09       ` Sebastien Vauban
2011-09-21 21:20         ` Martyn Jago [this message]
2011-09-22  2:23           ` Eric Schulte
2011-09-23 11:36             ` Martyn Jago
2011-09-23 15:59               ` Eric Schulte
2011-09-23 16:12                 ` Martyn Jago
2011-09-23 22:16                   ` Sebastien Vauban
2011-09-24 22:13                     ` Eric Schulte
2011-09-25  8:37                     ` Martyn Jago
2011-09-26  7:54                       ` Sebastien Vauban
2011-09-26 12:23                         ` Eric Schulte
2011-09-26 13:59                           ` Sebastien Vauban
2011-09-24 22:12                   ` Eric Schulte
2011-09-25  8:31                     ` Martyn Jago
2011-09-21 17:09   ` Rainer M Krug

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=m2vcsllhie.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).