ruby-changes:54440
From: eregon <ko1@a...>
Date: Mon, 31 Dec 2018 02:48:00 +0900 (JST)
Subject: [ruby-changes:54440] eregon:r66655 (trunk): Revert "clock_gettime_spec.rb: exclude invalid clocks for Solaris"
eregon 2018-12-31 02:47:56 +0900 (Mon, 31 Dec 2018) New Revision: 66655 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=66655 Log: 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. Modified files: trunk/spec/ruby/core/process/clock_gettime_spec.rb Index: spec/ruby/core/process/clock_gettime_spec.rb =================================================================== --- spec/ruby/core/process/clock_gettime_spec.rb (revision 66654) +++ spec/ruby/core/process/clock_gettime_spec.rb (revision 66655) @@ -2,19 +2,13 @@ require_relative '../../spec_helper' https://github.com/ruby/ruby/blob/trunk/spec/ruby/core/process/clock_gettime_spec.rb#L2 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) -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/