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

ruby-changes:34672

From: nobu <ko1@a...>
Date: Tue, 8 Jul 2014 16:58:18 +0900 (JST)
Subject: [ruby-changes:34672] nobu:r46755 (trunk): memory_status.rb: find proper ps

nobu	2014-07-08 16:58:03 +0900 (Tue, 08 Jul 2014)

  New Revision: 46755

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

  Log:
    memory_status.rb: find proper ps
    
    * test/ruby/memory_status.rb (Memory::PSCMD): use ps command which
      outputs expected result.  [ruby-dev:48370] [Bug #10010]

  Modified files:
    trunk/ChangeLog
    trunk/test/ruby/memory_status.rb
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 46754)
+++ ChangeLog	(revision 46755)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Tue Jul  8 16:58:02 2014  Nobuyoshi Nakada  <nobu@r...>
+
+	* test/ruby/memory_status.rb (Memory::PSCMD): use ps command which
+	  outputs expected result.  [ruby-dev:48370] [Bug #10010]
+
 Tue Jul  8 14:45:17 2014  Koichi Sasada  <ko1@a...>
 
 	* parse.y (dsymbol_alloc): set global_symbols.minor_marked to 0.
Index: test/ruby/memory_status.rb
===================================================================
--- test/ruby/memory_status.rb	(revision 46754)
+++ test/ruby/memory_status.rb	(revision 46755)
@@ -82,8 +82,12 @@ module Memory https://github.com/ruby/ruby/blob/trunk/test/ruby/memory_status.rb#L82
       end
     end
   else
-    PSCMD = ["ps", "-ovsz=","-orss=", "-p"]
     PAT = /^\s*(\d+)\s+(\d+)$/
+    require_relative 'find_executable'
+    if PSCMD = EnvUtil.find_executable("ps", "-ovsz=", "-orss=", "-p", $$.to_s) {|out| PAT =~ out}
+      PSCMD.pop
+    end
+    raise MiniTest::Skip, "ps command not found" unless PSCMD
 
     keys << :size << :rss
     def self.read_status

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

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