[#5219] Segmentation fault in timeout.rb — Michel Pastor <K@...>

Hi,

18 messages 2005/06/16
[#5220] Re: Segmentation fault in timeout.rb — Eric Hodel <drbrain@...7.net> 2005/06/16

[#5221] Re: Segmentation fault in timeout.rb — Michel Pastor <K@...> 2005/06/16

On Fri, 17 Jun 2005 05:03:18 +0900

[#5223] Re: Segmentation fault in timeout.rb — nobu.nokada@... 2005/06/17

Hi,

[#5296] Subversion — Shugo Maeda <shugo@...>

Hi,

64 messages 2005/06/30
[#5297] Re: Subversion — Curt Hibbs <curt@...> 2005/06/30

Shugo Maeda wrote:

[#5298] Re: Subversion — Nikolai Weibull <mailing-lists.ruby-core@...> 2005/06/30

Curt Hibbs wrote:

[#5301] Re: Subversion — Austin Ziegler <halostatue@...> 2005/06/30

On 6/30/05, Nikolai Weibull

[#5304] Re: Subversion — Nikolai Weibull <mailing-lists.ruby-core@...> 2005/06/30

Austin Ziegler wrote:

[#5305] Re: Subversion — Austin Ziegler <halostatue@...> 2005/06/30

On 6/30/05, Nikolai Weibull

[#5307] Re: Subversion — mathew <meta@...> 2005/06/30

Austin Ziegler wrote:

[#5308] Re: Subversion — Austin Ziegler <halostatue@...> 2005/06/30

On 6/30/05, mathew <meta@pobox.com> wrote:

[#5311] Re: Subversion — mathew <meta@...> 2005/07/01

Austin Ziegler wrote:

[#5323] Re: Subversion — Austin Ziegler <halostatue@...> 2005/07/01

On 7/1/05, mathew <meta@pobox.com> wrote:

[#5325] Re: Subversion — Nikolai Weibull <mailing-lists.ruby-core@...> 2005/07/01

Austin Ziegler wrote:

[PATCH] test case directory

From: nobu.nokada@...
Date: 2005-06-10 15:37:38 UTC
List: ruby-core #5197
Hi,

I'd like to separate working directory from test cases.  What
about this patch?


* common.mk (test-all): separate test case directory from pwd.

* lib/test/unit/autorunner.rb (options): added --basedir, --workdir
  and --load-path options.

* lib/test/unit/collector/dir.rb (recursive_collect, collect_file):
  base directory support.


Index: common.mk
===================================================================
RCS file: /cvs/ruby/src/ruby/common.mk,v
retrieving revision 1.15
diff -U2 -p -r1.15 common.mk
--- common.mk	20 Apr 2005 14:22:57 -0000	1.15
+++ common.mk	10 Jun 2005 14:25:06 -0000
@@ -63,4 +63,7 @@ SCRIPT_ARGS   =	--dest-dir="$(DESTDIR)" 
 EXTMK_ARGS    =	$(SCRIPT_ARGS) --extout="$(EXTOUT)" --extension $(EXTS) --extstatic $(EXTSTATIC) --
 
+TESTSDIR      = $(srcdir)/test
+TESTWORKDIR   = testwork
+
 all: $(MKFILES) $(PREP) $(RBCONFIG) $(LIBRUBY)
 	@$(MINIRUBY) $(srcdir)/ext/extmk.rb $(EXTMK_ARGS)
@@ -149,5 +152,5 @@ test: miniruby$(EXEEXT) $(RBCONFIG) $(PR
 
 test-all:
-	$(RUNRUBY) -C "$(srcdir)/test" runner.rb --runner=$(TESTUI) $(TESTS)
+	$(RUNRUBY) "$(srcdir)/test/runner.rb" --basedir="$(TESTSDIR)" --runner=$(TESTUI) $(TESTS)
 
 extconf:
Index: lib/test/unit/autorunner.rb
===================================================================
RCS file: /cvs/ruby/src/ruby/lib/test/unit/autorunner.rb,v
retrieving revision 1.12
diff -U2 -p -r1.12 autorunner.rb
--- lib/test/unit/autorunner.rb	17 Feb 2005 04:50:48 -0000	1.12
+++ lib/test/unit/autorunner.rb	10 Jun 2005 15:08:37 -0000
@@ -65,9 +65,11 @@ module Test
           c.pattern.concat(r.pattern) if(r.pattern)
           c.exclude.concat(r.exclude) if(r.exclude)
+          c.base = r.base
+          $:.unshift(r.base) if r.base
           c.collect(*(r.to_run.empty? ? ['.'] : r.to_run))
         end,
       }
 
-      attr_reader :suite
+      attr_reader :suite, :base, :workdir
       attr_accessor :output_level, :filters, :to_run, :pattern, :exclude
       attr_writer :runner, :collector
@@ -111,4 +113,12 @@ module Test
 
           if(@standalone)
+            o.on('-b', '--basedir=DIR', "Base directory of test suits.") do |b|
+              @base = b
+            end
+
+            o.on('-w', '--workdir=DIR', "Working directory to run tests.") do |w|
+              @workdir = w
+            end
+
             o.on('-a', '--add=TORUN', Array,
                  "Add TORUN to the list of things to run;",
@@ -154,4 +164,9 @@ module Test
           end
 
+          o.on('-I', "--load-path=DIR[#{File::PATH_SEPARATOR}DIR...]",
+               "Appends directory list to $LOAD_PATH.") do |dirs|
+            $LOAD_PATH.concat(dirs.split(File::PATH_SEPARATOR))
+          end
+
           o.on('-v', '--verbose=[LEVEL]', OUTPUT_LEVELS,
                "Set the output level (default is verbose).",
@@ -198,4 +213,5 @@ module Test
         @suite = @collector[self]
         result = @runner[self] or return false
+        Dir.chdir(@workdir) if @workdir
         result.run(@suite, @output_level).passed?
       end
Index: lib/test/unit/collector/dir.rb
===================================================================
RCS file: /cvs/ruby/src/ruby/lib/test/unit/collector/dir.rb,v
retrieving revision 1.12
diff -U2 -p -r1.12 dir.rb
--- lib/test/unit/collector/dir.rb	17 Feb 2005 04:50:48 -0000	1.12
+++ lib/test/unit/collector/dir.rb	10 Jun 2005 15:07:36 -0000
@@ -9,4 +9,5 @@ module Test
 
         attr_reader :pattern, :exclude
+        attr_accessor :base
 
         def initialize(dir=::Dir, file=::File, object_space=::ObjectSpace, req=nil)
@@ -48,9 +49,10 @@ module Test
         def recursive_collect(name, already_gathered)
           sub_suites = []
-          if(@file.directory?(name))
-            @dir.entries(name).each do |e|
+          path = @base ? @file.join(@base, name) : name
+          if @file.directory?(path)
+            @dir.entries(path).each do |e|
               next if(e == '.' || e == '..')
               e_name = @file.join(name, e)
-              if(@file.directory?(e_name))
+              if @file.directory?(@base ? @file.join(@base, e_name) : e_name)
                 next if /\ACVS\z/ =~ e
                 sub_suite = recursive_collect(e_name, already_gathered)
@@ -76,5 +78,5 @@ module Test
 
         def collect_file(name, suites, already_gathered)
-          dir = File.dirname(File.expand_path(name))
+          dir = File.dirname(File.expand_path(name, @base))
           $:.unshift(dir)
           if(@req)


-- 
Nobu Nakada

In This Thread

Prev Next