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: Tue, 06 Sep 2011 16:35:29 +0100	[thread overview]
Message-ID: <m2zkihela6.fsf@btinternet.com> (raw)
In-Reply-To: CAGhLh6FrgD8wUCXG7V06aU5yAahZsL9aZTmhNZdQojoT1-F61w@mail.gmail.com

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


Hi 

Rainer M Krug <r.m.krug@gmail.com> writes:

[...]

>
>>
>> > And if this could be done by the user to test .emacs configuration
>> > settings, that would be really great.
>> >
>>
>> That's a good idea.  Simply running the Org-mode test suite is a good
>> way for users to test the sanity of their local config.
>>
>
> Yes - I have a few times run into problems due to my configuration file and
> only realized it later - if there would be ab org file which I could use to
> test easily my configuration directly after making the changes, life would
> have been much easier for me. This would also be useful for questions on the
> mailing list and for a kind of "quality control" for published configs on
> the web.

In terms of running all the tests in 'batch mode' i.e. loading no
personal configuration files (for development purposes), I have put
together a small 'test-init.el' file to do that.

The emacs command is:

--8<---------------cut here---------------start------------->8---

$ /path/to/emacs/Emacs -batch -l /path/to/org/testing/test-init.el

--8<---------------cut here---------------end--------------->8---

The test-init.el file should be in the testing directory which should
also be the local directory.

Below are the test-init.el file and the generated results.
All tests are currently passing.

Regards

Martyn


