diff options
Diffstat (limited to 'spec/ruby/core/process/fixtures')
| -rw-r--r-- | spec/ruby/core/process/fixtures/argv0.rb | 6 | ||||
| -rw-r--r-- | spec/ruby/core/process/fixtures/clocks.rb | 44 | ||||
| -rw-r--r-- | spec/ruby/core/process/fixtures/kill.rb | 2 |
3 files changed, 7 insertions, 45 deletions
diff --git a/spec/ruby/core/process/fixtures/argv0.rb b/spec/ruby/core/process/fixtures/argv0.rb new file mode 100644 index 0000000000..847a3e903e --- /dev/null +++ b/spec/ruby/core/process/fixtures/argv0.rb @@ -0,0 +1,6 @@ +puts Process.argv0 +puts __FILE__ + +if Process.argv0 == __FILE__ + print "OK" +end diff --git a/spec/ruby/core/process/fixtures/clocks.rb b/spec/ruby/core/process/fixtures/clocks.rb index 7537cfaba8..5757e280be 100644 --- a/spec/ruby/core/process/fixtures/clocks.rb +++ b/spec/ruby/core/process/fixtures/clocks.rb @@ -2,7 +2,7 @@ module ProcessSpecs def self.clock_constants clocks = [] - platform_is_not :windows, :solaris do + platform_is_not :windows do clocks += Process.constants.select { |c| c.to_s.start_with?('CLOCK_') } # These require CAP_WAKE_ALARM and are not documented in @@ -15,46 +15,4 @@ module ProcessSpecs [c, Process.const_get(c)] } end - - def self.clock_constants_for_resolution_checks - clocks = clock_constants - - # These clocks in practice on Linux do not seem to match their reported resolution. - platform_is :linux do - clocks = clocks.reject { |clock, value| - [:CLOCK_REALTIME_COARSE, :CLOCK_MONOTONIC_COARSE].include?(clock) - } - end - - # These clocks in practice on macOS seem to be less precise than advertised by clock_getres - platform_is :darwin do - clocks = clocks.reject { |clock, value| - [:CLOCK_UPTIME_RAW_APPROX, :CLOCK_MONOTONIC_RAW_APPROX].include?(clock) - } - end - - # These clocks in practice on ARM on Linux do not seem to match their reported resolution. - platform_is :armv7, :armv8, :aarch64 do - clocks = clocks.reject { |clock, value| - [:CLOCK_PROCESS_CPUTIME_ID, :CLOCK_THREAD_CPUTIME_ID, :CLOCK_MONOTONIC_RAW].include?(clock) - } - end - - # These clocks in practice on AIX seem to be more precise than their reported resolution. - platform_is :aix do - clocks = clocks.reject { |clock, value| - [:CLOCK_REALTIME, :CLOCK_MONOTONIC].include?(clock) - } - end - - # On a Hyper-V Linux guest machine, these clocks in practice - # seem to be less precise than advertised by clock_getres - platform_is :linux do - clocks = clocks.reject { |clock, value| - clock == :CLOCK_MONOTONIC_RAW - } - end - - clocks - end end diff --git a/spec/ruby/core/process/fixtures/kill.rb b/spec/ruby/core/process/fixtures/kill.rb index 0b88f8ee1f..b922a043f1 100644 --- a/spec/ruby/core/process/fixtures/kill.rb +++ b/spec/ruby/core/process/fixtures/kill.rb @@ -1,5 +1,3 @@ -require 'thread' - pid_file = ARGV.shift scenario = ARGV.shift |
