Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
remove ObjectSpace.each_object from test/unit
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  6 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Tanaka Akira  
View profile  
 More options Jun 6 2008, 1:37 am
From: Tanaka Akira <a...@fsij.org>
Date: Fri, 6 Jun 2008 14:37:44 +0900
Local: Fri, Jun 6 2008 1:37 am
Subject: [ruby-core:17126] remove ObjectSpace.each_object from test/unit
I wrote a patch to remove ObjectSpace.each_object from test/unit.

How about this?

Index: lib/test/unit/autorunner.rb
===================================================================
--- lib/test/unit/autorunner.rb (revision 16852)
+++ lib/test/unit/autorunner.rb (working copy)
@@ -14,8 +14,8 @@ module Test

       def self.standalone?
         return false unless("-e" == $0)
-        ObjectSpace.each_object(Class) do |klass|
-          return false if(klass < TestCase)
+        TestCase::DECENDANT_CLASSES.each do |klass|
+          return false
         end
         true
       end
Index: lib/test/unit/collector/dir.rb
===================================================================
--- lib/test/unit/collector/dir.rb      (revision 16852)
+++ lib/test/unit/collector/dir.rb      (working copy)
@@ -10,11 +10,11 @@ module Test
         attr_reader :pattern, :exclude
         attr_accessor :base

-        def initialize(dir=::Dir, file=::File, object_space=::ObjectSpace, req=nil)
+        def initialize(dir=::Dir, file=::File, object_space=nil, req=nil)
           super()
           @dir = dir
           @file = file
-          @object_space = object_space
+          # object_space is ignored.
           @req = req
           @pattern = []
           @exclude = []
@@ -43,8 +43,8 @@ module Test

         def find_test_cases(ignore=[])
           cases = []
-          @object_space.each_object(Class) do |c|
-            cases << c if(c < TestCase && !ignore.include?(c))
+          TestCase::DECENDANT_CLASSES.each do |c|
+            cases << c if !ignore.include?(c)
           end
           ignore.concat(cases)
           cases
Index: lib/test/unit/collector/objectspace.rb
===================================================================
--- lib/test/unit/collector/objectspace.rb      (revision 16852)
+++ lib/test/unit/collector/objectspace.rb      (working copy)
@@ -10,20 +10,17 @@ module Test
       class ObjectSpace
         include Test::Unit::Collector

-        NAME = 'collected from the ObjectSpace'
+        NAME = 'collected from the subclasses of TestSuite'

-        def initialize(source=::ObjectSpace)
+        def initialize
           super()
-          @source = source
         end

         def collect(name=NAME)
           suite = TestSuite.new(name)
           sub_suites = []
-          @source.each_object(Class) do |klass|
-            if(Test::Unit::TestCase > klass)
-              add_suite(sub_suites, klass.suite)
-            end
+          TestCase::DECENDANT_CLASSES.each do |klass|
+            add_suite(sub_suites, klass.suite)
           end
           sort(sub_suites).each{|s| suite << s}
           suite
Index: lib/test/unit/testcase.rb
===================================================================
--- lib/test/unit/testcase.rb   (revision 16852)
+++ lib/test/unit/testcase.rb   (working copy)
@@ -34,6 +34,11 @@ module Test
       PASSTHROUGH_EXCEPTIONS = [NoMemoryError, SignalException, Interrupt,
                                 SystemExit]

+      DECENDANT_CLASSES = []
+      def self.inherited(decendant)
+        DECENDANT_CLASSES << decendant
+      end
+
       # Creates a new instance of the fixture for running the
       # test represented by test_method_name.
       def initialize(test_method_name)
--
Tanaka Akira


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Berger, Daniel  
View profile  
 More options Jun 6 2008, 10:06 am
From: "Berger, Daniel" <Daniel.Ber...@qwest.com>
Date: Fri, 6 Jun 2008 23:06:08 +0900
Local: Fri, Jun 6 2008 10:06 am
Subject: [ruby-core:17128] Re: remove ObjectSpace.each_object from test/unit

