From: Bil Kleb Date: 2002-03-17T13:18:37+09:00 Subject: Rubicon -> Test::Unit Are there plans a foot for Rubicon to use Test::Unit? I ask because we currently use Rubicon's BulkTestRunner to summarize our RubyUnit test results via #!/usr/bin/env ruby $:.push(File.join($:[0],"rubicon")) require 'rubicon' tests = Rubicon::BulkTestRunner.new([],"Built-ins") Dir["*UT.rb"].each {|ut| tests.addFile(ut)} tests.run after placing Rubicon in lib/ruby/site_ruby/1.6/ and hacking it's relative path loop, viz, 105,106c105,106 < for relative_path in [ ".", ".." ] < util = File.join(run_dir, relative_path, "util") --- > for relative_path in [ run_dir, File.join(run_dir, ".."), *$: ] > util = File.join(relative_path, "util") So IntegrationTest.rb produces something like the following when run in our directory full of source/tests: [..] BoundaryProfileUT: ...... Time: 0.012816 OK (6/6 tests 28 asserts) ======================================================================== Built-ins Test Results V0.3.5 ======================================================================== Name OK? Tests Asserts Failures Errors ------------------------------------------------------------ Array2DUT 3 6 BoundaryProfileUT 6 28 CartesianFaceUT 2 8 [..] . . LineFitUT 1 2 VectorUT 6 7 ======================================================================== All 16 files 74 209 0 0 ======================================================================== Note: each TestSuite still has to use the old-syle RubyUnit format, otherwise all the tests are executed twice, e.g., require 'runit/testcase' require 'LineFit' class LineFitUT < RUNIT::TestCase def testSlope array = [[0,0], [0.5,0.5], [1,1]] assert_equal(1, LineFit.leastSquaresSlope(array)) array = [[0,0], [0.5,0.5], [1,0]] assert_equal(0, LineFit.leastSquaresSlope(array)) end end if $0 == __FILE__ then require 'runit/cui/testrunner' RUNIT::CUI::TestRunner.run(LineFitUT.suite) end -- Bil Kleb NASA Langley Research Center Hampton, Virginia, USA