Closed teoljungberg closed 10 years ago
That's not what the -w
flag is intended for. It is intended for autotest
itself.
When I add x = 42
to a .autotest file (or any file loaded by it) I see:
% ruby -Ilib:../../../minitest/dev/lib -S autotest
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby -I.:lib:test -rubygems -e "%w[minitest/autorun test/test_blah.rb].each { |f| require f }"
Run options: --seed 3001
# Running:
.
Finished in 0.001164s, 859.1065 runs/s, 859.1065 assertions/s.
1 runs, 1 assertions, 0 failures, 0 errors, 0 skips
versus:
% ruby -Ilib:../../../minitest/dev/lib -S autotest -w
/Users/ryan/Work/p4/zss/src/ZenTest/dev/blah/.autotest:9: warning: assigned but unused variable - x
Run options: --seed 12813
# Running:
.
Finished in 0.001970s, 507.6142 runs/s, 507.6142 assertions/s.
1 runs, 1 assertions, 0 failures, 0 errors, 0 skips
You can override ruby_cmd
if you want to tack on a -w
to your tests or just turn them on in your tests.
I figured as much, but was not entierely sure.
I solved my predicament by adding RUBYOPT=-w before running autotest — Sent from Mailbox for iPhone
On Tue, Mar 25, 2014 at 11:23 PM, Ryan Davis notifications@github.com wrote:
That's not what the
-w
flag is intended for. It is intended forautotest
itself. When I addx = 42
to a .autotest file (or any file loaded by it) I see:% ruby -Ilib:../../../minitest/dev/lib -S autotest /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby -I.:lib:test -rubygems -e "%w[minitest/autorun test/test_blah.rb].each { |f| require f }" Run options: --seed 3001 # Running: . Finished in 0.001164s, 859.1065 runs/s, 859.1065 assertions/s. 1 runs, 1 assertions, 0 failures, 0 errors, 0 skips
versus:
% ruby -Ilib:../../../minitest/dev/lib -S autotest -w /Users/ryan/Work/p4/zss/src/ZenTest/dev/blah/.autotest:9: warning: assigned but unused variable - x Run options: --seed 12813 # Running: . Finished in 0.001970s, 507.6142 runs/s, 507.6142 assertions/s. 1 runs, 1 assertions, 0 failures, 0 errors, 0 skips
You can override
ruby_cmd
if you want to tack on a-w
to your tests or just turn them on in your tests.Reply to this email directly or view it on GitHub: https://github.com/seattlerb/zentest/issues/55#issuecomment-38628905
autotest -w
doesn't throwruby
warningsMy test case:
Running it with plain 'ol ruby
With
autotest
Not a single warning was thrown