|
@@ -148,6 +148,10 @@ public class UICatalogApp
|
|
|
benchmarkFlag.AddAlias ("-b");
|
|
|
benchmarkFlag.AddAlias ("--b");
|
|
|
|
|
|
+ Option<uint> benchmarkTimeout = new Option<uint> ("--timeout", getDefaultValue: () => Scenario.BenchmarkTimeout, $"The maximum time in milliseconds to run a benchmark for. Default is {Scenario.BenchmarkTimeout}ms.");
|
|
|
+ benchmarkTimeout.AddAlias ("-t");
|
|
|
+ benchmarkTimeout.AddAlias ("--t");
|
|
|
+
|
|
|
Option<string> resultsFile = new Option<string> ("--file", "The file to save benchmark results to. If not specified, the results will be displayed in a TableView.");
|
|
|
resultsFile.AddAlias ("-f");
|
|
|
resultsFile.AddAlias ("--f");
|
|
@@ -165,7 +169,7 @@ public class UICatalogApp
|
|
|
|
|
|
var rootCommand = new RootCommand ("A comprehensive sample library for Terminal.Gui")
|
|
|
{
|
|
|
- scenarioArgument, benchmarkFlag, resultsFile, driverOption,
|
|
|
+ scenarioArgument, benchmarkFlag, benchmarkTimeout, resultsFile, driverOption,
|
|
|
};
|
|
|
|
|
|
rootCommand.SetHandler (
|
|
@@ -176,6 +180,7 @@ public class UICatalogApp
|
|
|
Scenario = context.ParseResult.GetValueForArgument (scenarioArgument),
|
|
|
Driver = context.ParseResult.GetValueForOption (driverOption) ?? string.Empty,
|
|
|
Benchmark = context.ParseResult.GetValueForOption (benchmarkFlag),
|
|
|
+ BenchmarkTimeout = context.ParseResult.GetValueForOption (benchmarkTimeout),
|
|
|
ResultsFile = context.ParseResult.GetValueForOption (resultsFile) ?? string.Empty,
|
|
|
/* etc. */
|
|
|
};
|
|
@@ -197,6 +202,8 @@ public class UICatalogApp
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
+ Scenario.BenchmarkTimeout = _options.BenchmarkTimeout;
|
|
|
+
|
|
|
UICatalogMain (_options);
|
|
|
|
|
|
return 0;
|
|
@@ -332,6 +339,7 @@ public class UICatalogApp
|
|
|
// regardless of what's in a config file.
|
|
|
Application.ForceDriver = _forceDriver = options.Driver;
|
|
|
|
|
|
+
|
|
|
// If a Scenario name has been provided on the commandline
|
|
|
// run it and exit when done.
|
|
|
if (options.Scenario != "none")
|
|
@@ -788,7 +796,7 @@ public class UICatalogApp
|
|
|
{
|
|
|
if (_statusBar.NeedsLayout)
|
|
|
{
|
|
|
- // throw new LayoutException ("DimFunc.Fn aborted because dependent View needs layout.");
|
|
|
+ // throw new LayoutException ("DimFunc.Fn aborted because dependent View needs layout.");
|
|
|
}
|
|
|
return _statusBar.Frame.Height;
|
|
|
})),
|
|
@@ -817,7 +825,7 @@ public class UICatalogApp
|
|
|
{
|
|
|
if (_statusBar.NeedsLayout)
|
|
|
{
|
|
|
- // throw new LayoutException ("DimFunc.Fn aborted because dependent View needs layout.");
|
|
|
+ // throw new LayoutException ("DimFunc.Fn aborted because dependent View needs layout.");
|
|
|
}
|
|
|
return _statusBar.Frame.Height;
|
|
|
})),
|
|
@@ -1378,6 +1386,8 @@ public class UICatalogApp
|
|
|
|
|
|
public string Scenario;
|
|
|
|
|
|
+ public uint BenchmarkTimeout;
|
|
|
+
|
|
|
public bool Benchmark;
|
|
|
|
|
|
public string ResultsFile;
|