From mboxrd@z Thu Jan 1 00:00:00 1970 From: Martyn Jago Subject: Re: [babel] BUG in :session Date: Wed, 21 Sep 2011 22:20:25 +0100 Message-ID: References: <4E79C82A.9000809@gmail.com> <878vpidj5d.fsf@gmail.com> <87hb45d73i.fsf@gmail.com> <80ty85hd3l.fsf@somewhere.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([140.186.70.92]:49717) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R6UDj-0002AZ-S1 for emacs-orgmode@gnu.org; Wed, 21 Sep 2011 17:20:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R6UDi-0003ud-Le for emacs-orgmode@gnu.org; Wed, 21 Sep 2011 17:20:43 -0400 Received: from lo.gmane.org ([80.91.229.12]:47272) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R6UDi-0003uW-Be for emacs-orgmode@gnu.org; Wed, 21 Sep 2011 17:20:42 -0400 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1R6UDg-0002OZ-NQ for emacs-orgmode@gnu.org; Wed, 21 Sep 2011 23:20:40 +0200 Received: from 88-96-171-142.dsl.zen.co.uk ([88.96.171.142]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 21 Sep 2011 23:20:40 +0200 Received: from martyn.jago by 88-96-171-142.dsl.zen.co.uk with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 21 Sep 2011 23:20:40 +0200 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain Hi Sebastien and Eric "Sebastien Vauban" writes: > Hi Eric and Martyn, > > Eric Schulte wrote: >> Martyn Jago 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 --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-Bypass-test-where-dependencies-missing.patch Content-Description: Bypass-test-where-dependencies-missing >From de40e439d1a4d110a47d5a0701741493a285143c Mon Sep 17 00:00:00 2001 From: Martyn Jago 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 --=-=-= Content-Type: text/plain --- 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 --=-=-=--