test_benchmark icon indicating copy to clipboard operation
test_benchmark copied to clipboard

autotest check flawed on windows

Open DrusTheAxe opened this issue 16 years ago • 1 comments

Very nice plugin, but on Windows you see on the console ... ps : illegal option -- o Loaded suite C:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader Started ... That 'ps' line is due to init.rb, line 3

Assumes Unix (Linux?); doesn't work on Windows. Simple fix, don't do this on Windows -- wrap the current while...end loop with a not-windows check:

if ENV['RAILS_ENV'] == 'test' && !%w{false none}.include?(ENV['BENCHMARK']) unless RAILS =~ /mswin32/ while (pid ||= $$).to_i > 0 pid, *process = ps -p #{pid} -o ppid -o args.strip.split("\n").last.split @autotest ||= process.join =~ /autotest/i end end

require File.dirname(__FILE__) + "/lib/test_benchmark" unless @autotest

end

DrusTheAxe avatar Sep 17 '09 21:09 DrusTheAxe

Sorry, cut/paste error. That should be

unless RUBY_PLATFORM =~ /mswin32/

DrusTheAxe avatar Sep 17 '09 21:09 DrusTheAxe