emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Orgmode] [babel] Babel as a test harness?


From: Nathan Neff
Subject: [Orgmode] [babel] Babel as a test harness?
Date: Fri, 19 Mar 2010 18:43:35 -0500

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 |


reply via email to

[Prev in Thread] Current Thread [Next in Thread]