-
Notifications
You must be signed in to change notification settings - Fork 262
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
Allow the :test attribute when using run and build #3275
Allow the :test attribute when using run and build #3275
Conversation
@@ -3390,7 +3390,7 @@ private class CSharpCompilationResult { | |||
} | |||
|
|||
private void AddTestCheckerIfNeeded(string name, Declaration decl, ConcreteSyntaxTree wr) { | |||
if (DafnyOptions.O.RunAllTests || !Attributes.Contains(decl.Attributes, "test")) { | |||
if (DafnyOptions.O.Compile || DafnyOptions.O.RunAllTests || !Attributes.Contains(decl.Attributes, "test")) { |
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.
Just checking that the intended behavior is that methods marked {:test} are only compiled when testing
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.
They're always compiled when compiling, but the C# XUnit.Fact
attribute is only added when using dafny translate
.
@"In case the Dafny source code is translated to another language, emit that translation.") { | ||
IsHidden = true | ||
}; | ||
|
||
public static readonly Option<bool> UseBaseFileName = new("--use-basename-for-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.
There are instances of the old spelling that ought to be changed concurrently (even if the old spelling still works):
grep -r -e '--useBaseNameForFileName' ../.. | grep -v Binary
../../Test/lit.site.cfg:'--useBaseNameForFileName',
../../Source/DafnyDriver/DafnyDriver.cs: "--useBaseNameForFileName",
../../Source/DafnyCore/Options/DeveloperOptionBag.cs: public static readonly Option UseBaseFileName = new("--useBaseNameForFileName",
../../Source/IntegrationTests/bin/Debug/net6.0/TestFiles/LitTests/LitTest/lit.site.cfg:'--useBaseNameForFileName',
../../Source/IntegrationTests/bin/Debug/net6.0/TestFiles/LitTests/LitTest/lit.site.cfg:config.substitutions.append( ('%resolveargs', "--useBaseNameForFileName" ) )
../../docs/check-examples:## "dafny verify --useBaseNameForFileName $F" and checks
../../docs/check-examples:## "dafny resolve --useBaseNameForFileName $F" and checks
../../docs/check-examples:## "dafny run --useBaseNameForFileName $F" and,
../../docs/check-examples: "$dafny" $com --useBaseNameForFileName $options $text > actual
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.
Seems like this grep was not done on this PR. I only see three occurrences in comments (that have been resolved now)
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.
My mistake, and I was also looking a a stale list of changes...
Thanks for making this option consistently spelled.
Fixes dafny-lang#3260 Also adds a hidden `--spill-translation` attribute for the `run`,`build` and `test` commands. <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>
Fixes #3260
Also adds a hidden
--spill-translation
attribute for therun
,build
andtest
commands.By submitting this pull request, I confirm that my contribution is made under the terms of the MIT license.