emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nathan Neff <nathan.neff@gmail.com>
To: emacs-orgmode@gnu.org
Subject: [babel] Babel as a test harness?
Date: Fri, 19 Mar 2010 18:43:35 -0500	[thread overview]
Message-ID: <211769421003191643l2d00b8cai63028b369408552f@mail.gmail.com> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 830 bytes --]

I think it would be cool to use Org-babel as a simple test harness.

I'd like to have an org file, with various sections that demonstrate how to
do
something in Groovy.  I'd like to be able to run all the code in the org
file and make sure
they all run successfully (return code 0).

In Groovy, the "assert" function will exit with a non-zero code if it
fails.  How
would I use org-babel to generate a "summary" table with the name of
each patch of code and whether or not it succeeded?

Something like this would be cool:

* Regular Expressions
** Here's how to match "foo"

#+source simple_regex
#+begin_src groovy
assert "foo" =~ /foo/
#+end_src

** Here's how to match "bar" or "baz"
#+source regex_or
#+begin_src groovy
assert "bar" =~ "ba(z|r)"
#+end_src

* Results:
| simple_regex | success |
| regex_or        | success |

[-- Attachment #1.2: Type: text/html, Size: 1027 bytes --]

[-- Attachment #2: Type: text/plain, Size: 201 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

             reply	other threads:[~2010-03-19 23:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-19 23:43 Nathan Neff [this message]
2010-03-20  0:45 ` [babel] Babel as a test harness? Dan Davison
2010-03-20 19:22   ` Nathan Neff
2010-03-20 19:38   ` Nathan Neff

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=211769421003191643l2d00b8cai63028b369408552f@mail.gmail.com \
    --to=nathan.neff@gmail.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).