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

ruby-changes:27807

From: usa <ko1@a...>
Date: Thu, 21 Mar 2013 20:35:31 +0900 (JST)
Subject: [ruby-changes:27807] usa:r39859 (ruby_1_9_3): merge revision(s) 39809,39834,39837: [Backport #8132]

usa	2013-03-21 20:35:20 +0900 (Thu, 21 Mar 2013)

  New Revision: 39859

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

  Log:
    merge revision(s) 39809,39834,39837: [Backport #8132]
    
    * test/win32ole/test_err_in_callback.rb
      (TestErrInCallBack#test_err_in_callback): shouldn't create a file in
      source directory.
    
    * test/win32ole/test_err_in_callback.rb (TestErrInCallBack#setup): use
      relative path to get rid of "too long commandline" error.
      the top of build directory.
    
    * test/win32ole/test_err_in_callback.rb (TestErrInCallBack#setup):
      allow using different root for source and build directories.
      this may fixes a minor problem of r39834.

  Modified directories:
    branches/ruby_1_9_3/
  Modified files:
    branches/ruby_1_9_3/ChangeLog
    branches/ruby_1_9_3/test/win32ole/test_err_in_callback.rb
    branches/ruby_1_9_3/version.h

Index: ruby_1_9_3/ChangeLog
===================================================================
--- ruby_1_9_3/ChangeLog	(revision 39858)
+++ ruby_1_9_3/ChangeLog	(revision 39859)
@@ -1,3 +1,20 @@ https://github.com/ruby/ruby/blob/trunk/ruby_1_9_3/ChangeLog#L1
+Thu Mar 21 20:34:52 2013  NAKAMURA Usaku  <usa@r...>
+
+	* test/win32ole/test_err_in_callback.rb (TestErrInCallBack#setup):
+	  allow using different root for source and build directories.
+	  this may fixes a minor problem of r39834.
+
+Thu Mar 21 20:34:52 2013  NAKAMURA Usaku  <usa@r...>
+
+	* test/win32ole/test_err_in_callback.rb (TestErrInCallBack#setup): use
+	  relative path to get rid of "too long commandline" error.
+
+Thu Mar 21 20:34:52 2013  NAKAMURA Usaku  <usa@r...>
+
+	* test/win32ole/test_err_in_callback.rb
+	  (TestErrInCallBack#test_err_in_callback): shouldn't create a file in
+	  the top of build directory.
+
 Tue Feb 26 09:53:59 2013  NARUSE, Yui  <naruse@r...>
 
 	* st.c (st_add_direct): int is not always same with st_index_t.  some
Index: ruby_1_9_3/version.h
===================================================================
--- ruby_1_9_3/version.h	(revision 39858)
+++ ruby_1_9_3/version.h	(revision 39859)
@@ -1,10 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/ruby_1_9_3/version.h#L1
 #define RUBY_VERSION "1.9.3"
-#define RUBY_PATCHLEVEL 393
+#define RUBY_PATCHLEVEL 394
 
-#define RUBY_RELEASE_DATE "2013-02-26"
+#define RUBY_RELEASE_DATE "2013-03-21"
 #define RUBY_RELEASE_YEAR 2013
-#define RUBY_RELEASE_MONTH 2
-#define RUBY_RELEASE_DAY 26
+#define RUBY_RELEASE_MONTH 3
+#define RUBY_RELEASE_DAY 21
 
 #include "ruby/version.h"
 
Index: ruby_1_9_3/test/win32ole/test_err_in_callback.rb
===================================================================
--- ruby_1_9_3/test/win32ole/test_err_in_callback.rb	(revision 39858)
+++ ruby_1_9_3/test/win32ole/test_err_in_callback.rb	(revision 39859)
@@ -9,17 +9,21 @@ rescue LoadError https://github.com/ruby/ruby/blob/trunk/ruby_1_9_3/test/win32ole/test_err_in_callback.rb#L9
 end
 if defined?(WIN32OLE)
   require 'mkmf'
+  require 'pathname'
   require 'test/unit'
+  require 'tmpdir'
   class TestErrInCallBack < Test::Unit::TestCase
     def setup
       @ruby = nil
       if File.exist?("./" + CONFIG["RUBY_INSTALL_NAME"] + CONFIG["EXEEXT"])
         sep = File::ALT_SEPARATOR || "/"
         @ruby = "." + sep + CONFIG["RUBY_INSTALL_NAME"]
+        cwd = Pathname.new(File.expand_path('.'))
         @iopt = $:.map {|e|
-          " -I " + e
+          " -I " + (Pathname.new(e).relative_path_from(cwd).to_s rescue e)
         }.join("")
-        @script = File.join(File.dirname(__FILE__), "err_in_callback.rb")
+        script = File.join(File.dirname(__FILE__), "err_in_callback.rb")
+        @script = Pathname.new(script).relative_path_from(cwd).to_s rescue script
       end
     end
 
@@ -35,18 +39,17 @@ if defined?(WIN32OLE) https://github.com/ruby/ruby/blob/trunk/ruby_1_9_3/test/win32ole/test_err_in_callback.rb#L39
     def test_err_in_callback
       skip "'ADODB.Connection' is not available" unless available_adodb?
       if @ruby
-        cmd = "#{@ruby} -v #{@iopt} #{@script} > test_err_in_callback.log 2>&1"
-        system(cmd)
-        str = ""
-        open("test_err_in_callback.log") {|ifs|
-          str = ifs.read
-        }
-        assert_match(/NameError/, str)
+        Dir.mktmpdir do |tmpdir|
+          logfile = File.join(tmpdir, "test_err_in_callback.log")
+          cmd = "#{@ruby} -v #{@iopt} #{@script} > #{logfile.gsub(%r(/), '\\')} 2>&1"
+          result = system(cmd)
+          str = ""
+          open(logfile) {|ifs|
+            str = ifs.read
+          }
+          assert_match(/NameError/, str)
+        end
       end
     end
-
-    def teardown
-      File.unlink("test_err_in_callback.log") if File.exist?("test_err_in_callback.log")
-    end
   end
 end

Property changes on: ruby_1_9_3
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /trunk:r39809,39834,39837


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

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