From e397b4f1683dd717dc4eace4d5d7a9f8438a07ee Mon Sep 17 00:00:00 2001 From: Remy Willems Date: Wed, 24 Jul 2024 18:09:54 +0200 Subject: [PATCH] Let `measure-complexity` output the worst performing verification tasks by resource count (#5631) ### Description - Let `measure-complexity` output the worst performing verification tasks by resource count - Add an option `--top-x` to `measure-complexity` to configure how many of the worst tasks are shown - Change the default of `--iterations` from 10 to 1 ### How has this been tested? - Add a CLI test 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). --- .../Commands/MeasureComplexityCommand.cs | 50 +++++++++++++++++-- .../LitTest/cli/measure-complexity.dfy | 20 ++++++++ .../LitTest/cli/measure-complexity.dfy.expect | 32 ++++++++++++ docs/dev/news/5631.feat | 5 ++ 4 files changed, 103 insertions(+), 4 deletions(-) create mode 100644 Source/IntegrationTests/TestFiles/LitTests/LitTest/cli/measure-complexity.dfy create mode 100644 Source/IntegrationTests/TestFiles/LitTests/LitTest/cli/measure-complexity.dfy.expect create mode 100644 docs/dev/news/5631.feat diff --git a/Source/DafnyDriver/Commands/MeasureComplexityCommand.cs b/Source/DafnyDriver/Commands/MeasureComplexityCommand.cs index ed44471f31..ea9f3bc61f 100644 --- a/Source/DafnyDriver/Commands/MeasureComplexityCommand.cs +++ b/Source/DafnyDriver/Commands/MeasureComplexityCommand.cs @@ -3,9 +3,12 @@ using System.CommandLine; using System.Linq; using System.Reactive.Subjects; +using System.Threading; using System.Threading.Tasks; using DafnyCore; using DafnyDriver.Commands; +using Microsoft.Boogie; +using VC; namespace Microsoft.Dafny; @@ -13,6 +16,7 @@ static class MeasureComplexityCommand { public static IEnumerable