diff --git a/Source/DafnyCore/DafnyOptions.cs b/Source/DafnyCore/DafnyOptions.cs index 8bcbf9476d3..6eb521625e7 100644 --- a/Source/DafnyCore/DafnyOptions.cs +++ b/Source/DafnyCore/DafnyOptions.cs @@ -792,8 +792,8 @@ protected bool ParseDafnySpecificOption(string name, Bpl.CommandLineParseState p return true; } - // Unless this is an option for test generation, defer to superclass - return TestGenOptions.ParseOption(name, ps) || base.ParseOption(name, ps); + // Defer to superclass + return base.ParseOption(name, ps); } private static string[] ParseInnerArguments(string argumentsString) { @@ -1462,8 +1462,6 @@ focal predicate P to P#[_k-1]. /proverOpt:O:model.compact=false (for z3 version >= 4.8.7), and /proverOpt:O:model.completion=true. ----- Test generation options ----------------------------------------------- -{TestGenOptions.Help} ---- Compilation options --------------------------------------------------- /compile: diff --git a/Source/DafnyCore/TestGenerationOptions.cs b/Source/DafnyCore/TestGenerationOptions.cs index 72110edbb33..02a40421821 100644 --- a/Source/DafnyCore/TestGenerationOptions.cs +++ b/Source/DafnyCore/TestGenerationOptions.cs @@ -5,76 +5,14 @@ namespace Microsoft.Dafny { public class TestGenerationOptions { - - public static readonly string TestInlineAttribute = "testInline"; - public static readonly string TestEntryAttribute = "testEntry"; + public const string TestInlineAttribute = "testInline"; + public const string TestEntryAttribute = "testEntry"; public bool WarnDeadCode = false; public enum Modes { None, Block, Path }; public Modes Mode = Modes.None; public uint SeqLengthLimit = 0; [CanBeNull] public string PrintBpl = null; - public bool DisablePrune = false; + public bool ForcePrune = false; public const uint DefaultTimeLimit = 10; - - public bool ParseOption(string name, Bpl.CommandLineParseState ps) { - var args = ps.args; - - switch (name) { - - case "warnDeadCode": - WarnDeadCode = true; - Mode = Modes.Block; - return true; - - case "generateTestMode": - if (ps.ConfirmArgumentCount(1)) { - Mode = args[ps.i] switch { - "None" => Modes.None, - "Block" => Modes.Block, - "Path" => Modes.Path, - _ => throw new Exception("Invalid value for generateTestMode") - }; - } - return true; - - case "generateTestSeqLengthLimit": - var limit = 0; - if (ps.GetIntArgument(ref limit)) { - SeqLengthLimit = (uint)limit; - } - return true; - - case "generateTestPrintBpl": - if (ps.ConfirmArgumentCount(1)) { - PrintBpl = args[ps.i]; - } - return true; - - case "generateTestNoPrune": - DisablePrune = true; - return true; - } - - return false; - } - - public string Help => @" -/warnDeadCode - Use counterexample generation to warn about potential dead code. -/generateTestMode: - None (default) - Has no effect. - Block - Prints block-coverage tests for the given program. - Path - Prints path-coverage tests for the given program. - Using /definiteAssignment:3, /generateTestNoPrune, - /generateTestSeqLengthLimit, and /loopUnroll is highly recommended - when generating tests. -/generateTestSeqLengthLimit: - Add an axiom that sets the length of all sequences to be no greater - than . 0 (default) indicates no limit. -/generateTestPrintBpl: - Print the Boogie code used during test generation. -/generateTestNoPrune - Disable axiom pruning that Dafny uses to speed up verification."; - } } diff --git a/Source/DafnyTestGeneration/DeadCodeCommand.cs b/Source/DafnyTestGeneration/DeadCodeCommand.cs index c985b469028..95764d0a2e5 100644 --- a/Source/DafnyTestGeneration/DeadCodeCommand.cs +++ b/Source/DafnyTestGeneration/DeadCodeCommand.cs @@ -6,16 +6,17 @@ using System.CommandLine; using System.CommandLine.Invocation; using System.Linq; +using Microsoft.Boogie; namespace Microsoft.Dafny; public class DeadCodeCommand : ICommandSpec { public IEnumerable