diff options
author | eregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-12-30 17:47:56 +0000 |
---|---|---|
committer | eregon <eregon@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-12-30 17:47:56 +0000 |
commit | eeedf7d57a4648fcfb75a54023c889fca3e78a3d (patch) | |
tree | defebd2e5af5c64d45b210b70f9e68238931f676 /spec/ruby/core/process/clock_gettime_spec.rb | |
parent | a46ce26870d8a758c596b95695429e177069f011 (diff) | |
download | ruby-eeedf7d57a4648fcfb75a54023c889fca3e78a3d.tar.gz |
Revert "clock_gettime_spec.rb: exclude invalid clocks for Solaris"
* This reverts commit a7edd05f7dca44f56fd72d7bcc232e1b27df0eb3.
* 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
Diffstat (limited to 'spec/ruby/core/process/clock_gettime_spec.rb')
-rw-r--r-- | spec/ruby/core/process/clock_gettime_spec.rb | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/spec/ruby/core/process/clock_gettime_spec.rb b/spec/ruby/core/process/clock_gettime_spec.rb index 56d75a04c9..b690186ac3 100644 --- a/spec/ruby/core/process/clock_gettime_spec.rb +++ b/spec/ruby/core/process/clock_gettime_spec.rb @@ -2,19 +2,13 @@ require_relative '../../spec_helper' describe "Process.clock_gettime" 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(), # they return EINVAL if the permission is not granted. - :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| + 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) |