Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure main file has default coverage if required. #7169

Merged
merged 2 commits into from Jan 21, 2023

Conversation

ioquatix
Copy link
Member

@ioquatix ioquatix commented Jan 21, 2023

@ioquatix ioquatix merged commit 2c93c55 into ruby:master Jan 21, 2023
@ioquatix ioquatix deleted the fix-coverage-of-main-file branch January 21, 2023 21:52
{
VALUE coverages = rb_get_coverages();

if (RTEST(coverages)) {
iseq_setup_coverage(coverages, path, ast, 0);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ioquatix Maybe you meant line_offset instead of 0? The parameter is not used. (I would be happy if you'll give me time to review it :-)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, yeah it looks like a mistake. Sorry about not giving enough time for a review, I appreciate your feedback.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nurse added a commit to nurse/ruby that referenced this pull request Jan 25, 2023
…Backport #19360]

	Ensure main file has default coverage if required. (ruby#7169)

	* Extract common code for coverage setup.
	---
	 iseq.c | 13 +++++++++++--
	 1 file changed, 11 insertions(+), 2 deletions(-)

	More coverage tests & specs. (ruby#7171)

	* Add spec for eval and line coverage.

	* Add test for main file coverage.
	---
	 spec/ruby/library/coverage/start_spec.rb | 8 +++++++-
	 test/coverage/autostart.rb               | 2 ++
	 test/coverage/main.rb                    | 1 +
	 test/coverage/test_coverage.rb           | 7 +++++++
	 4 files changed, 17 insertions(+), 1 deletion(-)
	 create mode 100644 test/coverage/autostart.rb
	 create mode 100644 test/coverage/main.rb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants