| File: parent\dotnet\Commands\Test\MTP\Options.cs | Web Access |
| Project: dotnet-aot.csproj (dotnet-aot) |
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System.Collections.Immutable; using Microsoft.DotNet.Cli.Commands.Test.Terminal; namespace Microsoft.DotNet.Cli.Commands.Test; internal enum TestListFormat { /// <summary> /// Human-readable discovery output (the default when '--list-tests' is passed without a value). /// </summary> Text, /// <summary> /// Machine-readable JSON discovery output ('--list-tests json'). /// </summary> Json, } internal enum ResultsDirectoryLayout { Flat, PerModule, } internal record TestOptions( bool IsHelp, bool IsDiscovery, TestListFormat ListTestsFormat, bool IsArtifactPostProcessing = false) { internal const string AffectedTestsModeEnvironmentVariable = "DOTNET_CLI_TEST_AFFECTED_TESTS_MODE"; internal const string CollectTestMapMode = "collect"; internal const string RunAffectedTestsMode = "run"; public bool CollectTestMap { get; init; } public bool AffectedTests { get; init; } public bool CollectTestMapForwarded { get; init; } public bool AffectedTestsForwarded { get; init; } public bool IsAffectedTestsMode => CollectTestMap || AffectedTests; } internal record PathOptions( string? ProjectOrSolutionPath, string? SolutionPath, string? TestModules, string? ResultsDirectoryPath, ResultsDirectoryLayout ResultsDirectoryLayout, string? ConfigFilePath, string? DiagnosticOutputDirectoryPath, bool ResultsDirectoryLayoutSpecified = false); internal record BuildOptions( PathOptions PathOptions, bool HasNoRestore, bool HasNoBuild, Utils.VerbosityOptions? Verbosity, bool NoLaunchProfile, bool NoLaunchProfileArguments, ImmutableArray<string> TestApplicationArguments, IEnumerable<string> MSBuildArgs, string? Device, bool ListDevices, IReadOnlyDictionary<string, string> EnvironmentVariables); internal readonly record struct TestApplicationPolicy( bool FailOnAllSkippedTests, string? IgnoredExitCodes); internal readonly record struct TestApplicationSettings( TestApplicationPolicy Policy, TestResultVisibility TestResultVisibility, int SlowestTestsCount, bool ShowFlakyTests, bool LegacyRetryEnabled) { public static TestApplicationSettings Default { get; } = new( default, TestResultVisibility.Failed | TestResultVisibility.Skipped, SlowestTestsCount: 0, ShowFlakyTests: true, LegacyRetryEnabled: false); }