From a1b4816759418ca8fe510e8739622fc5d77ab0f0 Mon Sep 17 00:00:00 2001 From: Benoit Daloze Date: Sat, 27 Apr 2019 18:53:23 +0200 Subject: Update to ruby/spec@15c9619 --- spec/ruby/core/process/fixtures/clocks.rb | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 spec/ruby/core/process/fixtures/clocks.rb (limited to 'spec/ruby/core/process/fixtures/clocks.rb') diff --git a/spec/ruby/core/process/fixtures/clocks.rb b/spec/ruby/core/process/fixtures/clocks.rb new file mode 100644 index 0000000000..5f45e8065b --- /dev/null +++ b/spec/ruby/core/process/fixtures/clocks.rb @@ -0,0 +1,24 @@ +module ProcessSpecs + def self.clock_constants + clocks = [] + + platform_is_not :windows, :solaris do + clocks += Process.constants.select { |c| c.to_s.start_with?('CLOCK_') } + + # These require CAP_WAKE_ALARM and are not documented in + # Process#clock_gettime they return EINVAL if the permission + # is not granted. + clocks -= [:CLOCK_BOOTTIME_ALARM, :CLOCK_REALTIME_ALARM] + + # These clocks in practice on Linux do not seem to match + # their reported resolution. + clocks -= [:CLOCK_REALTIME_COARSE, :CLOCK_MONOTONIC_COARSE] + + clocks.map! { |c| + [c, Process.const_get(c)] + } + end + + clocks + end +end -- cgit v1.2.3