[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: unusual rake behaviour

Dave Halliday

12/30/2004 1:55:00 AM

I checked CVS. There is a recent (Dec. 19) change made by Nobu to
test/unit.rb that was part of the 1.8.2 release.

The code for auto-running the tests was changed from:

Test::Unit::AutoRunner.run($0)

to:

Test::Unit::AutoRunner.run($0 != "-e" && $0)

Reverting this change will get Rake::TestTask working again, but I'm
not sure what else will break as a consequence. The change was likely
trying to fix some other problem. The CVS checkin comment doesn't say
why it was changed.

Cheers,

Dave


On Dec 29, 2004, at 4:28 PM, Jim Weirich wrote:

>
> Jim Weirich said:
>
> Someone just informed me that in 1.8.2 test/unit does not work with the
> ruby -e0 -rtestfile technique that Rake is using to load the unit
> tests.
> I haven't been able to verify this. I'm not running 1.8.2 yet, so I am
> not able to validate this.
>
> Nathaniel ... is this intentional? What's the story?
>
> --
> -- Jim Weirich jim@weirichhouse.org http://onest...
> -----------------------------------------------------------------
> "Beware of bugs in the above code; I have only proved it correct,
> not tried it." -- Donald Knuth (in a memo to Peter van Emde Boas)
>
>



3 Answers

Dave Halliday

12/30/2004 4:10:00 AM

0

Here's a patch for Rake that provides a workaround for the 1.8.2
Test::Unit behavior. The patch is based on rake/testtask.rb from Rake
0.4.13.

81a82
> name_hack = "$0=\"#{@name}\""
83c84
< ruby %{-I#{lib_path} -e0
#{SEP}#{required_files}#{option_list}}
---
> ruby %{-I#{lib_path} -e'#{name_hack}'
#{SEP}#{required_files}#{option_list}}

It overrides $0 with the name of the Rake test target, so that
Test::Unit never sees the '-e' that was causing problems.

Cheers,

Dave

On Dec 29, 2004, at 8:55 PM, Dave Halliday wrote:

> I checked CVS. There is a recent (Dec. 19) change made by Nobu to
> test/unit.rb that was part of the 1.8.2 release.
>
> The code for auto-running the tests was changed from:
>
> Test::Unit::AutoRunner.run($0)
>
> to:
>
> Test::Unit::AutoRunner.run($0 != "-e" && $0)
>
> Reverting this change will get Rake::TestTask working again, but I'm
> not sure what else will break as a consequence. The change was likely
> trying to fix some other problem. The CVS checkin comment doesn't say
> why it was changed.
>
> Cheers,
>
> Dave
>
>
> On Dec 29, 2004, at 4:28 PM, Jim Weirich wrote:
>
>>
>> Jim Weirich said:
>>
>> Someone just informed me that in 1.8.2 test/unit does not work with
>> the
>> ruby -e0 -rtestfile technique that Rake is using to load the unit
>> tests.
>> I haven't been able to verify this. I'm not running 1.8.2 yet, so I
>> am
>> not able to validate this.
>>
>> Nathaniel ... is this intentional? What's the story?
>>
>> --
>> -- Jim Weirich jim@weirichhouse.org http://onest...
>> -----------------------------------------------------------------
>> "Beware of bugs in the above code; I have only proved it correct,
>> not tried it." -- Donald Knuth (in a memo to Peter van Emde Boas)
>>
>>
>
>



Jim Weirich

12/30/2004 5:38:00 AM

0

On Wednesday 29 December 2004 11:09 pm, Dave Halliday wrote:
> Here's a patch for Rake that provides a workaround for the 1.8.2
> Test::Unit behavior.

Thanks ... The fix is in CVS. I'll test the fix tomorrow on a windows box and
if all looks good we will have a new release soon.

--
-- Jim Weirich jim@weirichhouse.org http://onest...
-----------------------------------------------------------------
"Beware of bugs in the above code; I have only proved it correct,
not tried it." -- Donald Knuth (in a memo to Peter van Emde Boas)


Yogi

12/30/2004 5:45:00 AM

0

Dave, thanks! that fixes the problem for now.


On Thu, 30 Dec 2004 13:09:54 +0900, Dave Halliday <davehal02@halliday.ca> wrote:
> Here's a patch for Rake that provides a workaround for the 1.8.2
> Test::Unit behavior. The patch is based on rake/testtask.rb from Rake
> 0.4.13.
>
> 81a82
> > name_hack = "$0=\"#{@name}\""
> 83c84
> < ruby %{-I#{lib_path} -e0
> #{SEP}#{required_files}#{option_list}}
> ---
> > ruby %{-I#{lib_path} -e'#{name_hack}'
> #{SEP}#{required_files}#{option_list}}
>
> It overrides $0 with the name of the Rake test target, so that
> Test::Unit never sees the '-e' that was causing problems.
>
> Cheers,
>
> Dave
>
> On Dec 29, 2004, at 8:55 PM, Dave Halliday wrote:
>
> > I checked CVS. There is a recent (Dec. 19) change made by Nobu to
> > test/unit.rb that was part of the 1.8.2 release.
> >
> > The code for auto-running the tests was changed from:
> >
> > Test::Unit::AutoRunner.run($0)
> >
> > to:
> >
> > Test::Unit::AutoRunner.run($0 != "-e" && $0)
> >
> > Reverting this change will get Rake::TestTask working again, but I'm
> > not sure what else will break as a consequence. The change was likely
> > trying to fix some other problem. The CVS checkin comment doesn't say
> > why it was changed.
> >
> > Cheers,
> >
> > Dave
> >
> >
> > On Dec 29, 2004, at 4:28 PM, Jim Weirich wrote:
> >
> >>
> >> Jim Weirich said:
> >>
> >> Someone just informed me that in 1.8.2 test/unit does not work with
> >> the
> >> ruby -e0 -rtestfile technique that Rake is using to load the unit
> >> tests.
> >> I haven't been able to verify this. I'm not running 1.8.2 yet, so I
> >> am
> >> not able to validate this.
> >>
> >> Nathaniel ... is this intentional? What's the story?
> >>
> >> --
> >> -- Jim Weirich jim@weirichhouse.org http://onest...
> >> -----------------------------------------------------------------
> >> "Beware of bugs in the above code; I have only proved it correct,
> >> not tried it." -- Donald Knuth (in a memo to Peter van Emde Boas)
> >>
> >>
> >
> >
>
>


--
- Yogi
Developer, www.thoughtworks.com