Permalink
Browse files

syncing to head of tfs

  • Loading branch information...
1 parent 03054a5 commit 7d9391319aa533fe3be3cee1462452dd093e9bef @jredville jredville committed Oct 1, 2009
Showing with 1,710 additions and 574 deletions.
  1. +3 −3 .../External.LCA_RESTRICTED/Languages/IronRuby/Yaml/IronRuby.Libraries.Yaml/GenerateInitializers.cmd
  2. +0 −2 Merlin/External.LCA_RESTRICTED/Languages/IronRuby/mspec/ironruby-tags/language/execution_tags.txt
  3. +3 −4 Merlin/External.LCA_RESTRICTED/Languages/IronRuby/mspec/mspec/lib/mspec/helpers/ruby_exe.rb
  4. +20 −0 Merlin/External.LCA_RESTRICTED/Languages/IronRuby/mspec/rubyspec/core/io/shared/tty.rb
  5. +1 −0 Merlin/External.LCA_RESTRICTED/Languages/IronRuby/mspec/rubyspec/core/io/shared/tty_probe.rb
  6. +75 −1 Merlin/External.LCA_RESTRICTED/Languages/IronRuby/mspec/rubyspec/core/kernel/backtick_spec.rb
  7. +1 −0 Merlin/External.LCA_RESTRICTED/Languages/IronRuby/mspec/rubyspec/core/kernel/fixtures/comspec.cmd
  8. +5 −4 Merlin/External.LCA_RESTRICTED/Languages/IronRuby/mspec/rubyspec/core/kernel/system_spec.rb
  9. +12 −10 Merlin/External.LCA_RESTRICTED/Languages/IronRuby/mspec/rubyspec/core/process/uid_spec.rb
  10. +6 −9 ...RESTRICTED/Languages/IronRuby/mspec/rubyspec/library/readline/completion_append_character_spec.rb
  11. +121 −121 Merlin/Main/Languages/IronPython/IronPython.Modules/errno.cs
  12. +47 −2 Merlin/Main/Languages/IronPython/IronPython.Modules/nt.cs
  13. +4 −3 Merlin/Main/Languages/IronPython/IronPython/Hosting/PythonCommandLine.cs
  14. +3 −8 Merlin/Main/Languages/IronPython/IronPython/Modules/sys.cs
  15. +1 −0 Merlin/Main/Languages/IronPython/IronPython/Runtime/Operations/IntOps.cs
  16. +8 −10 Merlin/Main/Languages/IronPython/IronPython/Runtime/Operations/PythonOps.cs
  17. +30 −13 Merlin/Main/Languages/IronPython/IronPython/Runtime/PythonContext.cs
  18. +80 −93 Merlin/Main/Languages/IronPython/IronPython/Runtime/PythonModule.cs
  19. +6 −6 Merlin/Main/Languages/IronPython/IronPython/Runtime/PythonTracebackListener.cs
  20. +13 −1 Merlin/Main/Languages/IronPython/IronPython/Runtime/Types/PythonType.cs
  21. +1 −6 Merlin/Main/Languages/IronPython/IronPython/Runtime/Types/TypeInfo.cs
  22. +0 −1 Merlin/Main/Languages/IronPython/IronPython/Runtime/XRange.cs
  23. +0 −10 Merlin/Main/Languages/IronPython/IronPythonTest/IronPythonTest.csproj
  24. 0 Merlin/Main/Languages/Ruby/1
  25. +54 −0 Merlin/Main/Languages/Ruby/Experimental/Interop/win32api.rb
  26. +10 −0 Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Builtins/Errno.cs
  27. +43 −29 Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Builtins/IoOps.cs
  28. +19 −77 Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Builtins/KernelOps.cs
  29. +295 −3 Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Builtins/RubyProcess.cs
  30. +1 −1 Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/GenerateInitializers.cmd
  31. +165 −112 Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Initializers.Generated.cs
  32. BIN Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/IronRuby.Libraries.Build.csproj
  33. +1 −0 Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/IronRuby.Libraries.csproj
  34. +1 −1 Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Open3/Open3.cs
  35. +417 −0 Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Win32API/Win32API.cs
  36. +4 −3 Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Zlib/zlib.cs
  37. +16 −0 Merlin/Main/Languages/Ruby/Libs/Win32API.rb
  38. +2 −2 Merlin/Main/Languages/Ruby/Ruby.sln
  39. +5 −1 Merlin/Main/Languages/Ruby/Ruby/Builtins/ConsoleStream.cs
  40. +15 −0 Merlin/Main/Languages/Ruby/Ruby/Builtins/Exceptions.cs
  41. +6 −2 Merlin/Main/Languages/Ruby/Ruby/Builtins/RubyIO.cs
  42. +2 −2 Merlin/Main/Languages/Ruby/Ruby/Compiler/ReflectionCache.Generated.cs
  43. +12 −3 Merlin/Main/Languages/Ruby/Ruby/Hosting/RubyCommandLine.cs
  44. +5 −5 Merlin/Main/Languages/Ruby/Ruby/Runtime/Calls/RubyOverloadResolver.cs
  45. +2 −2 Merlin/Main/Languages/Ruby/Ruby/Runtime/RubyContext.cs
  46. +22 −5 Merlin/Main/Languages/Ruby/Ruby/Runtime/RubyOps.cs
  47. +1 −1 Merlin/Main/Languages/Ruby/Ruby/Runtime/RuntimeErrorSink.cs
  48. +42 −2 Merlin/Main/Runtime/Microsoft.Scripting/Hosting/ObjectOperations.cs
  49. +1 −1 Merlin/Main/Runtime/Microsoft.Scripting/LanguageOptions.cs
  50. +63 −5 Merlin/Main/Runtime/Microsoft.Scripting/Runtime/DynamicOperations.cs
  51. +11 −2 Merlin/Main/Runtime/Microsoft.Scripting/Runtime/LanguageContext.cs
  52. +52 −5 Merlin/Main/Runtime/Microsoft.Scripting/Runtime/ScopeStorage.cs
  53. +3 −3 Merlin/Main/Runtime/Microsoft.Scripting/Utils/ExceptionFactory.Generated.cs
