зеркало из https://github.com/github/ruby.git
Revert "clock_gettime_spec.rb: exclude invalid clocks for Solaris"
* This reverts commit a7edd05f7d
.
* I prefer to exclude Solaris, I want to keep testing these clocks on Linux/macOS.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66655 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
a46ce26870
Коммит
eeedf7d57a
|
@ -2,19 +2,13 @@ require_relative '../../spec_helper'
|
||||||
|
|
||||||
describe "Process.clock_gettime" do
|
describe "Process.clock_gettime" do
|
||||||
platform_is_not :windows do
|
platform_is_not :windows do
|
||||||
invalid_clocks = [
|
Process.constants.select { |c|
|
||||||
|
c.to_s.start_with?('CLOCK_') &&
|
||||||
# These require CAP_WAKE_ALARM and are not documented in clock_gettime(),
|
# These require CAP_WAKE_ALARM and are not documented in clock_gettime(),
|
||||||
# they return EINVAL if the permission is not granted.
|
# they return EINVAL if the permission is not granted.
|
||||||
:CLOCK_BOOTTIME_ALARM,
|
c != :CLOCK_BOOTTIME_ALARM &&
|
||||||
:CLOCK_REALTIME_ALARM,
|
c != :CLOCK_REALTIME_ALARM
|
||||||
# These don't work on Solaris
|
}.each do |c|
|
||||||
: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
|
it "can be called with Process::#{c}" do
|
||||||
value = Process.const_get(c)
|
value = Process.const_get(c)
|
||||||
Process.clock_gettime(value).should be_an_instance_of(Float)
|
Process.clock_gettime(value).should be_an_instance_of(Float)
|
||||||
|
|
Загрузка…
Ссылка в новой задаче