Closed ngoto closed 9 years ago
Yes, these should really be fixtures, like fixture(__FILE__, "autoload_frozen.rb")
The approach using STDIN to pass the code is problematic for cases of ruby_exe which expect to pass a file by STDIN.
Thanks, but this only fixes "Kernel#autoload when Object is frozen raises a RuntimeError before defining the constant FAILED".
As you can see, there are many "sh: : cannot execute" which is caused by cat
and double quote splitting of command line. Do you mean all of the specs should be rewritten to fixture?
I think most of them should, but I am also investigating a solution with putting the code in a temporary file, for ruby_exe
.
Seems it works well except for 4 examples of -s
, which I can fix. I'll push the fix tomorrow.
Executing mspec with "--verbose --debug" shows that the shell's error messages "sh: END_OF_RUBYCODE: not found" and "sh: 2>&1: not found" occurred in spec/rubyspec/command_line/rubyopt_spec.rb.
$ MSPECOPT="--verbose --debug" make test-rubyspec
./miniruby -I./lib -I. -I.ext/common ./tool/runruby.rb --extout=.ext -- --disable-gems -r./sparc64-solaris2.10-fake ./spec/mspec/bin/mspec run -B ./spec/default.mspec --verbose --debug
ruby 2.3.0dev (2015-09-02) [sparc64-solaris2.10]
/XXXXX/trunk-51741/spec/rubyspec/command_line/dash_a_spec.rb .
(snip)
/XXXXX/trunk-51741/spec/rubyspec/command_line/error_message_spec.rb .
/XXXXX/trunk-51741/spec/rubyspec/command_line/rubyopt_spec.rb Exception `LoadError' at /XXXXX/trunk-51741/lib/rubygems.rb:1229 - cannot load such file -- rubygems/defaults/operating_system
Exception `LoadError' at /XXXXX/trunk-51741/lib/rubygems.rb:1238 - cannot load such file -- rubygems/defaults/ruby
sh: END_OF_RUBYCODE: not found
sh: 2>&1: not found
F
/XXXXX/trunk-51741/spec/rubyspec/language/BEGIN_spec.rb .
(snip)
/XXXXX/trunk-51741/spec/rubyspec/optional/capi/util_spec.rb .
1)
Processing RUBYOPT sets $DEBUG to true for '-d' FAILED
Expected ""
to match /value of \$DEBUG is true/
(snip)
I'm sorry I misidentified the error. The failure of "Kernel#autoload when Object is frozen raises a RuntimeError before defining the constant" did not show shell's error message and it only showed child ruby's syntax error.
I think this last commit should fix it, as it puts the code in a temporary file. Please reopen if not.
It looks fine on RubyCI now, remaining errors seem unrelated to shell errors.
Thnak you. I'm running "make test-rubyspec" on Solaris 10. I'll post about other failures as different issues.
After d0406c98e1bfe9bc6c51a9fcba9d62a14b017fb1, the followinf errors occur.
The error messages "sh: END_OF_RUBYCODE: not found" and "sh: 2>&1: not found" are caused by /bin/sh in Solaris that may parse the double quote " in cat contents and the command-line is wrongly splitted by the shell.
I think using here document simply like below might solve the problem.
I also thing that using temporary script file may be an alternative solution.