@@ -1,8 +1,8 @@
@echo off
-if "%1" == "4" (
- set DIR=%MERLIN_ROOT%\Bin\Debug
-) else (
+if "%1" == "-4" (
set DIR=%MERLIN_ROOT%\Bin\V4 Debug
+) else (
+ set DIR=%MERLIN_ROOT%\Bin\Debug
)
"%DIR%\ClassInitGenerator" "%DIR%\IronRuby.Libraries.Yaml.dll" /libraries:IronRuby.StandardLibrary.Yaml /out:%~dp0\Initializer.Generated.cs
@@ -1,2 +0,0 @@
-fails:`` returns the output of the executed sub-process
-fails:%x is the same as ``
@@ -87,19 +87,18 @@ def ruby_exe_options(option)
when :install_name
bin = Config::CONFIG["RUBY_INSTALL_NAME"] || Config::CONFIG["ruby_install_name"]
bin << (Config::CONFIG['EXEEXT'] || Config::CONFIG['exeext'] || '')
- File.join(Config::CONFIG['bindir'], bin)
+ File.join(File.expand_path(Config::CONFIG['bindir']), bin)
end
end
def resolve_ruby_exe
[:env, :engine, :name, :install_name].each do |option|
next unless cmd = ruby_exe_options(option)
- exe = cmd.split.first
# It has been reported that File.executable is not reliable
# on Windows platforms (see commit 56bc555c). So, we check the
# platform.
- if File.exists?(exe) and (SpecGuard.windows? or File.executable?(exe))
+ if File.exists?(cmd) and (SpecGuard.windows? or File.executable?(cmd))
return cmd
end
end
@@ -111,7 +110,7 @@ def ruby_exe(code, opts = {})
working_dir = opts[:dir] || "."
Dir.chdir(working_dir) do
body = "-e #{code.inspect}" if code and not File.exists?(code)
- cmd = [RUBY_EXE, ENV['RUBY_FLAGS'], opts[:options], body, opts[:args]]
+ cmd = [RUBY_EXE.inspect, ENV['RUBY_FLAGS'], opts[:options], body, opts[:args]]
`#{cmd.compact.join(' ')}`
end
end
@@ -13,6 +13,26 @@
File.open('NUL') {|f| f.send @method }.should == true
end
end
+
+ it "return false when called on a standard stream redirected to a file or a pipe" do
+ sin, sout, serr = 1, 2, 4
+
+ # standard output is redirected by %x{}
+ %x{"#{RUBY_EXE}" "#{File.dirname(__FILE__)}/tty_probe.rb"}
+ $?.exitstatus.should == sin | serr
+
+ # redirect error output to std output:
+ %x{"#{RUBY_EXE}" "#{File.dirname(__FILE__)}/tty_probe.rb" 2>&1}
+ $?.exitstatus.should == sin
+
+ # redirect input:
+ %x{"#{RUBY_EXE}" "#{File.dirname(__FILE__)}/tty_probe.rb" < "#{File.dirname(__FILE__)}/tty_probe.rb"}
+ $?.exitstatus.should == serr
+
+ # redirect both input and error output:
+ %x{"#{RUBY_EXE}" "#{File.dirname(__FILE__)}/tty_probe.rb" 2>1 < "#{File.dirname(__FILE__)}/tty_probe.rb"}
+ $?.exitstatus.should == 0
+ end
end
it "returns false if this stream is not a terminal device (TTY)" do
@@ -0,0 +1 @@
+exit((STDIN.tty? ? 1 : 0) | (STDOUT.tty? ? 2 : 0) | (STDERR.tty? ? 4 : 0))
@@ -50,7 +50,81 @@
$?.exitstatus.should == 99
$?.success?.should == false
end
- end
+
+ def test_comspec(commands)
+ comspec_mock = File.dirname(__FILE__) + '/fixtures/comspec.cmd'
+
+ query = "ENV['COMSPEC'] = '#{comspec_mock}'; puts "
+ query += commands.collect { |cmd| "`#{cmd}`" }.join(', ')
+
+ result = ruby_exe(query)
+
+ # The comspec mock prints all its command arguments and we check if it gets exactly two: /c "COMMAND".
+ i = 0
+ result.each_line do |line|
+ line.strip.should == %Q{/c "#{commands[i]}"}
+ i += 1
+ end
+ end
+
+ it "special cases Windows shell commands" do
+ test_comspec [
+ "ASSOC",
+ "BREAK",
+ "CALL",
+ "CD",
+ "CHDIR",
+ "CLS",
+ "COLOR",
+ "COPY",
+ "DATE",
+ "DEL",
+ "DIR",
+ "ECHO",
+ "ENDLOCAL",
+ "ERASE",
+ "EXIT",
+ "FOR",
+ "FTYPE",
+ "GOTO",
+ "IF",
+ "MD",
+ "MKDIR",
+ "MOVE",
+ "PATH",
+ "PAUSE",
+ "POPD",
+ "PROMPT",
+ "PUSHD",
+ "RD",
+ "REM",
+ "REN",
+ "RENAME",
+ "RMDIR",
+ "SET",
+ "SETLOCAL",
+ "SHIFT",
+ "START",
+ "TIME",
+ "TITLE",
+ "TYPE",
+ "VER",
+ "VERIFY",
+ "VOL",
+ ]
+ end
+
+ ruby_bug "", "1.9" do
+ ruby_bug "", "1.8" do
+ it "special cases Windows Vista+ shell commands" do
+ test_comspec [
+ "MKLINK",
+ ]
+ end
+ end
+ end
+ end
+
end
describe "Kernel.`" do
@@ -62,10 +62,11 @@
Kernel.should have_private_instance_method(:system)
end
-
- it "expands shell variables when given a single string argument" do
- result = system("ruby #{@helper_script} #{@shell_var} foo")
- result.should be_true
+ ruby_version_is "1.9" do
+ it "expands shell variables when given a single string argument" do
+ result = system("ruby #{@helper_script} #{@shell_var} foo")
+ result.should be_true
+ end
end
it "does not expand shell variables when given multiples arguments" do
@@ -1,16 +1,18 @@
require File.dirname(__FILE__) + '/../../spec_helper'
describe "Process.uid" do
- it "returns the correct uid for the user executing this process" do
- current_uid_according_to_unix = `id -ur`.to_i
- Process.uid.should == current_uid_according_to_unix
- end
-
- it "also goes by Process::UID.rid" do
- Process::UID.rid.should == Process.uid
- end
+ platform_is_not :windows do
+ it "returns the correct uid for the user executing this process" do
+ current_uid_according_to_unix = `id -ur`.to_i
+ Process.uid.should == current_uid_according_to_unix
+ end
+
+ it "also goes by Process::UID.rid" do
+ Process::UID.rid.should == Process.uid
+ end
- it "also goes by Process::Sys.getuid" do
- Process::Sys.getuid.should == Process.uid
+ it "also goes by Process::Sys.getuid" do
+ Process::Sys.getuid.should == Process.uid
+ end
end
end
@@ -1,15 +1,12 @@
require File.dirname(__FILE__) + '/../../spec_helper'
process_is_foreground do
+ require 'readline'
+ describe "Readline.completion_append_character" do
+ it "needs to be reviewed for spec completeness"
+ end
- not_supported_on :ironruby do
- require 'readline'
- describe "Readline.completion_append_character" do
- it "needs to be reviewed for spec completeness"
- end
-
- describe "Readline.completion_append_character=" do
- it "needs to be reviewed for spec completeness"
- end
+ describe "Readline.completion_append_character=" do
+ it "needs to be reviewed for spec completeness"
end
end
Oops, something went wrong.

0 comments on commit 7d93913

Please sign in to comment.