mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
clock_gettime_spec.rb: exclude invalid clocks for Solaris
20181230
T041806Z.fail.html.gz20181230
T042407Z.fail.html.gz20181230
T032505Z.fail.html.gz20181230
T022505Z.fail.html.gz git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66650 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
f110ebfd14
commit
a7edd05f7d
1 changed files with 11 additions and 5 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue