Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I tried a combination of <code>TestSuite</code> and <code>Thread</code>:</p> <pre><code>gem 'test-unit' require 'test/unit' require 'test/unit/ui/console/testrunner' # we're running the tests, so we don't want Test::Unit to automatically run everything for us. See http://www.natontesting.com/2009/07/21/stop-rubys-testunit-suite-files-running-all-your-tests/ Test::Unit.run = true class MyTest &lt; Test::Unit::TestCase def test_1() assert_equal( 2, 1+1) end def test_2() assert_equal( 2, 4/2) end def test_3() assert_equal( 1, 3/2) end def test_4() assert_equal( 1.5, 3/2.0) end end #create TestSuites. test_1 = Test::Unit::TestSuite.new("Test 1") test_1 &lt;&lt; MyTest.new('test_1') #Same a bit shorter test_2 = Test::Unit::TestSuite.new("Test 2") &lt;&lt; MyTest.new('test_2') test_3 = Test::Unit::TestSuite.new("Test 3") &lt;&lt; MyTest.new('test_3') test_4 = Test::Unit::TestSuite.new("Test 4") &lt;&lt; MyTest.new('test_4') #run the suites Thread.new{Test::Unit::UI::Console::TestRunner.run(test_1)} Thread.new{Test::Unit::UI::Console::TestRunner.run(test_2)} Thread.new{Test::Unit::UI::Console::TestRunner.run(test_3)} Thread.new{Test::Unit::UI::Console::TestRunner.run(test_4)} </code></pre> <p>It looks good, but I made no benchmark tests.</p> <p>The output (see below) is a bit chaotic, each thread is posting his messages into the message of other threads, but it seem to work correct. So maybe you must catch the output of each thread to get better test logs.</p> <pre><code>Loaded suite Test 4Loaded suite Test 1Loaded suite Test 2Loaded suite Test 3 Started Started . Started . Started . . Finished in 0.328125 seconds. Finished in 0.328125 seconds. 1 tests, 1 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications Finished in 0.765625 seconds. Finished in 0.546875 seconds. 100% passed 1 tests, 1 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications 3.05 tests/s, 3.05 assertions/s 100% passed 1 tests, 1 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications 1 tests, 1 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications 3.05 tests/s, 3.05 assertions/s 100% passed 100% passed </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload