Exclude CLOCKs which require special permissions in Process.clock_gettime specs

* https://rubyci.org/logs/rubyci.s3.amazonaws.com/scw-ad7f67/ruby-trunk/log/20181229T135406Z.fail.html.gz
* https://rubyci.org/logs/rubyci.s3.amazonaws.com/rhel_zlinux/ruby-trunk/log/20181229T143303Z.fail.html.gz

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66641 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
eregon 2018-12-29 21:54:45 +00:00
Родитель 94f4a0e91e
Коммит be8d3ed1fd
1 изменённых файлов: 7 добавлений и 4 удалений

Просмотреть файл

@ -1,11 +1,14 @@
require_relative '../../spec_helper'
describe "Process.clock_gettime" do
# This does not succeed with some platforms:
# RHEL: https://rubyci.org/logs/rubyci.s3.amazonaws.com/rhel_zlinux/ruby-trunk/log/20181229T063303Z.fail.html.gz
# Solaris: https://rubyci.org/logs/rubyci.s3.amazonaws.com/unstable11x/ruby-trunk/log/20181229T002409Z.fail.html.gz
platform_is_not :windows, :solaris do
Process.constants.select { |c| c.to_s.start_with?('CLOCK_') }.each do |c|
Process.constants.select { |c|
c.to_s.start_with?('CLOCK_') &&
# 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|
it "can be called with Process::#{c}" do
value = Process.const_get(c)
Process.clock_gettime(value).should be_an_instance_of(Float)