diff options
author | k0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-12-30 06:17:16 +0000 |
---|---|---|
committer | k0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-12-30 06:17:16 +0000 |
commit | a7edd05f7dca44f56fd72d7bcc232e1b27df0eb3 (patch) | |
tree | 0d2281c9c003ee24dd9b229ecef340db70023b16 | |
parent | f110ebfd141710e65e230b9e79855e9ded91258e (diff) | |
download | ruby-a7edd05f7dca44f56fd72d7bcc232e1b27df0eb3.tar.gz |
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
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66650 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | spec/ruby/core/process/clock_gettime_spec.rb | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/spec/ruby/core/process/clock_gettime_spec.rb b/spec/ruby/core/process/clock_gettime_spec.rb index b690186ac3..56d75a04c9 100644 --- a/spec/ruby/core/process/clock_gettime_spec.rb +++ b/spec/ruby/core/process/clock_gettime_spec.rb @@ -2,13 +2,19 @@ require_relative '../../spec_helper' 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) |