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

--show-snippets with default true and off in tests #4087

Merged
merged 88 commits into from
Jun 20, 2023

Conversation

davidcok
Copy link
Collaborator

@davidcok davidcok commented May 26, 2023

Adjusts the tests so that if --show-snippets is on by default, the tests do not fail.
Also sets --show-snippets on by default.

By submitting this pull request, I confirm that my contribution is made under the terms of the MIT license.

@davidcok davidcok changed the title --show-snippet with default true and off in tests --show-snippets with default true and off in tests May 29, 2023
@keyboardDrummer
Copy link
Member

I'm OK with this change, but requested some others to review as well.

@davidcok davidcok enabled auto-merge (squash) June 13, 2023 15:23
@@ -379,11 +380,11 @@ do
else
if [ "$command" == "%check-legacy" ]; then
isverbose=-compileVerbose:$checkIds
(cd "$dir"; "$dafny" $verb $dOptions $isverbose ${options[@]} $text ) > "$actualOut" 2> "$actualError"
(cd "$dir"; "$dafny" $verb /showSnippets:0 $dOptions $isverbose ${options[@]} $text ) > "$actualOut" 2> "$actualError"
Copy link
Member

Choose a reason for hiding this comment

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

@keyboardDrummer This looks suspicious, it should probably be --show-snippets:false

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

$verb is always empty at this point -- this is the branch for legacy CLI tests. SO it is correct, but perhaps $verb could be removed.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Removed $verb on this line to avoid confusion.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

And tests now pass after nightlies have been fixed. Mikael - can you approve now?

Copy link
Member

@robin-aws robin-aws left a comment

Choose a reason for hiding this comment

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

I'm fine with changing the default here since most users aren't going to be parsing console output, and even if they are broken by this it's just a matter of adding --show-snippets:false.

But on that note, do add a release note to explicitly call this change out, so it's easier for users to spot it.

(not explicitly requesting changes so another reviewer is free to approve once this is done)

@davidcok
Copy link
Collaborator Author

davidcok commented Jun 20, 2023 via email

@@ -0,0 +1 @@
errors issued in command-line mode now show source code context by default; this behavior can be disabled using the option --show-snippets:false.
Copy link
Member

Choose a reason for hiding this comment

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

I would phrase this as "Errors emitted by the command-line interface". "Mode" seems like a strange concept here, since the IDE and CLI are so different as an experience, I wouldn't describe them as two different modes.

@davidcok davidcok merged commit 218afa4 into dafny-lang:master Jun 20, 2023
@davidcok davidcok deleted the cok-3304-show-snippet-2 branch June 20, 2023 11:31
RustanLeino added a commit that referenced this pull request Jun 30, 2023
A recent change (#4087) explicitly turned on snippets in `lit`-based
testing. The change causes many tests to fail, when run using `lit`.
This PR turns them back off.


<small>By submitting this pull request, I confirm that my contribution
is made under the terms of the [MIT
license](https://github.com/dafny-lang/dafny/blob/master/LICENSE.txt).</small>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants