Skip to content

Commit

Permalink
Rename --coverage-report to --expected-coverage-report (#5301)
Browse files Browse the repository at this point in the history
### Description
Rename --coverage-report to --expected-coverage-report

### How has this been tested?
Updated CLI test

<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>
  • Loading branch information
keyboardDrummer committed Apr 9, 2024
1 parent b292647 commit a2004d2
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Source/DafnyDriver/Commands/DeadCodeCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ static class DeadCodeCommand {
new Option[] {
GenerateTestsCommand.LoopUnroll,
GenerateTestsCommand.SequenceLengthLimit,
GenerateTestsCommand.CoverageReport,
GenerateTestsCommand.ExpectedCoverageReport,
GenerateTestsCommand.ForcePrune,
GenerateTestsCommand.PrintBpl,
BoogieOptionBag.SolverLog,
Expand Down
8 changes: 4 additions & 4 deletions Source/DafnyDriver/Commands/GenerateTestsCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ static class GenerateTestsCommand {
BoogieOptionBag.SolverResourceLimit,
BoogieOptionBag.VerificationTimeLimit,
PrintBpl,
CoverageReport,
ExpectedCoverageReport,
CommonOptionBag.NoTimeStampForCoverageReport,
ForcePrune,
}.Concat(DafnyCommands.ConsoleOutputOptions.Except(new[] { CommonOptionBag.AllowWarnings }).ToList()).
Expand Down Expand Up @@ -133,7 +133,7 @@ private enum Mode {
"Print the Boogie code used during test generation.") {
ArgumentHelpName = "filename"
};
public static readonly Option<string> CoverageReport = new("--coverage-report",
public static readonly Option<string> ExpectedCoverageReport = new(new[] { "--expected-coverage-report", "--coverage-report" },
"Emit expected test coverage report to a given directory.") {
ArgumentHelpName = "directory"
};
Expand All @@ -149,7 +149,7 @@ private enum Mode {
DafnyOptions.RegisterLegacyBinding(PrintBpl, (options, value) => {
options.TestGenOptions.PrintBpl = value;
});
DafnyOptions.RegisterLegacyBinding(CoverageReport, (options, value) => {
DafnyOptions.RegisterLegacyBinding(ExpectedCoverageReport, (options, value) => {
options.TestGenOptions.CoverageReport = value;
});
DafnyOptions.RegisterLegacyBinding(ForcePrune, (options, value) => {
Expand All @@ -160,7 +160,7 @@ private enum Mode {
LoopUnroll,
SequenceLengthLimit,
PrintBpl,
CoverageReport,
ExpectedCoverageReport,
ForcePrune
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// RUN: %diff "%S/ProofDependencies.dfy_verification.html.expect" "%t/coverage_verification_actual.html"
// Expected test coverage:
// RUN: rm -rf "%t"/coverage_testing
// RUN: %baredafny generate-tests Block --no-timestamp-for-coverage-report --coverage-report "%t/coverage_testing" %s
// RUN: %baredafny generate-tests Block --no-timestamp-for-coverage-report --expected-coverage-report "%t/coverage_testing" %s
// RUN: %sed 's/<h1 hidden.*//' "%t"/coverage_testing/ProofDependencies.dfy_tests_expected.html > "%t"/coverage_testing_actual.html
// RUN: %diff "%S/ProofDependencies.dfy_tests_expected.html.expect" "%t/coverage_testing_actual.html"
// Combined coverage:
Expand Down
1 change: 1 addition & 0 deletions docs/dev/news/5301.fix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Rename the `dafny generate-tests` option `--coverage-report` to `--expected-coverage-report`

0 comments on commit a2004d2

Please sign in to comment.