[前][次][番号順一覧][スレッド一覧]

ruby-changes:18980

From: usa <ko1@a...>
Date: Fri, 4 Mar 2011 00:30:36 +0900 (JST)
Subject: [ruby-changes:18980] Ruby:r31016 (trunk): * test/ruby/test_process.rb (test_execopts_redirect): redirecting fd

usa	2011-03-03 21:23:44 +0900 (Thu, 03 Mar 2011)

  New Revision: 31016

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=31016

  Log:
    * test/ruby/test_process.rb (test_execopts_redirect): redirecting fd
      >= 3 is not supported on Windows, so should not specify such options
      when calling spawn or others.

  Modified files:
    trunk/ChangeLog
    trunk/test/ruby/test_process.rb

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 31015)
+++ ChangeLog	(revision 31016)
@@ -1,3 +1,9 @@
+Thu Mar  3 21:21:42 2011  NAKAMURA Usaku  <usa@r...>
+
+	* test/ruby/test_process.rb (test_execopts_redirect): redirecting fd
+	  >= 3 is not supported on Windows, so should not specify such options
+	  when calling spawn or others.
+
 Thu Mar  3 18:59:04 2011  NARUSE, Yui  <naruse@r...>
 
 	* string.c (rb_str_slice_bang): raise error when the string is frozen.
Index: test/ruby/test_process.rb
===================================================================
--- test/ruby/test_process.rb	(revision 31015)
+++ test/ruby/test_process.rb	(revision 31016)
@@ -387,13 +387,17 @@
         Process.wait Process.spawn(*ECHO["d"], f=>STDOUT, STDOUT=>f)
         assert_equal("d", File.read("out").chomp)
       }
-      Process.wait Process.spawn(*ECHO["e"], STDOUT=>["out", File::WRONLY|File::CREAT|File::TRUNC, 0644],
-                                 3=>STDOUT, 4=>STDOUT, 5=>STDOUT, 6=>STDOUT, 7=>STDOUT)
+      opts = {STDOUT=>["out", File::WRONLY|File::CREAT|File::TRUNC, 0644]}
+      if /mswin|mingw/ !~ RUBY_PLATFORM
+        opts.merge(3=>STDOUT, 4=>STDOUT, 5=>STDOUT, 6=>STDOUT, 7=>STDOUT)
+      end
+      Process.wait Process.spawn(*ECHO["e"], opts)
       assert_equal("e", File.read("out").chomp)
-      Process.wait Process.spawn(*ECHO["ee"], STDOUT=>["out", File::WRONLY|File::CREAT|File::TRUNC, 0644],
-                                 3=>0, 4=>:in, 5=>STDIN,
-                                 6=>1, 7=>:out, 8=>STDOUT,
-                                 9=>2, 10=>:err, 11=>STDERR)
+      opts = {STDOUT=>["out", File::WRONLY|File::CREAT|File::TRUNC, 0644]}
+      if /mswin|mingw/ !~ RUBY_PLATFORM
+        opts.merge(3=>0, 4=>:in, 5=>STDIN, 6=>1, 7=>:out, 8=>STDOUT, 9=>2, 10=>:err, 11=>STDERR)
+      end
+      Process.wait Process.spawn(*ECHO["ee"], opts)
       assert_equal("ee", File.read("out").chomp)
       if /mswin|mingw/ !~ RUBY_PLATFORM
         # passing non-stdio fds is not supported on Windows

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]