[#1884] multiple exceptions for assert_raises — nobu.nokada@...

Hi,

14 messages 2003/12/04

[#1932] --enable-pthread broken? — Nathaniel Talbott <nathaniel@...>

[ruby-talk: 87759] and the surrounding thread seem to indicate that

29 messages 2003/12/11
[#1933] Re: --enable-pthread broken? — matz@... (Yukihiro Matsumoto) 2003/12/11

Hi,

[#1934] Re: --enable-pthread broken? — Nathaniel Talbott <nathaniel@...> 2003/12/11

On Dec 11, 2003, at 11:49, Yukihiro Matsumoto wrote:

[#1935] Re: --enable-pthread broken? — ts <decoux@...> 2003/12/11

>>>>> "N" == Nathaniel Talbott <nathaniel@talbott.ws> writes:

[#1937] Re: --enable-pthread broken? — nobu.nokada@... 2003/12/11

Hi,

[#1938] Re: --enable-pthread broken? — Nathaniel Talbott <nathaniel@...> 2003/12/12

On Dec 11, 2003, at 16:10, nobu.nokada@softhome.net wrote:

[#1939] Re: --enable-pthread broken? — matz@... (Yukihiro Matsumoto) 2003/12/12

Hi,

[#1941] Re: --enable-pthread broken? — matz@... (Yukihiro Matsumoto) 2003/12/12

Hi,

[#1943] Re: --enable-pthread broken? — Nathaniel Talbott <nathaniel@...> 2003/12/12

On Dec 11, 2003, at 20:48, Yukihiro Matsumoto wrote:

[#1953] Re: --enable-pthread broken? — matz@... (Yukihiro Matsumoto) 2003/12/13

Hi,

[#1959] Re: --enable-pthread broken? — ts <decoux@...> 2003/12/14

>>>>> "Y" == Yukihiro Matsumoto <matz@ruby-lang.org> writes:

[#1961] Re: --enable-pthread broken? — matz@... (Yukihiro Matsumoto) 2003/12/15

Hi,

[#1962] Re: --enable-pthread broken? — ts <decoux@...> 2003/12/15

>>>>> "Y" == Yukihiro Matsumoto <matz@ruby-lang.org> writes:

[#1936] Can't define +@ for Symbol (plus ruby install problem) — "T. Onoma" <transami@...>

I wanted to see if the +@ problem was fixed in 1.8.1 preview 3 but when I do

11 messages 2003/12/11

[#1973] Where to install documentation — Dave Thomas <dave@...>

Folks:

48 messages 2003/12/15
[#1982] Re: Where to install documentation — Eric Hodel <drbrain@...7.net> 2003/12/15

Dave Thomas (dave@pragprog.com) wrote:

[#1984] Re: Where to install documentation — Dave Thomas <dave@...> 2003/12/15

[#1991] Re: Where to install documentation — "Gavin Sinclair" <gsinclair@...> 2003/12/16

>

[#1992] Re: Where to install documentation — Dave Thomas <dave@...> 2003/12/16

[#2000] Re: Where to install documentation — Minero Aoki <aamine@...> 2003/12/16

Hi,

[#2002] Re: Where to install documentation — Dave Thomas <dave@...> 2003/12/16

[#2037] --enable-pthread still segfaults... — Nathaniel Talbott <nathaniel@...>

I've finally been able to test my application under load using the

25 messages 2003/12/23
[#2038] Re: --enable-pthread still segfaults... — matz@... (Yukihiro Matsumoto) 2003/12/23

Hi,

[#2039] Re: --enable-pthread still segfaults... — Nathaniel Talbott <nathaniel@...> 2003/12/23

On Dec 23, 2003, at 14:17, Yukihiro Matsumoto wrote:

[#2040] Re: --enable-pthread still segfaults... — matz@... (Yukihiro Matsumoto) 2003/12/23

Hi,

[#2041] Re: --enable-pthread still segfaults... — Nathaniel Talbott <nathaniel@...> 2003/12/23

On Dec 23, 2003, at 14:34, Yukihiro Matsumoto wrote:

[#2042] Re: --enable-pthread still segfaults... — matz@... (Yukihiro Matsumoto) 2003/12/23

Hi,

[#2043] Re: --enable-pthread still segfaults... — Nathaniel Talbott <nathaniel@...> 2003/12/23

On Dec 23, 2003, at 14:44, Yukihiro Matsumoto wrote:

[#2045] Re: --enable-pthread still segfaults... — matz@... (Yukihiro Matsumoto) 2003/12/23

Hi,

[#2046] Re: --enable-pthread still segfaults... — Nathaniel Talbott <nathaniel@...> 2003/12/23

> I'm afraid you're using old configure file. Can you wipe off old

[#2049] Re: --enable-pthread still segfaults... — Nathaniel Talbott <nathaniel@...> 2003/12/23

On Dec 23, 2003, at 15:18, Nathaniel Talbott wrote:

[#2050] Re: --enable-pthread still segfaults... — matz@... (Yukihiro Matsumoto) 2003/12/23

In message "Re: --enable-pthread still segfaults..."

[#2122] Bad interaction between timeout.rb and --enable-pthread — Nathaniel Talbott <nathaniel@...>

Here's a testcase that shows the problem:

13 messages 2003/12/31
[#2123] sleep is broken with --enable-pthread [Was: Bad interaction between timeout.rb and --enable-pthread] — Nathaniel Talbott <nathaniel@...> 2003/12/31

I should have reduced it more before posting...

Re: [PATCH] exit inside test/unit

From: nobu.nokada@...
Date: 2003-12-02 03:34:40 UTC
List: ruby-core #1863
Hi,

At Tue, 2 Dec 2003 01:57:35 +0900,
Nathaniel Talbott wrote:
> I propose the following:
> 
> - The exit value is set when test/unit is run from at_exit (should be a 
> small fix).

This would be necessary, though I missed.

> - Move runner.rb to bin, name it 'testunit' ('test' would be good, but 
> it seems too likely to have a name clash), and make it executable, so 
> that it can be used by anyone wanting to run a set of tests.

As Ryan has mentioned, I also feel 'testunit' is inappropriate.

A new patch; the runner is named as 'trb' tentatively.


Index: bin/trb
===================================================================
RCS file: bin/trb
diff -N bin/trb
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ bin/trb	2 Dec 2003 02:32:55 -0000
@@ -0,0 +1,5 @@
+#!/usr/bin/env ruby
+require 'test/unit'
+(r = Test::Unit::AutoRunner.new(true)).process_args(ARGV) or
+  abort r.options.banner + " tests..."
+exit r.run
Index: lib/test/unit.rb
===================================================================
RCS file: /cvs/ruby/src/ruby/lib/test/unit.rb,v
retrieving revision 1.6
diff -u -2 -p -d -w -r1.6 unit.rb
--- lib/test/unit.rb	18 Nov 2003 23:00:29 -0000	1.6
+++ lib/test/unit.rb	2 Dec 2003 01:49:00 -0000
@@ -273,3 +273,3 @@ module Test
 end
 
-at_exit{Test::Unit::AutoRunner.run($0) unless($! || Test::Unit.run?)}
+at_exit {exit(Test::Unit::AutoRunner.run($0)) unless($! || Test::Unit.run?)}
Index: lib/test/unit/autorunner.rb
===================================================================
RCS file: /cvs/ruby/src/ruby/lib/test/unit/autorunner.rb,v
retrieving revision 1.5
diff -u -2 -p -d -w -r1.5 autorunner.rb
--- lib/test/unit/autorunner.rb	17 Nov 2003 00:41:40 -0000	1.5
+++ lib/test/unit/autorunner.rb	2 Dec 2003 02:43:56 -0000
@@ -6,9 +6,9 @@ module Test
   module Unit
     class AutoRunner
-      def self.run(current_file=nil, default_dir=nil, &block)
+      def self.run(current_file=nil, default_dir=nil, argv=ARGV, &block)
         if(!current_file || current_file == $0)
           r = new(!current_file, &block)
-          if(default_dir && r.to_run.empty?)
-            r.to_run = default_dir
+          if !r.process_args(argv) && default_dir
+            r.to_run << default_dir
           end
           r.run
@@ -18,7 +18,5 @@ module Test
       RUNNERS = {
         :console => proc do |r|
-          output_level = r.output_level || Test::Unit::UI::Console::TestRunner::NORMAL
-          passed = Test::Unit::UI::Console::TestRunner.run(r.suite, output_level).passed?
-          exit(passed ? 0 : 1)
+          Test::Unit::UI::Console::TestRunner.run(r.suite, r.output_level)
         end,
         :gtk => proc do |r|
@@ -74,14 +72,26 @@ module Test
         @filters = []
         @to_run = []
-        process_args
+        @output_level = Test::Unit::UI::Console::TestRunner::NORMAL
         yield(self) if(block_given?)
       end
 
-      def process_args
-        catch(:stop_processing) do
-          ARGV.options do |o|
-            o.program_name = "test/unit.rb"
+      def process_args(args = ARGV)
+        begin
+          @to_run.concat options.parse!(args)
+        rescue OptionParser::ParseError => e
+          puts e
+          puts options
+          $! = nil
+          abort
+        else
+          @filters << proc{false} unless(@filters.empty?)
+        end
+        not @to_run.empty?
+      end
+
+      def options
+        @options ||= OptionParser.new do |o|
             o.banner = "Test::Unit automatic runner."
-            o.banner = "#{$0} [options] [-- untouched arguments]"
+          o.banner << "\nUsage: #{$0} [options] [-- untouched arguments]"
 
             o.on
@@ -138,7 +148,7 @@ module Test
               "Stop processing options so that the",
               "remaining options will be passed to the",
-              "test."){throw :stop_processing}
+               "test."){o.terminate}
 
-            o.on('-h', '--help', 'Display this help.'){puts o; exit(0)}
+          o.on('-h', '--help', 'Display this help.'){puts o; exit}
 
             o.on_tail
@@ -161,16 +171,6 @@ module Test
             
             o.on_tail
-
-            begin
-              o.parse!
-            rescue OptionParser::ParseError => e
-              puts e
-              puts o
-              exit(1)
             end
           end
-        end
-        @filters << proc{false} unless(@filters.empty?)
-      end
 
       def keyword_display(array)
@@ -180,5 +180,6 @@ module Test
       def run
         @suite = @collector[self]
-        @runner[self]
+        result = @runner[self] or return false
+        result.passed?
       end
     end
Index: lib/test/unit/ui/fox/testrunner.rb
===================================================================
RCS file: /cvs/ruby/src/ruby/lib/test/unit/ui/fox/testrunner.rb,v
retrieving revision 1.1.1.2
diff -u -2 -p -d -w -r1.1.1.2 testrunner.rb
--- lib/test/unit/ui/fox/testrunner.rb	12 Feb 2003 04:22:34 -0000	1.1.1.2
+++ lib/test/unit/ui/fox/testrunner.rb	1 Dec 2003 23:53:26 -0000
@@ -42,4 +42,5 @@ module Test
             end
 
+            @result = nil
             @red = false
           end
@@ -51,4 +52,5 @@ module Test
             attach_to_mediator
             start_ui
+            @result
           end
 
@@ -133,4 +135,5 @@ module Test
           
           def started(result) # :nodoc:
+            @result = result
             output_status("Started...")
           end
Index: lib/test/unit/ui/gtk/testrunner.rb
===================================================================
RCS file: /cvs/ruby/src/ruby/lib/test/unit/ui/gtk/testrunner.rb,v
retrieving revision 1.5
diff -u -2 -p -d -w -r1.5 testrunner.rb
--- lib/test/unit/ui/gtk/testrunner.rb	27 Nov 2003 15:34:53 -0000	1.5
+++ lib/test/unit/ui/gtk/testrunner.rb	1 Dec 2003 23:51:58 -0000
@@ -34,4 +34,5 @@ module Test
               @suite = suite
             end
+            @result = nil
 
             @runner = Thread.current
@@ -50,4 +51,5 @@ module Test
             attach_to_mediator
             start_ui
+            @result
           end
 
@@ -95,5 +97,4 @@ module Test
             rescue
             end
-            exit !@red
           end
           
@@ -146,4 +147,5 @@ module Test
           
           def started(result) # :nodoc:
+            @result = result
             output_status("Started...")
           end
Index: lib/test/unit/ui/gtk2/testrunner.rb
===================================================================
RCS file: /cvs/ruby/src/ruby/lib/test/unit/ui/gtk2/testrunner.rb,v
retrieving revision 1.2
diff -u -2 -p -d -w -r1.2 testrunner.rb
--- lib/test/unit/ui/gtk2/testrunner.rb	27 Nov 2003 15:34:53 -0000	1.2
+++ lib/test/unit/ui/gtk2/testrunner.rb	2 Dec 2003 02:37:37 -0000
@@ -323,4 +323,5 @@ module Test
 
           def started(result) # :nodoc:
+            @result = result
             output_status("Started...")
           end # def started(result)
@@ -406,6 +407,6 @@ module Test
               retry
             rescue
+              puts $!, $@
             end
-            exit !@red
           end # def start_ui
           private :start_ui
@@ -438,4 +439,5 @@ module Test
             attach_to_mediator
             start_ui
+            @result
           end # def start
 
@@ -446,4 +448,5 @@ module Test
               @suite = suite
             end
+            @result = nil
 
             @runner = Thread.current
Index: lib/test/unit/ui/tk/testrunner.rb
===================================================================
RCS file: /cvs/ruby/src/ruby/lib/test/unit/ui/tk/testrunner.rb,v
retrieving revision 1.5
diff -u -2 -p -d -w -r1.5 testrunner.rb
--- lib/test/unit/ui/tk/testrunner.rb	27 Nov 2003 15:34:53 -0000	1.5
+++ lib/test/unit/ui/tk/testrunner.rb	1 Dec 2003 23:55:11 -0000
@@ -35,4 +35,5 @@ module Test
               @suite = suite
             end
+            @result = nil
 
             @red = false
@@ -53,4 +54,5 @@ module Test
             attach_to_mediator
             start_ui
+            @result
           end
 
@@ -103,5 +105,4 @@ module Test
             rescue
             end
-            exit !@red
           end
 
@@ -113,5 +114,5 @@ module Test
             @test_total_count = count.to_f
             @test_progress_bar.configure('background'=>'green')
-            @test_progress_bar.place('relwidth'=>0/count)
+            @test_progress_bar.place('relwidth'=>(count.zero? ? 0 : 0/count))
             @red = false
 
@@ -156,4 +157,5 @@ module Test
 
           def started(result) # :nodoc:
+            @result = result
             output_status("Started...")
           end
Index: test/runner.rb
===================================================================
RCS file: /cvs/ruby/src/ruby/test/runner.rb,v
retrieving revision 1.10
diff -u -2 -p -d -w -r1.10 runner.rb
--- test/runner.rb	13 Oct 2003 14:57:36 -0000	1.10
+++ test/runner.rb	1 Dec 2003 14:12:32 -0000
@@ -5,6 +5,3 @@ Version = rcsid[2].scan(/\d+/).collect!(
 Release = rcsid[3].freeze
 
-runner = Test::Unit::AutoRunner.new(true)
-runner.to_run.concat(ARGV)
-runner.to_run << File.dirname(__FILE__) if runner.to_run.empty?
-runner.run
+exit Test::Unit::AutoRunner.run(false, File.dirname($0))


-- 
Nobu Nakada

In This Thread