15 May 06:24
Strange bug with common.mk, File, Test::Unit
From: Daniel Berger <djberg96 <at> gmail.com>
Subject: Strange bug with common.mk, File, Test::Unit
Newsgroups: gmane.comp.lang.ruby.core
Date: 2008-05-15 04:28:31 GMT
Subject: Strange bug with common.mk, File, Test::Unit
Newsgroups: gmane.comp.lang.ruby.core
Date: 2008-05-15 04:28:31 GMT
Hi all,
Ruby 1.8.6-p114
OS X, Solaris, Windows XP and Linux
I added a couple of test tasks in the common.mk file so that I could
test specific subsets of test files. Below are just two that I added.
daniel-bergers-computer:~/src/ruby/ruby-1.8.6-p114 djberge$ diff -u
common.orig common.mk
--- common.orig 2007-02-28 06:23:42.000000000 -0700
+++ common.mk 2008-05-14 22:09:14.000000000 -0600
@@ -66,6 +66,8 @@
$(LIBRUBY_EXTS) $(LIBRUBY_SO_UPDATE)
TESTSDIR = $(srcdir)/test
+TESTSDIR_ARRAY = $(srcdir)/test/core/Array
+TESTSDIR_FILE = $(srcdir)/test/core/File
TESTWORKDIR = testwork
all: $(MKFILES) $(PREP) $(RBCONFIG) $(LIBRUBY)
@@ -286,6 +288,12 @@
test-all:
$(RUNRUBY) "$(srcdir)/test/runner.rb" --basedir="$(TESTSDIR)"
--runner=$(TESTUI) $(TESTS)
+test-array:
+ $(RUNRUBY) "$(srcdir)/test/runner.rb"
--basedir="$(TESTSDIR_ARRAY)" --runner=$(TESTUI) $(TESTS)
+
+test-file:
+ $(RUNRUBY) "$(srcdir)/test/runner.rb"
--basedir="$(TESTSDIR_FILE)" --runner=$(TESTUI) $(TESTS)
+
extconf:
$(MINIRUBY) -I$(srcdir)/lib -run -e mkdir -- -p "$(EXTCONFDIR)"
$(RUNRUBY) -C "$(EXTCONFDIR)" $(EXTCONF) $(EXTCONFARGS)
Nevermind that 'test/core/Array' doesn't exist. That's not the problem.
After running configure & make, I get the following with 'make test-array':
daniel-bergers-computer:~/src/ruby/ruby-1.8.6-p114 djberge$ make test-array
./miniruby ./runruby.rb --extout=.ext -- "./test/runner.rb"
--basedir="./test/core/Array" --runner=console
Loaded suite .
Started
Finished in 0.000144 seconds.
0 tests, 0 assertions, 0 failures, 0 errors
Ok, no problem, the directory doesn't exist, so no tests run.
Now try make test-file:
daniel-bergers-computer:~/src/ruby/ruby-1.8.6-p114 djberge$ make test-file
./miniruby ./runruby.rb --extout=.ext -- "./test/runner.rb"
--basedir="./test/core/File" --runner=console
/Users/djberge/src/ruby/ruby-1.8.6-p114/lib/test/unit/collector/dir.rb:90:in
`require': no such file to load -- . (LoadError)
from
/Users/djberge/src/ruby/ruby-1.8.6-p114/lib/test/unit/collector/dir.rb:90:in
`collect_file'
from
/Users/djberge/src/ruby/ruby-1.8.6-p114/lib/test/unit/collector/dir.rb:77:in
`recursive_collect'
from
/Users/djberge/src/ruby/ruby-1.8.6-p114/lib/test/unit/collector/dir.rb:29:in
`collect'
from
/Users/djberge/src/ruby/ruby-1.8.6-p114/lib/test/unit/autorunner.rb:68
from
/Users/djberge/src/ruby/ruby-1.8.6-p114/lib/test/unit/autorunner.rb:213:in
`[]'
from
/Users/djberge/src/ruby/ruby-1.8.6-p114/lib/test/unit/autorunner.rb:213:in
`run'
from
/Users/djberge/src/ruby/ruby-1.8.6-p114/lib/test/unit/autorunner.rb:12:in
`run'
from ./test/runner.rb:7
make: *** [test-file] Error 1
What the heck is going on here? Some sort of strange scoping bug with
regards to "File"? I can't narrow it down.
To make things even more confusing, this only happens on Linux and OS X,
but not Windows or Solaris.
Any ideas?
Thanks,
Dan
RSS Feed