List Info

Thread: Strange bug with common.mk, File, Test::Unit




Strange bug with common.mk, File, Test::Unit
country flaguser name
United States
2008-05-14 23:28:31
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/collec
tor/dir.rb:90:in 
`require': no such file to load -- . (LoadError)
         from 
/Users/djberge/src/ruby/ruby-1.8.6-p114/lib/test/unit/collec
tor/dir.rb:90:in 
`collect_file'
         from 
/Users/djberge/src/ruby/ruby-1.8.6-p114/lib/test/unit/collec
tor/dir.rb:77:in 
`recursive_collect'
         from 
/Users/djberge/src/ruby/ruby-1.8.6-p114/lib/test/unit/collec
tor/dir.rb:29:in 
`collect'
         from 
/Users/djberge/src/ruby/ruby-1.8.6-p114/lib/test/unit/autoru
nner.rb:68
         from 
/Users/djberge/src/ruby/ruby-1.8.6-p114/lib/test/unit/autoru
nner.rb:213:in 
`[]'
         from 
/Users/djberge/src/ruby/ruby-1.8.6-p114/lib/test/unit/autoru
nner.rb:213:in 
`run'
         from 
/Users/djberge/src/ruby/ruby-1.8.6-p114/lib/test/unit/autoru
nner.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


Re: Strange bug with common.mk, File, Test::Unit
country flaguser name
Japan
2008-05-15 02:54:47
Hi,

At Thu, 15 May 2008 13:28:31 +0900,
Daniel Berger wrote in [ruby-core:16777]:
> 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.

Really?  I get the error like your test-file, with

$ make TESTSDIR='$(srcdir)/test/core/Array' test-all

> What the heck is going on here? Some sort of strange
scoping bug with 
> regards to "File"? I can't narrow it down.

it rather seems a problem that test-arry works.

-- 
Nobu Nakada


[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )