Getting fox unit test runner to work

hi there,

sorry if the question seems dump but…

i have some unit tests that just work great

$ test/ILV_unittest.rb
Loaded suite test/ILV_unittest
Started

Finished in 0.060136 seconds.

24 tests, 141 assertions, 0 failures, 0 errors
$

they work both in ubuntu 10 and cygwin (windows XP). i’m happy with
this.

reading the doc I could see that there was supposed to be some way to
have the whoole thing handled by a nicer UI.

indeed :

$ test/ILV_unittest.rb --help
Test::Unit automatic runner.
Usage: test/ILV_unittest.rb [options] [-- untouched arguments]

-r, --runner=RUNNER              Use the given RUNNER.
                                 (c[onsole], f[ox], g[tk], g[tk]2,

t[k])
-n, --name=NAME Runs tests matching NAME.
(patterns may be used).
-t, --testcase=TESTCASE Runs tests in TestCases matching
TESTCASE.
(patterns may be used).
-I, --load-path=DIR[:DIR…] Appends directory list to
$LOAD_PATH.
-v, --verbose=[LEVEL] Set the output level (default is
verbose).
(s[ilent], p[rogress], n[ormal],
v[erbose])
– Stop processing options so that the
remaining options will be passed to
the
test.
-h, --help Display this help.

Deprecated options:
–console Console runner (use --runner).
–gtk GTK runner (use --runner).
–fox Fox runner (use --runner).

so --runner=fox should do the trick. However :

$ test/ILV_unittest.rb --runner=fox
/usr/lib/ruby/1.8/test/unit/ui/fox/testrunner.rb:7:in require': no such file to load -- fox (LoadError) from /usr/lib/ruby/1.8/test/unit/ui/fox/testrunner.rb:7 from /usr/lib/ruby/1.8/test/unit/autorunner.rb:37:in require’
from /usr/lib/ruby/1.8/test/unit/autorunner.rb:37
from /usr/lib/ruby/1.8/test/unit/autorunner.rb:214:in []' from /usr/lib/ruby/1.8/test/unit/autorunner.rb:214:in run’
from /usr/lib/ruby/1.8/test/unit/autorunner.rb:12:in run' from /usr/lib/ruby/1.8/test/unit.rb:279 from test/ILV_unittest.rb:227 $ test/ILV_unittest.rb --runner=gtk /usr/lib/ruby/1.8/test/unit/ui/gtk/testrunner.rb:7:in require’: no such
file to load – gtk (LoadError)
from /usr/lib/ruby/1.8/test/unit/ui/gtk/testrunner.rb:7
from /usr/lib/ruby/1.8/test/unit/autorunner.rb:29:in require' from /usr/lib/ruby/1.8/test/unit/autorunner.rb:29 from /usr/lib/ruby/1.8/test/unit/autorunner.rb:214:in []’
from /usr/lib/ruby/1.8/test/unit/autorunner.rb:214:in run' from /usr/lib/ruby/1.8/test/unit/autorunner.rb:12:in run’
from /usr/lib/ruby/1.8/test/unit.rb:279
from test/ILV_unittest.rb:227
alexis@mtb-ubuntu-vdesk:/media/share_mes_projets/MATester_RB$
test/ILV_unittest.rb --runner=console
Loaded suite test/ILV_unittest
Started

Finished in 0.059887 seconds.

24 tests, 141 assertions, 0 failures, 0 errors
$ gem env
RubyGems Environment:

  • RUBYGEMS VERSION: 1.3.5
  • RUBY VERSION: 1.8.7 (2010-01-10 patchlevel 249) [i486-linux]
  • INSTALLATION DIRECTORY: /var/lib/gems/1.8
  • RUBY EXECUTABLE: /usr/bin/ruby1.8
  • EXECUTABLE DIRECTORY: /var/lib/gems/1.8/bin
  • RUBYGEMS PLATFORMS:
    • ruby
    • x86-linux
  • GEM PATHS:
    • /var/lib/gems/1.8
    • /home/alexis/.gem/ruby/1.8
  • GEM CONFIGURATION:
    • :update_sources => true
    • :verbose => true
    • :benchmark => false
    • :backtrace => false
    • :bulk_threshold => 1000
  • REMOTE SOURCES:

$ gem list

*** LOCAL GEMS ***

fxruby (1.6.20)
hoe (2.6.1)
json_pure (1.4.6)
rake (0.8.7)
redcar (0.3.8.4)
rubyforge (2.0.4)
rubyzip (0.9.4)
test-unit (2.1.1)
test-unit-full (0.0.2)
test-unit-notify (0.0.1)
test-unit-runner-fox (0.0.1)
test-unit-runner-gtk2 (0.0.1)
test-unit-runner-tk (0.0.1)

$

It should be mentioned that I tried under cygwin first (but compiled Fox
lib failed unfortuantely so the fwruby gem would not install at all).
thus the reason why i tried with ubuntu just in case.
the weird thing is that i can have the fxruby example working on the
very same Ubuntu setup…
out of the blue i tried with gtk libs
==> faced same error see above
and out of ideas, i saw some test-unit-runner-fox (the 0.0.1 wasn’t very
appealing but since nothing was working…). i tried with
test-unit-runner-gtk but no luck

i’m out of ideas

anyone knows how i can get a unit test to be run with fox ? (or gtk)
basically with another runner than console?

thanks

On Aug 26, 2010, at 10:20 , Fourchette Fourchette wrote:

Finished in 0.060136 seconds.

Look at that number. Embrace it. Love it. But, please, don’t ruin it by
adding some silly GUI.

Ryan D. wrote:

On Aug 26, 2010, at 10:20 , Fourchette Fourchette wrote:

Finished in 0.060136 seconds.

Look at that number. Embrace it. Love it. But, please, don’t ruin it by
adding some silly GUI.

i couldn’t agree more

but sometimes paying clients like to “see” things so they continue to
believe that by paying you they’re dealing with the best. (obviously
it’s not true, i can barely evaluate the immensity of my own ignorance,
but what matters is what the guys paying think of us when they sign
checks)

so anyway, i figured it would be nice to have the test units being run
by scripts, and occasionally during meetings or presentations with
clients show something more sexy without having to endure the
development of the sexy GUI myself.

so i figured maybe --runner=fox was worth trying.

i hope this clarify things :slight_smile:

alex

ps : i also saw the cucumber/rspec output which is really professional
looking
http://robaldred.co.uk/wp-content/uploads/2009/08/cucumber_full.jpg
so i’ll definitely look into this once i’m more familiar with rspec and
unit testing in ruby in general.

On Aug 27, 2010, at 00:29 , Fourchette Fourchette wrote:

but sometimes paying clients like to “see” things so they continue to
believe that by paying you they’re dealing with the best. (obviously
it’s not true, i can barely evaluate the immensity of my own ignorance,
but what matters is what the guys paying think of us when they sign
checks)

I’d look at the Hudson continuous integration system instead. Very nice
UI with historical graphs of progress (# of tests, test results) over
time. Plus it is always nice to have it watching your back.