ruby-coverage 0.1.1 → 0.1.2
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.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/ext/extconf.rb +1 -1
- data/ext/ruby/coverage/tracer.c +3 -3
- data/lib/ruby/coverage/version.rb +1 -1
- data/readme.md +39 -34
- data/releases.md +19 -0
- data.tar.gz.sig +0 -0
- metadata +1 -1
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 93f33127bec2d7de586f680a5acf8f503b36aa8e7ee2df6eea853e92ebd729ae
|
|
4
|
+
data.tar.gz: aa04f0bba17db2605b2a6991f5d74d77ca298a4683f191314f40498c829bab7e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: '0517386659ee37d81045946119c8a4bbbdccbe7d529e1345cb8316d15e47886a8da4674bbe968aedd4ffdebe2d77b5cea502b73c29e091af65894f0f3e7418e4'
|
|
7
|
+
data.tar.gz: 3c52e2649e49a8d92a42c484249b5c91c918901bceb534757c61590c07765484a789b357460b904828ffec2b0e86c00900d7a6f31a0013c4cfedc162af59cbc2
|
checksums.yaml.gz.sig
CHANGED
|
Binary file
|
data/ext/extconf.rb
CHANGED
|
@@ -27,7 +27,7 @@ if ENV.key?("RUBY_SANITIZE")
|
|
|
27
27
|
$LDFLAGS << " -fsanitize=address -fsanitize=undefined"
|
|
28
28
|
end
|
|
29
29
|
|
|
30
|
-
have_func("rb_tracearg_instruction_sequence", "ruby/debug.h")
|
|
30
|
+
have_func("rb_tracearg_instruction_sequence((rb_trace_arg_t *)0)", "ruby/debug.h")
|
|
31
31
|
|
|
32
32
|
create_header
|
|
33
33
|
|
data/ext/ruby/coverage/tracer.c
CHANGED
|
@@ -291,9 +291,6 @@ static void Ruby_Coverage_Tracer_on_line(VALUE data, const rb_trace_arg_t *trace
|
|
|
291
291
|
|
|
292
292
|
static VALUE Ruby_Coverage_Tracer_start(VALUE self)
|
|
293
293
|
{
|
|
294
|
-
struct Ruby_Coverage_Tracer *tracer;
|
|
295
|
-
TypedData_Get_Struct(self, struct Ruby_Coverage_Tracer, &Ruby_Coverage_Tracer_type, tracer);
|
|
296
|
-
|
|
297
294
|
#ifdef HAVE_RB_TRACEARG_INSTRUCTION_SEQUENCE
|
|
298
295
|
rb_add_event_hook2(
|
|
299
296
|
(rb_event_hook_func_t)Ruby_Coverage_Tracer_on_script_compiled,
|
|
@@ -302,6 +299,9 @@ static VALUE Ruby_Coverage_Tracer_start(VALUE self)
|
|
|
302
299
|
RUBY_EVENT_HOOK_FLAG_SAFE | RUBY_EVENT_HOOK_FLAG_RAW_ARG
|
|
303
300
|
);
|
|
304
301
|
#else
|
|
302
|
+
struct Ruby_Coverage_Tracer *tracer;
|
|
303
|
+
TypedData_Get_Struct(self, struct Ruby_Coverage_Tracer, &Ruby_Coverage_Tracer_type, tracer);
|
|
304
|
+
|
|
305
305
|
if (NIL_P(tracer->script_compiled_tracepoint)) {
|
|
306
306
|
RB_OBJ_WRITE(self, &tracer->script_compiled_tracepoint,
|
|
307
307
|
rb_tracepoint_new(Qnil, RUBY_EVENT_SCRIPT_COMPILED,
|
data/readme.md
CHANGED
|
@@ -8,7 +8,7 @@ A native reimplementation of Ruby's built-in `Coverage` module, backed by `rb_ad
|
|
|
8
8
|
|
|
9
9
|
Ruby's built-in `Coverage` module ties its counter store to the ISeq. When a file is re-evaluated under the same path — for example when a test framework loads a file into a fresh anonymous module via `module_eval` — Ruby allocates a fresh counter array and discards the previous one. Any coverage accumulated before the re-eval is lost.
|
|
10
10
|
|
|
11
|
-
`Ruby::Coverage` owns its own counter store. Re-evaluating a file under the same path simply continues incrementing the same counters
|
|
11
|
+
`Ruby::Coverage` owns its own counter store. Re-evaluating a file under the same path simply continues incrementing the same counters, which gives path-oriented reporting tools stable results when test suites load files multiple times. In addition, multiple `Ruby::Coverage::Tracer` instances can be active at the same time, so tools can collect independent coverage streams such as per-test coverage without fighting over Ruby's global `Coverage` state.
|
|
12
12
|
|
|
13
13
|
## Usage
|
|
14
14
|
|
|
@@ -16,56 +16,61 @@ Please see the [project documentation](https://socketry.github.io/ruby-coverage/
|
|
|
16
16
|
|
|
17
17
|
- [Getting Started](https://socketry.github.io/ruby-coverage/guides/getting-started/index) - This guide explains how to use `ruby-coverage` to collect coverage for code that may be evaluated multiple times under the same path.
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
## Releases
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
require "ruby/coverage"
|
|
21
|
+
Please see the [project releases](https://socketry.github.io/ruby-coverage/releases/index) for all releases.
|
|
23
22
|
|
|
24
|
-
|
|
23
|
+
### v0.1.2
|
|
25
24
|
|
|
26
|
-
|
|
25
|
+
- Fix native extension builds on Windows when `rb_tracearg_instruction_sequence` is not declared by Ruby's public headers, and avoid an unused variable compiler warning.
|
|
27
26
|
|
|
28
|
-
|
|
29
|
-
# => { "/path/to/file.rb" => { lines: [nil, 3, 1, nil, 0, ...] }, ... }
|
|
30
|
-
```
|
|
27
|
+
### v0.1.1
|
|
31
28
|
|
|
32
|
-
|
|
29
|
+
- Fix an unused variable compiler warning in the native extension.
|
|
33
30
|
|
|
34
|
-
|
|
31
|
+
### v0.1.0
|
|
35
32
|
|
|
36
|
-
|
|
33
|
+
- Improve line-count performance by resizing coverage count arrays in one step.
|
|
34
|
+
- Improve the line-count hot path by updating the internal count array directly while keeping counts as saturated Fixnums.
|
|
35
|
+
- Support accumulating coverage counts independently of Ruby's standard `Coverage` module.
|
|
36
|
+
- Use raw trace arguments for line coverage where available.
|
|
37
|
+
- Add benchmark coverage for tracer load and hot-loop overhead, including comparisons with Ruby's standard `Coverage` module.
|
|
38
|
+
- Improve test coverage around count preparation and subprocess coverage collection.
|
|
37
39
|
|
|
38
|
-
|
|
39
|
-
files = {}
|
|
40
|
+
### v0.0.1
|
|
40
41
|
|
|
41
|
-
|
|
42
|
-
# Accumulate across re-evals of the same path:
|
|
43
|
-
files[path] ||= []
|
|
44
|
-
end
|
|
42
|
+
- Initial release.
|
|
45
43
|
|
|
46
|
-
|
|
47
|
-
# ... run tests ...
|
|
48
|
-
tracer.stop
|
|
44
|
+
## Contributing
|
|
49
45
|
|
|
50
|
-
|
|
51
|
-
|
|
46
|
+
We welcome contributions to this project.
|
|
47
|
+
|
|
48
|
+
1. Fork it.
|
|
49
|
+
2. Create your feature branch (`git checkout -b my-new-feature`).
|
|
50
|
+
3. Commit your changes (`git commit -am 'Add some feature'`).
|
|
51
|
+
4. Push to the branch (`git push origin my-new-feature`).
|
|
52
|
+
5. Create new Pull Request.
|
|
52
53
|
|
|
53
|
-
|
|
54
|
+
### Running Tests
|
|
54
55
|
|
|
55
|
-
|
|
56
|
+
To run the test suite:
|
|
56
57
|
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
gem "ruby-coverage"
|
|
60
|
-
gem "covered"
|
|
58
|
+
``` shell
|
|
59
|
+
bundle exec sus
|
|
61
60
|
```
|
|
62
61
|
|
|
63
|
-
|
|
62
|
+
### Making Releases
|
|
64
63
|
|
|
65
|
-
|
|
64
|
+
To make a new release:
|
|
66
65
|
|
|
67
|
-
|
|
66
|
+
``` shell
|
|
67
|
+
bundle exec bake gem:release:patch # or minor or major
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### Developer Certificate of Origin
|
|
71
|
+
|
|
72
|
+
In order to protect users of this project, we require all contributors to comply with the [Developer Certificate of Origin](https://developercertificate.org/). This ensures that all contributions are properly licensed and attributed.
|
|
68
73
|
|
|
69
|
-
|
|
74
|
+
### Community Guidelines
|
|
70
75
|
|
|
71
|
-
|
|
76
|
+
This project is best served by a collaborative and respectful environment. Treat each other professionally, respect differing viewpoints, and engage constructively. Harassment, discrimination, or harmful behavior is not tolerated. Communicate clearly, listen actively, and support one another. If any issues arise, please inform the project maintainers.
|
data/releases.md
CHANGED
|
@@ -1,3 +1,22 @@
|
|
|
1
1
|
# Releases
|
|
2
2
|
|
|
3
|
+
## v0.1.2
|
|
4
|
+
|
|
5
|
+
- Fix native extension builds on Windows when `rb_tracearg_instruction_sequence` is not declared by Ruby's public headers, and avoid an unused variable compiler warning.
|
|
6
|
+
|
|
7
|
+
## v0.1.1
|
|
8
|
+
|
|
9
|
+
- Fix an unused variable compiler warning in the native extension.
|
|
10
|
+
|
|
11
|
+
## v0.1.0
|
|
12
|
+
|
|
13
|
+
- Improve line-count performance by resizing coverage count arrays in one step.
|
|
14
|
+
- Improve the line-count hot path by updating the internal count array directly while keeping counts as saturated Fixnums.
|
|
15
|
+
- Support accumulating coverage counts independently of Ruby's standard `Coverage` module.
|
|
16
|
+
- Use raw trace arguments for line coverage where available.
|
|
17
|
+
- Add benchmark coverage for tracer load and hot-loop overhead, including comparisons with Ruby's standard `Coverage` module.
|
|
18
|
+
- Improve test coverage around count preparation and subprocess coverage collection.
|
|
19
|
+
|
|
3
20
|
## v0.0.1
|
|
21
|
+
|
|
22
|
+
- Initial release.
|
data.tar.gz.sig
CHANGED
|
Binary file
|
metadata
CHANGED
metadata.gz.sig
CHANGED
|
Binary file
|