diff options
author | ntalbott <ntalbott@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-02-17 04:50:49 +0000 |
---|---|---|
committer | ntalbott <ntalbott@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-02-17 04:50:49 +0000 |
commit | f2d29b01cb8d47b9689af62ec4d67059277580d9 (patch) | |
tree | d44099bb6e6c1dc0cbb438e7f1f542e37860ae86 /lib/test/unit/autorunner.rb | |
parent | 966332ebed8ae32009e7f54ffcfe6bbaada8080a (diff) |
* lib/test/unit/collector.rb (collect_file): now deletes paths added
to $LOAD_PATH instead of restoring it verbatim.
* lib/test/unit/autorunner.rb (AutoRunner.run): fixed so that
'ruby -rtest/unit -rtest1 -rtest2 -e0' will use the objectspace
collector again. Also tried to simplify the calling convention.
* test/runner.rb: adjusted for new AutoRunner semantics.
* lib/test/unit.rb: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7990 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/test/unit/autorunner.rb')
-rw-r--r-- | lib/test/unit/autorunner.rb | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/lib/test/unit/autorunner.rb b/lib/test/unit/autorunner.rb index 38b0b76ef3..2831293b7c 100644 --- a/lib/test/unit/autorunner.rb +++ b/lib/test/unit/autorunner.rb @@ -5,14 +5,20 @@ require 'optparse' module Test module Unit class AutoRunner - def self.run(current_file=nil, default_dir=nil, argv=ARGV, &block) - if(!current_file || current_file == $0) - r = new(!current_file, &block) - if !r.process_args(argv) && default_dir - r.to_run << default_dir - end - r.run + def self.run(force_standalone=false, default_dir=nil, argv=ARGV, &block) + r = new(force_standalone || standalone?, &block) + if((!r.process_args(argv)) && default_dir) + r.to_run << default_dir + end + r.run + end + + def self.standalone? + return false unless("-e" == $0) + ObjectSpace.each_object(Class) do |klass| + return false if(klass < TestCase) end + true end RUNNERS = { |