> -----Original Message-----
> From: Tanaka Akira [mailto:a...@fsij.org]
> Sent: Thursday, June 05, 2008 11:38 PM
> To: ruby-c...@ruby-lang.org
> Subject: [ruby-core:17126] remove ObjectSpace.each_object
> from test/unit

> I wrote a patch to remove ObjectSpace.each_object from test/unit.

Why?

This communication is the property of Qwest and may contain confidential or
privileged information. Unauthorized use of this communication is strictly
prohibited and may be unlawful.  If you have received this communication
in error, please immediately notify the sender by reply e-mail and destroy
all copies of the communication and any attachments.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Nathan Weizenbaum  
View profile  
 More options Jun 6 2008, 12:17 pm
From: Nathan Weizenbaum <nex...@gmail.com>
Date: Sat, 7 Jun 2008 01:17:51 +0900
Local: Fri, Jun 6 2008 12:17 pm
Subject: [ruby-core:17130] Re: remove ObjectSpace.each_object from test/unit
Berger, Daniel wrote:
>> -----Original Message-----
>> From: Tanaka Akira [mailto:a...@fsij.org]
>> Sent: Thursday, June 05, 2008 11:38 PM
>> To: ruby-c...@ruby-lang.org
>> Subject: [ruby-core:17126] remove ObjectSpace.each_object
>> from test/unit

>> I wrote a patch to remove ObjectSpace.each_object from test/unit.

> Why?

I assume because using ObjectSpace imposes a significant performance
penalty in JRuby (and maybe other alternate implementations as well).

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Yukihiro Matsumoto  
View profile  
 More options Jun 6 2008, 12:20 pm
From: Yukihiro Matsumoto <m...@ruby-lang.org>
Date: Sat, 7 Jun 2008 01:20:43 +0900
Local: Fri, Jun 6 2008 12:20 pm
Subject: [ruby-core:17131] Re: remove ObjectSpace.each_object from test/unit
Hi,

In message "Re: [ruby-core:17126] remove ObjectSpace.each_object from test/unit"
    on Fri, 6 Jun 2008 14:37:44 +0900, Tanaka Akira <a...@fsij.org> writes:

|I wrote a patch to remove ObjectSpace.each_object from test/unit.
|
|How about this?

Can you commit?
                                                        matz.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Kurt Stephens  
View profile  
 More options Jun 7 2008, 5:16 am
From: Kurt Stephens <k...@kurtstephens.com>
Date: Sat, 7 Jun 2008 18:16:43 +0900
Local: Sat, Jun 7 2008 5:16 am
Subject: [ruby-core:17137] Re: remove ObjectSpace.each_object from test/unit

Yukihiro Matsumoto wrote:
> Hi,

> In message "Re: [ruby-core:17126] remove ObjectSpace.each_object from test/unit"
>     on Fri, 6 Jun 2008 14:37:44 +0900, Tanaka Akira <a...@fsij.org> writes:

> |I wrote a patch to remove ObjectSpace.each_object from test/unit.
> |

Can we remove ObjectSpace iteration from Ruby completely?  It prevents using other GC
techniques and implementations.  An efficient set of weak collections would be
more generic and provide a mechanism for building global collections.

Kurt Stephens
http://kurtstephens.com/


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tanaka Akira  
View profile  
 More options Jun 7 2008, 5:27 am
From: Tanaka Akira <a...@fsij.org>
Date: Sat, 7 Jun 2008 18:27:37 +0900
Local: Sat, Jun 7 2008 5:27 am
Subject: [ruby-core:17138] Re: remove ObjectSpace.each_object from test/unit
In article <484A5243....@kurtstephens.com>,
  Kurt Stephens <k...@kurtstephens.com> writes:

> Can we remove ObjectSpace iteration from Ruby completely?  It prevents using other GC
> techniques and implementations.  An efficient set of weak collections would be
> more generic and provide a mechanism for building global collections.

What the GC techniques?
--
Tanaka Akira

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google