[-- Attachment #2: test-init.el --]
[-- Type: application/emacs-lisp, Size: 1905 bytes --]

[-- Attachment #3: results.log --]
[-- Type: text/plain, Size: 12808 bytes --]

Loading vc-git...
21 src blocks added to Library of Babel
Loading /Users/martyn/org-mode/testing/lisp/test-org.el (source)...
Loading /Users/martyn/org-mode/testing/lisp/test-org-table.el (source)...
Loading /Users/martyn/org-mode/testing/lisp/test-org-html.el (source)...
Loading /Users/martyn/org-mode/testing/lisp/test-ob.el (source)...
Loading /Users/martyn/org-mode/testing/lisp/test-ob-tangle.el (source)...
Loading /Users/martyn/org-mode/testing/lisp/test-ob-table.el (source)...
Loading /Users/martyn/org-mode/testing/lisp/test-ob-sh.el (source)...
Loading /Users/martyn/org-mode/testing/lisp/test-ob-lob.el (source)...
Loading /Users/martyn/org-mode/testing/lisp/test-ob-lilypond.el (source)...
Loading /Users/martyn/org-mode/testing/lisp/test-ob-fortran.el (source)...
Loading /Users/martyn/org-mode/testing/lisp/test-ob-exp.el (source)...
Loading /Users/martyn/org-mode/testing/lisp/test-ob-awk.el (source)...

------------------------- Test start --------------------------------------

GNU Emacs 24.0.50.1 (x86_64-apple-darwin, NS apple-appkit-1038.35)
 of 2011-08-21 on virtualmac.porkrind.org
Org-mode version 7.7 (release_7.7.246.g3dac.dirty)


Running 101 tests (2011-09-06 16:10:49+0100)
OVERVIEW
executing Awk code block...
executing Awk source code block
"42"
   passed    1/101  ob-awk/input-none
executing Awk code block (genfile)...
executing Awk source code block
"150"
   passed    2/101  ob-awk/input-src-block
   passed    3/101  ob-fortran/assert
OVERVIEW
executing Fortran code block...
"word"
   passed    4/101  ob-fortran/character-var
executing Fortran code block...
"23"
   passed    5/101  ob-fortran/command-arguments
executing Fortran code block (fortran_parameter)...
"10"
   passed    6/101  ob-fortran/fortran-var-program
executing Fortran code block...
"15"
   passed    7/101  ob-fortran/input-var
executing Fortran code block...
"1.00 2.00 3.00"
   passed    8/101  ob-fortran/list-var
executing Fortran code block...
"1.00 2.00"
   passed    9/101  ob-fortran/list-var-from-table
executing Fortran code block...
   passed   10/101  ob-fortran/no-variables-with-main
executing Fortran code block...
"42"
   passed   11/101  ob-fortran/preprosessor-var
executing Fortran code block (hello)...
"Hello world"
   passed   12/101  ob-fortran/simple-program
   passed   13/101  ob-lilypond/assert
   passed   14/101  ob-lilypond/check-lilypond-alias
   passed   15/101  ob-lilypond/feature-provision
   passed   16/101  ob-lilypond/ly-OSX-ly-path
   passed   17/101  ob-lilypond/ly-OSX-midi-path
   passed   18/101  ob-lilypond/ly-OSX-pdf-path
   passed   19/101  ob-lilypond/ly-arrange-mode
Saving file /Users/martyn/org-mode/testing/examples/ob-lilypond-test.pdf...
Wrote /Users/martyn/org-mode/testing/examples/ob-lilypond-test.pdf
No pdf file generated so can't display!
   passed   20/101  ob-lilypond/ly-attempt-to-open-pdf
Saving file /Users/martyn/org-mode/testing/examples/ob-lilypond-test.midi...
Wrote /Users/martyn/org-mode/testing/examples/ob-lilypond-test.midi
No midi file generated so can't play!
   passed   21/101  ob-lilypond/ly-attempt-to-play-midi
   passed   22/101  ob-lilypond/ly-check-for-compile-error
Compiling LilyPond...
   passed   23/101  ob-lilypond/ly-compile-lilyfile
   passed   24/101  ob-lilypond/ly-compile-post-tangle
   passed   25/101  ob-lilypond/ly-determine-ly-path
   passed   26/101  ob-lilypond/ly-determine-midi-path
   passed   27/101  ob-lilypond/ly-determine-pdf-path
   passed   28/101  ob-lilypond/ly-display-pdf-post-tangle
   passed   29/101  ob-lilypond/ly-gen-html
   passed   30/101  ob-lilypond/ly-gen-png
   passed   31/101  ob-lilypond/ly-gen-svg
   passed   32/101  ob-lilypond/ly-get-header-args
OVERVIEW
   passed   33/101  ob-lilypond/ly-mark-error-line
   passed   34/101  ob-lilypond/ly-nix-ly-path
   passed   35/101  ob-lilypond/ly-nix-midi-path
   passed   36/101  ob-lilypond/ly-nix-pdf-path
   passed   37/101  ob-lilypond/ly-parse-error-line
   passed   38/101  ob-lilypond/ly-parse-line-num
   passed   39/101  ob-lilypond/ly-play-midi-post-tangle
OVERVIEW
   passed   40/101  ob-lilypond/ly-process-compile-error
   passed   41/101  ob-lilypond/ly-set-header-args
   passed   42/101  ob-lilypond/ly-switch-extension-with-extensions
   passed   43/101  ob-lilypond/ly-switch-extension-with-paths
Arrange mode has been ENABLED.
Arrange mode has been DISABLED.
   passed   44/101  ob-lilypond/ly-toggle-arrange-mode
HTML generation has been ENABLED.
HTML generation has been DISABLED.
   passed   45/101  ob-lilypond/ly-toggle-html-generation-toggles-flag
Post-Tangle MIDI play has been DISABLED.
Post-Tangle MIDI play has been ENABLED.
   passed   46/101  ob-lilypond/ly-toggle-midi-play-toggles-flag
Post-Tangle PDF display has been DISABLED.
Post-Tangle PDF display has been ENABLED.
   passed   47/101  ob-lilypond/ly-toggle-pdf-display-toggles-flag
PNG image generation has been ENABLED.
PNG image generation has been DISABLED.
   passed   48/101  ob-lilypond/ly-toggle-png-generation-toggles-flag
ob-lilypond version 0.3
ob-lilypond version 0.3
   passed   49/101  ob-lilypond/ly-version-command
   passed   50/101  ob-lilypond/ly-version-const
   passed   51/101  ob-lilypond/ly-win32-ly-path
   passed   52/101  ob-lilypond/ly-win32-midi-path
   passed   53/101  ob-lilypond/ly-win32-pdf-path
   passed   54/101  ob-lilypond/org-babel-expand-body:lilypond
   passed   55/101  ob-lilypond/org-babel-prep-session:lilypond
   passed   56/101  ob-lilypond/org-babel-tangle-lang-exts
   passed   57/101  ob-lilypond/use-eps
OVERVIEW
(No changes need to be saved)
Setting up indent for shell type bash
setting up indent stuff
Indentation variables are now local.
Indentation setup for shell type bash
Wrote /Users/martyn/org-mode/testing/examples/babel.sh
tangled 1 code block from babel.org
   passed   58/101  ob-tangle/continued-code-blocks-w-noweb-ref
file:"~/org-mode/testing/examples/babel.org"
   passed   59/101  ob-tangle/expand-headers-as-noweb-references
(No changes need to be saved)
tangled 0 code blocks from babel.org
   passed   60/101  ob-tangle/no-excessive-id-insertion-on-tangle
OVERVIEW
Exporting...
Exporting...
HTML export done, pushed to kill ring and clipboard
   passed   61/101  test-ob-exp/org-babel-exp-src-blocks/w-no-file
OVERVIEW
Exporting...
Exporting...
Saving file /Users/martyn/org-mode/testing/link-in-heading.html...
Wrote /Users/martyn/org-mode/testing/link-in-heading.html
HTML export done, pushed to kill ring and clipboard
   passed   62/101  test-ob-exp/org-babel-exp-src-blocks/w-no-headers
#+call: echo(input="testing")
executing Emacs-Lisp code block (echo)...

(input (quote "testing"))

"testing"
executing Emacs-Lisp code block...

(results (quote "testing"))

"testing"
executing Emacs-Lisp code block (echo)...

(input (quote "testing"))

"testing"
executing Emacs-Lisp code block...

(results (quote "testing"))

(("testing"))
executing Emacs-Lisp code block (echo)...

(input (quote "testing"))

"testing"
executing Emacs-Lisp code block...

(results (quote "testing"))

"testing"
executing Emacs-Lisp code block (echo)...

(input (quote "testing"))

"testing"
executing Emacs-Lisp code block...

(results (quote "testing"))

(("testing"))
executing Emacs-Lisp code block (echo)...

(input (quote "testing"))

"testing"
executing Emacs-Lisp code block...

(results (quote "testing"))

"testing"
executing Emacs-Lisp code block (echo)...

(input (quote "testing"))

"testing"
executing Emacs-Lisp code block...

(results (quote "testing"))

(("testing"))
executing Emacs-Lisp code block (echo)...

(input (quote "testing"))

"testing"
executing Emacs-Lisp code block...

(results (quote "testing"))

"testing"
executing Emacs-Lisp code block (echo)...

(input (quote "testing"))

"testing"
executing Emacs-Lisp code block...

(results (quote "testing"))

(("testing"))
executing Emacs-Lisp code block (lob-minus)...

(a (quote 8))

(b (quote 4))

"4"
executing Emacs-Lisp code block...

(results (quote 4))

"4"
executing Emacs-Lisp code block (echo)...

(input (quote "testing"))

"testing"
executing Emacs-Lisp code block...

(results (quote "testing"))

"testing"
executing Emacs-Lisp code block (concat)...

(a (quote 1))

(b (quote 2))

(c (quote 3))

"123"
executing Emacs-Lisp code block...

(results (quote "123"))

"123"
   passed   63/101  test-ob-lob/call-with-header-arguments
Exporting...
executing Emacs-Lisp code block (double)...

(it (quote 0))

"0"
executing Emacs-Lisp code block...

(results (quote 0))

Code block evaluation complete.
executing Emacs-Lisp code block (double)...

(it (quote 1))

"2"
executing Emacs-Lisp code block...

(results (quote 2))

Code block evaluation complete.
executing Emacs-Lisp code block (double)...

(it (quote 3))

"6"
executing Emacs-Lisp code block...

(results (quote 6))

Code block evaluation complete.
executing Emacs-Lisp code block (double)...

(it (quote 4))

"8"
executing Emacs-Lisp code block...

(results (quote 8))

Code block evaluation complete.
executing Emacs-Lisp code block (double)...

(it (quote 5))

"10"
executing Emacs-Lisp code block...

(results (quote 10))

Code block evaluation complete.
Exporting...
HTML export done, pushed to kill ring and clipboard
   passed   64/101  test-ob-lob/export-lob-lines
7 src blocks added to Library of Babel
   passed   65/101  test-ob-lob/ingest
Babel evaluation exited with code 1
   passed   66/101  test-ob-sh/dont-error-on-empty-results
   passed   67/101  test-ob-sh/dont-insert-spaces-on-expanded-bodies
   passed   68/101  test-org-babel/default-inline-header-args
executing Emacs-Lisp code block...

(prop (quote 4))

Code block evaluation complete.
   passed   69/101  test-org-babel/elisp-in-header-arguments
   passed   70/101  test-org-babel/get-header
OVERVIEW
   passed   71/101  test-org-babel/get-src-block-info-body
OVERVIEW
   passed   72/101  test-org-babel/get-src-block-info-language
OVERVIEW
   passed   73/101  test-org-babel/get-src-block-info-tangle
   passed   74/101  test-org-babel/inline-src-block-regexp
executing Sh code block...
"1"
executing Sh code block...
"2"
executing Sh code block...
"3"
   passed   75/101  test-org-babel/inline-src-blocks
executing Emacs-Lisp code block...

(numbers (quote (1 2 3 4 5 6 7)))

(letters (quote (a b c d e f g)))

Code block evaluation complete.
   passed   76/101  test-org-babel/multi-line-header-arguments
   passed   77/101  test-org-babel/multi-line-header-regexp
   passed   78/101  test-org-babel/org-babel-get-inline-src-block-matches
((:var num . 9) (:colname-names) (:rowname-names) (:result-params "output" "replace") (:result-type . output) (:comments . "") (:shebang . "") (:cache . "no") (:padline . "") (:noweb . "no") (:tangle . "no") (:exports . "code") (:results . "output replace") (:session) (:padnewline . "yes") (:hlines . "no"))
   passed   79/101  test-org-babel/parse-header-args
file:"~/org-mode/testing/examples/babel.org"
executing Emacs-Lisp code block...

(text (quote "has length 14
"))

"14"
   passed   80/101  test-org-babel/parse-header-args2
executing Emacs-Lisp code block (i-have-a-name)...
Code block evaluation complete.
   passed   81/101  test-org-babel/simple-named-code-block
executing Emacs-Lisp code block (four)...
(1 2 3 4)
executing Emacs-Lisp code block...

(four (quote (1 2 3 4)))

Code block evaluation complete.
   passed   82/101  test-org-babel/simple-variable-resolution
   passed   83/101  test-org-babel/src-block-regexp
   passed   84/101  test-org-babel/src-name-regexp
   passed   85/101  test-org-babel/src-name-w-name-regexp
   passed   86/101  test-org-html/export-link/0
   passed   87/101  test-org-table/org-table-convert-refs-to-an/1
   passed   88/101  test-org-table/org-table-convert-refs-to-an/3
   passed   89/101  test-org-table/org-table-convert-refs-to-rc/1
   passed   90/101  test-org-table/org-table-convert-refs-to-rc/2
OVERVIEW
Re-applying formulas to full table...
Re-applying formulas to full table...(line 1)
Re-applying formulas to 1 lines...done
Re-applying formulas...done
Re-applying formulas...done
   passed   91/101  test-org-table/simple-formula
   passed   92/101  test-org/org-link-escape-ascii-character
   passed   93/101  test-org/org-link-escape-ascii-ctrl-character
   passed   94/101  test-org/org-link-escape-custom-table
   passed   95/101  test-org/org-link-escape-custom-table-merge
   passed   96/101  test-org/org-link-escape-multibyte-character
   passed   97/101  test-org/org-link-escape-url-with-escaped-char
   passed   98/101  test-org/org-link-unescape-ascii-character
   passed   99/101  test-org/org-link-unescape-ascii-ctrl-character
   passed  100/101  test-org/org-link-unescape-ascii-extended-char
   passed  101/101  test-org/org-link-unescape-multibyte-character

Ran 101 tests, 101 results as expected (2011-09-06 16:10:54+0100)


[-- Attachment #4: Type: text/plain, Size: 142 bytes --]


[...]

---
Org-mode version 7.7
GNU Emacs 24.0.50.1 (x86_64-apple-darwin, NS apple-appkit-1038.35)
 of 2011-08-21 on virtualmac.porkrind.org

  parent reply	other threads:[~2011-09-06 15:35 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 [this message]
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
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=m2zkihela6.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).