ruby-changes:54435
From: k0kubun <ko1@a...>
Date: Sun, 30 Dec 2018 15:17:19 +0900 (JST)
Subject: [ruby-changes:54435] k0kubun:r66650 (trunk): clock_gettime_spec.rb: exclude invalid clocks for Solaris
k0kubun 2018-12-30 15:17:16 +0900 (Sun, 30 Dec 2018) New Revision: 66650 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=66650 Log: clock_gettime_spec.rb: exclude invalid clocks for Solaris https://rubyci.org/logs/rubyci.s3.amazonaws.com/unstable10x/ruby-trunk/log/20181230T041806Z.fail.html.gz https://rubyci.org/logs/rubyci.s3.amazonaws.com/unstable11x/ruby-trunk/log/20181230T042407Z.fail.html.gz https://rubyci.org/logs/rubyci.s3.amazonaws.com/unstable11s/ruby-trunk/log/20181230T032505Z.fail.html.gz https://rubyci.org/logs/rubyci.s3.amazonaws.com/solaris11s-sunc/ruby-trunk/log/20181230T022505Z.fail.html.gz Modified files: trunk/spec/ruby/core/process/clock_gettime_spec.rb Index: spec/ruby/core/process/clock_gettime_spec.rb =================================================================== --- spec/ruby/core/process/clock_gettime_spec.rb (revision 66649) +++ spec/ruby/core/process/clock_gettime_spec.rb (revision 66650) @@ -2,13 +2,19 @@ require_relative '../../spec_helper' https://github.com/ruby/ruby/blob/trunk/spec/ruby/core/process/clock_gettime_spec.rb#L2 describe "Process.clock_gettime" do platform_is_not :windows do - Process.constants.select { |c| - c.to_s.start_with?('CLOCK_') && + invalid_clocks = [ # These require CAP_WAKE_ALARM and are not documented in clock_gettime(), # they return EINVAL if the permission is not granted. - c != :CLOCK_BOOTTIME_ALARM && - c != :CLOCK_REALTIME_ALARM - }.each do |c| + :CLOCK_BOOTTIME_ALARM, + :CLOCK_REALTIME_ALARM, + # These don't work on Solaris + :CLOCK_PROCESS_CPUTIME_ID, + :CLOCK_THREAD_CPUTIME_ID, + :CLOCK_VIRTUAL, + :CLOCK_PROF, + ] + + Process.constants.select { |c| c.to_s.start_with?('CLOCK_') && !invalid_clocks.include?(c) }.each do |c| it "can be called with Process::#{c}" do value = Process.const_get(c) Process.clock_gettime(value).should be_an_instance_of(Float) -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/