diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-07-08 07:58:03 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-07-08 07:58:03 +0000 |
commit | 286eaeb24f815211651e7443585188e42993eec1 (patch) | |
tree | e350bb34de2524ac26bde4dae5f36078dd3f2e61 /test/ruby | |
parent | 65accad30a056321856765fcac35655afbd9f44e (diff) | |
download | ruby-286eaeb24f815211651e7443585188e42993eec1.tar.gz |
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]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46755 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/memory_status.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/test/ruby/memory_status.rb b/test/ruby/memory_status.rb index f8e097a9cd..5347e34cb6 100644 --- a/test/ruby/memory_status.rb +++ b/test/ruby/memory_status.rb @@ -82,8 +82,12 @@ module Memory 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 |