-
Notifications
You must be signed in to change notification settings - Fork 99
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
A few output improvements #976
Conversation
tests/ui/code-location/expected
Outdated
@@ -0,0 +1,7 @@ | |||
module/mod.rs:10:5 in function module::not_empty | |||
main.rs:13:5 in function same_file | |||
~/.rustup/toolchains |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not confident we should include this expectation, but this prevents us from inadvertently use remapped
path. Open to suggestions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RUSTUP_HOME
can be overriden (see https://rust-lang.github.io/rustup/environment-variables.html), so in the current form, the test may fail for users who override it.
If you're trying to make sure the path is not of the form: /rustc/1eb72580d076935a3e590deb6e5813a5aef3eca4/library/core/src/mem/mod.rs
, perhaps just check for toolchains/nightly-
?
Could you add some screenshot or add an example output improvement to the description of this PR? (Maybe the same example as the test file so it's easier to suggest what to add to the expected file) |
|
||
pub fn assertion_reach_checks(&self) -> bool { | ||
// Turn them off when visualizing an error trace. | ||
!self.no_assertion_reach_checks && !self.visualize |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. I've been meaning to fix that.
scripts/cbmc_json_parser.py
Outdated
if not self.filename: | ||
return None | ||
|
||
if not path.exists(self.filename): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this necessary for what comes after? Checking if the file exists can be expensive (since it involves an OS/filesystem operation) which can slow things down quite a bit if we're checking the path for every check.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought that this fixed an issue that I saw before, but I couldn't reproduce it. So I'm removing this. :)
I added a few tests to hopefully ensure that I didn't miss anything.
tests/ui/code-location/expected
Outdated
@@ -0,0 +1,7 @@ | |||
module/mod.rs:10:5 in function module::not_empty | |||
main.rs:13:5 in function same_file | |||
~/.rustup/toolchains |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
RUSTUP_HOME
can be overriden (see https://rust-lang.github.io/rustup/environment-variables.html), so in the current form, the test may fail for users who override it.
If you're trying to make sure the path is not of the form: /rustc/1eb72580d076935a3e590deb6e5813a5aef3eca4/library/core/src/mem/mod.rs
, perhaps just check for toolchains/nightly-
?
Should we make it relative to the project dir instead??
Unfortunately, the output changes depending on the directory where the regression is running from, so we cannot check that logic.
9607350
to
25bca14
Compare
scripts/test_parser.py
Outdated
@@ -0,0 +1,102 @@ | |||
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | |||
# SPDX-License-Identifier: Apache-2.0 OR MIT | |||
import unittest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Much needed! Thanks for adding this unit test module!
Nit: should we renamed it to test_cbmc_parser.py
to make it more clear?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure
* Disable reach assertions in visualize mode * Make file location relative to current dir * Add unit tests
* Disable reach assertions in visualize mode * Make file location relative to current dir * Add unit tests
* Disable reach assertions in visualize mode * Make file location relative to current dir * Add unit tests
* Disable reach assertions in visualize mode * Make file location relative to current dir * Add unit tests
Description of changes:
Resolved issues:
Call-outs:
Here is an example of the new output:
Testing:
How is this change tested?
Is this a refactor change?
Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT licenses.