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] Collection of code block snippets
Date: Thu, 08 Sep 2011 23:03:59 +0100	[thread overview]
Message-ID: <m2obyud73k.fsf@btinternet.com> (raw)
In-Reply-To: m2sjo6dgs6.fsf@btinternet.com

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

Hi Eric

Martyn Jago <martyn.jago@btinternet.com> writes:

> Hi Eric
>
> Eric Schulte <schulte.eric@gmail.com> writes:
>
>> Hi Martyn,
>>
>>>
>>> I have written a few more tests for inline source blocks execution with
>>> org-ctrl-c-ctrl-c (not extensive by any means).
>>
>> Thanks for adding these tests, I get 6 failures all with the same error
>> [1], is that intentional?  If not would you mind taking another look at
>> this patch?

I reverse-engineered my =test-init.el= script using a call to
=org-test-run-batch-tests= and from that worked out why your script was
breaking tests. 

One problem on my system is that emacs was using the wrong org mode
since the newer org location wasn't known about. Also, the languages,
emacs-lisp and sh need to be switched on (I thought emacs-lisp was on by
default)?

Now all tests pass.

My minimised script...

--8<---------------cut here---------------start------------->8---
(let ((org-dir "~/org-mode/"))
  (add-to-list 'load-path (concat org-dir "lisp"))
  (add-to-list 'load-path (concat org-dir "testing"))
  (require 'org-test)
  (setq org-confirm-babel-evaluate nil)
  (org-babel-do-load-languages
   'org-babel-load-languages '((emacs-lisp . t) (sh . t)))
  (org-test-run-batch-tests))
--8<---------------cut here---------------end--------------->8---

Called by...

--8<---------------cut here---------------start------------->8---
emacs -Q -script ~/orgmode/testing/test-init.el
--8<---------------cut here---------------end--------------->8---

Your modified script...

--8<---------------cut here---------------start------------->8---
emacs -Q -batch -L ~/org-mode/lisp ~/org-mode/testing -l org-test.el \
-eval "(progn(setq org-confirm-babel-evaluate nil) \
(org-babel-do-load-languages 'org-babel-load-languages '((emacs-lisp \
. t) (sh . t))))" -f org-test-run-batch-tests
--8<---------------cut here---------------end--------------->8---

I've fixed my typos in test-ob.el below.

Best, Martyn


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Fixed typos in test-ob.el --]
[-- Type: text/x-patch, Size: 1241 bytes --]

From a444094303e48cbb5f4027e83f8dcf60d240204b Mon Sep 17 00:00:00 2001
From: Martyn Jago <martyn.jago@btinternet.com>
Date: Thu, 8 Sep 2011 22:34:38 +0100
Subject: [PATCH] * testing/lisp/test-ob.el: Fixed typo

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

diff --git a/testing/lisp/test-ob.el b/testing/lisp/test-ob.el
index 9735bd8..1f04c5b 100644
--- a/testing/lisp/test-ob.el
+++ b/testing/lisp/test-ob.el
@@ -390,13 +390,13 @@
       (should (string= (concat test-line " [[file:~/test-file]]")
 		       (buffer-substring-no-properties (point-min) (point-max)))))))
 
-(ert-deftest test-org-babel/inline-src_blk-results-scaler ()
+(ert-deftest test-org-babel/inline-src_blk-results-scalar ()
   (with-temp-buffer
 
-    (let ((test-line "src_emacs-lisp[ :results scaler ]{ \"x\"  }"))
+    (let ((test-line "src_emacs-lisp[ :results scalar ]{ \"x\"  }"))
       (insert test-line)
       (goto-char (point-min)) (org-ctrl-c-ctrl-c)
-      (should (string= (concat test-line " =x=")
+      (should (string= (concat test-line  " =\"x\"=")
 		       (buffer-substring-no-properties (point-min) (point-max)))))))
 
 (ert-deftest test-org-babel/inline-src_blk-results-verbatim ()
-- 
1.7.3.4


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



[...]


  reply	other threads:[~2011-09-08 22:04 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-04 16:35 [babel] Collection of code block snippets Eric Schulte
2011-09-05  8:29 ` Rainer M Krug
2011-09-05 16:54   ` Eric Schulte
2011-09-06  8:26     ` Rainer M Krug
2011-09-06 15:16       ` Eric Schulte
2011-09-06 15:35       ` Martyn Jago
2011-09-06 17:13         ` Eric Schulte
2011-09-07  8:19           ` Rainer M Krug
2011-09-07 18:24             ` Martyn Jago
2011-09-07 18:15           ` Martyn Jago
2011-09-08 15:16             ` Eric Schulte
2011-09-08 16:18               ` Martyn Jago
2011-09-08 17:44                 ` Eric Schulte
2011-09-08 18:34                   ` Martyn Jago
2011-09-08 22:03                     ` Martyn Jago [this message]
2011-09-09  8:22                       ` Rainer M Krug
2011-09-09 10:58                         ` Martyn Jago
2011-09-09 11:11                       ` Martyn Jago
2011-09-09 20:39                         ` Eric Schulte
2011-09-10  8:09                           ` Martyn Jago
2011-09-11 20:57                             ` Eric Schulte
2011-09-14  4:49                             ` David Maus
2011-09-14 12:10                               ` Martyn Jago
2011-09-09 19:19                       ` 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=m2obyud73k.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).