Add source based coverage for the extension#139
Closed
jaisnan wants to merge 9 commits intomodel-checking:mainfrom
Closed
Add source based coverage for the extension#139jaisnan wants to merge 9 commits intomodel-checking:mainfrom
jaisnan wants to merge 9 commits intomodel-checking:mainfrom
Conversation
celinval
approved these changes
Nov 16, 2024
| return path.relative(workspaceFolder.uri.fsPath, fullPath); | ||
| } | ||
|
|
||
| // If not in a workspace, return the full path |
Contributor
There was a problem hiding this comment.
will this be affected by model-checking/kani#2681?
| const playbackCommand: string = `${kaniBinaryPath} --coverage -Z line-coverage --harness ${functionName}`; | ||
| // Run this command: cargo kani --coverage -Z source-coverage --harness verify_success | ||
| // to generate the source coverage output | ||
| const playbackCommand: string = `${kaniBinaryPath} --coverage -Z source-coverage --harness ${functionName}`; |
Contributor
There was a problem hiding this comment.
s/playbackCommand/coverageCommand
Contributor
|
Code coverage is currently broken, and this PR should fix it. We need to rebase this and test to see if it still works as expected. @jaisnan just checking if you are still planning to do this, or should we find a new owner? Thanks! |
|
Closing in favor of #145. |
tautschnig
pushed a commit
that referenced
this pull request
Mar 11, 2025
Updates the extension to use source-based coverage instead of line-based coverage. See #139 for screenshots of how it looks. 1. [a2e37a5](a2e37a5) just applies the changes from #139 in a single commit, rebased on top of main. 2. [e2e3a40](e2e3a40) changes the extension to show the "Get coverage info" button automatically. Before, our documentation instructed a user to [go to settings to enable the button](https://github.com/carolynzech/kani-vscode-extension/blob/25489e8ad813f965428608870426f8e7b2ed35c8/docs/user-guide.md?plain=1#L82). I couldn't find the setting to do that, and I figured if I couldn't find it, our users wouldn't be able to either. I also don't think it makes sense to hide it behind a setting. We can print the warning that it's unstable, but the green/red coverage visual is one of the strongest arguments for using the Kani extension instead of the command line, so we should have this feature front and center. 3. [69f376b](69f376b) just removes comments and unused code. 4. [8a99568](8a99568) updates the documentation to reflect the shift from line-based to source-based coverage, and the removal of the toggle option from [e2e3a40](e2e3a40). 5. [05d0246](05d0246) introduces more custom types, so that we use those instead of any types.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of changes:
Kani's source coverage changes the output parsing logic and the highlighting components. This PR fixes the broken integration.
Call-outs:
Some screenshots:

Testing:
How is this change tested?
Tested manually
Is this a refactor change?
No
Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT licenses.