emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [babel] Babel as a test harness?
@ 2010-03-19 23:43 Nathan Neff
  2010-03-20  0:45 ` Dan Davison
  0 siblings, 1 reply; 4+ messages in thread
From: Nathan Neff @ 2010-03-19 23:43 UTC (permalink / raw)
  To: emacs-orgmode


[-- 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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-03-20 19:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-19 23:43 [babel] Babel as a test harness? Nathan Neff
2010-03-20  0:45 ` Dan Davison
2010-03-20 19:22   ` Nathan Neff
2010-03-20 19:38   ` Nathan Neff

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).