ruptr 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,57 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Ruptr
4
+ module_function
5
+
6
+ def measure_real_time
7
+ t = Time.now
8
+ yield
9
+ Time.now - t
10
+ end
11
+
12
+ def measure_processor_time
13
+ t = Process.times
14
+ yield
15
+ tt = Process.times
16
+ [(tt.utime + tt.cutime) - (t.utime + t.cutime),
17
+ (tt.stime + tt.cstime) - (t.stime + t.cstime)]
18
+ end
19
+
20
+ def measure_processor_and_real_time(&)
21
+ p = nil
22
+ t = measure_real_time { p = measure_processor_time(&) }
23
+ p << t
24
+ end
25
+
26
+ def at_normal_exit
27
+ at_exit { yield if $!.nil? || ($!.is_a?(SystemExit) && $!.success?) }
28
+ end
29
+
30
+ def fork_piped_worker
31
+ child_read_io, parent_write_io = IO.pipe
32
+ begin
33
+ parent_read_io, child_write_io = IO.pipe
34
+ rescue
35
+ child_read_io.close
36
+ parent_write_io.close
37
+ raise
38
+ end
39
+ begin
40
+ begin
41
+ pid = Process.fork do
42
+ parent_read_io.close
43
+ parent_write_io.close
44
+ yield child_read_io, child_write_io
45
+ end
46
+ ensure
47
+ child_read_io.close
48
+ child_write_io.close
49
+ end
50
+ rescue
51
+ parent_read_io.close
52
+ parent_write_io.close
53
+ raise
54
+ end
55
+ [pid, parent_read_io, parent_write_io]
56
+ end
57
+ end
metadata ADDED
@@ -0,0 +1,77 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: ruptr
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.3
5
+ platform: ruby
6
+ authors:
7
+ - Mathieu
8
+ bindir: bin
9
+ cert_chain: []
10
+ date: 2025-02-22 00:00:00.000000000 Z
11
+ dependencies: []
12
+ email: sigsys@gmail.com
13
+ executables:
14
+ - ruptr
15
+ extensions: []
16
+ extra_rdoc_files: []
17
+ files:
18
+ - bin/ruptr
19
+ - lib/ruptr/adapters.rb
20
+ - lib/ruptr/adapters/assertions.rb
21
+ - lib/ruptr/adapters/rr.rb
22
+ - lib/ruptr/adapters/rspec_expect.rb
23
+ - lib/ruptr/adapters/rspec_mocks.rb
24
+ - lib/ruptr/assertions.rb
25
+ - lib/ruptr/autorun.rb
26
+ - lib/ruptr/capture_output.rb
27
+ - lib/ruptr/compat.rb
28
+ - lib/ruptr/exceptions.rb
29
+ - lib/ruptr/formatter.rb
30
+ - lib/ruptr/golden_master.rb
31
+ - lib/ruptr/instance.rb
32
+ - lib/ruptr/main.rb
33
+ - lib/ruptr/minitest.rb
34
+ - lib/ruptr/minitest/override.rb
35
+ - lib/ruptr/plain.rb
36
+ - lib/ruptr/progress.rb
37
+ - lib/ruptr/rake_task.rb
38
+ - lib/ruptr/report.rb
39
+ - lib/ruptr/result.rb
40
+ - lib/ruptr/rspec.rb
41
+ - lib/ruptr/rspec/configuration.rb
42
+ - lib/ruptr/rspec/example_group.rb
43
+ - lib/ruptr/rspec/override.rb
44
+ - lib/ruptr/runner.rb
45
+ - lib/ruptr/sink.rb
46
+ - lib/ruptr/stringified.rb
47
+ - lib/ruptr/suite.rb
48
+ - lib/ruptr/surrogate_exception.rb
49
+ - lib/ruptr/tabular.rb
50
+ - lib/ruptr/tap.rb
51
+ - lib/ruptr/testunit.rb
52
+ - lib/ruptr/testunit/override.rb
53
+ - lib/ruptr/timing_cache.rb
54
+ - lib/ruptr/tty_colors.rb
55
+ - lib/ruptr/utils.rb
56
+ licenses:
57
+ - MIT
58
+ metadata: {}
59
+ rdoc_options: []
60
+ require_paths:
61
+ - lib
62
+ required_ruby_version: !ruby/object:Gem::Requirement
63
+ requirements:
64
+ - - ">="
65
+ - !ruby/object:Gem::Version
66
+ version: '3.1'
67
+ required_rubygems_version: !ruby/object:Gem::Requirement
68
+ requirements:
69
+ - - ">="
70
+ - !ruby/object:Gem::Version
71
+ version: '0'
72
+ requirements: []
73
+ rubygems_version: 3.6.3
74
+ specification_version: 4
75
+ summary: RUby Parallel Test Runner, partially compatible with RSpec, Test::Unit and
76
+ Minitest
77
+ test_files: []