summary refs log tree commit diff
diff options
context:
space:
mode:
authorChristian Neukirchen <chneukirchen@gmail.com>2008-01-07 19:33:25 +0100
committerChristian Neukirchen <chneukirchen@gmail.com>2008-01-07 19:33:25 +0100
commita97248aef4350abb6a0d9813cb3b15d7cd4a29e8 (patch)
tree6c6a1f92b3452b9bdad9d107368477d04b3b1193
parent81ad56ff88b302919ecad0b0b11e1244d236f551 (diff)
downloadbacon-a97248aef4350abb6a0d9813cb3b15d7cd4a29e8.tar.gz
bacon-a97248aef4350abb6a0d9813cb3b15d7cd4a29e8.tar.xz
bacon-a97248aef4350abb6a0d9813cb3b15d7cd4a29e8.zip
Add bacon -o FORMAT
darcs-hash:20080107183325-4fc50-4dbf245e632fc4860117b79da2cea8ece1009b33.gz
-rw-r--r--README1
-rwxr-xr-xbin/bacon9
2 files changed, 8 insertions, 2 deletions
diff --git a/README b/README
index 427f494..859e8a5 100644
--- a/README
+++ b/README
@@ -172,6 +172,7 @@ contexts.
   -s, --specdox            do AgileDox-like output (default)
   -q, --quiet              do Test::Unit-like non-verbose output
   -p, --tap                do TAP (Test Anything Protocol) output
+  -o, --output FORMAT      do FORMAT (SpecDox/TestUnit/Tap) output
   -a, --automatic          gather tests from ./test/, include ./lib/
   -n, --name NAME          runs tests matching regexp NAME
   -t, --testcase TESTCASE  runs tests in TestCases matching regexp TESTCASE
diff --git a/bin/bacon b/bin/bacon
index ad70263..cc3a08c 100755
--- a/bin/bacon
+++ b/bin/bacon
@@ -45,10 +45,15 @@ opts = OptionParser.new("", 24, '  ') { |opts|
   opts.on("-q", "--quiet",   "do Test::Unit-like non-verbose output") {
     output = 'TestUnitOutput'
   }
-  opts.on("-p", "--tap",   "do TAP (Test Anything Protocol) output") {
+  opts.on("-p", "--tap",     "do TAP (Test Anything Protocol) output") {
     output = 'TapOutput'
   }
 
+  opts.on("-o", "--output FORMAT",
+          "do FORMAT (SpecDox/TestUnit/Tap) output") { |format|
+    output = format + "Output" 
+  }
+
   opts.on("-a", "--automatic", "gather tests from ./test/, include ./lib/") {
     $LOAD_PATH.unshift "lib"  if File.directory? "lib"
     automatic = true
@@ -96,7 +101,7 @@ end
 
 require 'bacon'
 
-Bacon.extend Bacon.const_get(output)
+Bacon.extend Bacon.const_get(output) rescue abort "No such formatter: #{output}"
 Bacon.summary_on_exit
 
 files.each { |file|