<commit_before>﻿// Copyright(c) .NET Foundation and contributors.All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

using System;
using System.Collections.Generic;
using Microsoft.DotNet.Cli.CommandLine;
using Microsoft.DotNet.Cli.Utils;
using Microsoft.DotNet.Tools.MSBuild;
using System.IO;
using System.Text.RegularExpressions;

namespace Microsoft.DotNet.Tools.Test
{
    public class TestCommand
    {
        public static int Run(string[] args)
        {
            DebugHelper.HandleDebugSwitch(ref args);

            var cmd = new CommandLineApplication(throwOnUnexpectedArg: false)
            {
                Name = "dotnet test",
                FullName = ".NET Test Driver",
                Description = "Test Driver for the .NET Platform"
            };

            cmd.HelpOption("-h|--help");

            var argRoot = cmd.Argument(
                "<PROJECT>",
                "The project to test, defaults to the current directory.",
                multipleValues: false);

            var settingOption = cmd.Option(
                "-s|--settings <SettingsFile>",
                "Settings to use when running tests.",
                CommandOptionType.SingleValue);

            var listTestsOption = cmd.Option(
                "-lt|--listTests",
                @"Lists discovered tests",
                CommandOptionType.NoValue);

            var testCaseFilterOption = cmd.Option(
                "-tcf|--testCaseFilter <Expression>",
                @"Run tests that match the given expression.
                                        Examples:
                                        --testCaseFilter:""Priority = 1""
                                        --testCaseFilter: ""(FullyQualifiedName~Nightly | Name = MyTestMethod)""",
                CommandOptionType.SingleValue);

            var testAdapterPathOption = cmd.Option(
                "-tap|--testAdapterPath",
                @"Use custom adapters from the given path in the test run.
                                        Example: --testAdapterPath:<pathToCustomAdapters>",
                CommandOptionType.SingleValue);

            var loggerOption = cmd.Option(
                "-l|--logger <LoggerUri/FriendlyName>",
                @"Specify a logger for test results. 
                                        Example: --logger:trx",
                CommandOptionType.SingleValue);

            var configurationOption = cmd.Option(
                "-c|--configuration <configuration>",
                @"Configuration under which to build, i.e. Debug/Release",
                CommandOptionType.SingleValue);

            var frameworkOption = cmd.Option(
                "-f|--framework <FrameworkVersion>",
                @"Looks for test binaries for a specific framework",
                CommandOptionType.SingleValue);

            var outputOption = cmd.Option(
                "-o|--output <OotputDir>",
                @"Directory in which to find the binaries to be run",
                CommandOptionType.SingleValue);

            var diagOption = cmd.Option(
                "-d|--diag <PathToLogFile>",
                @"Enable verbose logs for test platform.
                                        Logs are written to the provided file.",
                CommandOptionType.SingleValue);

            var noBuildtOption = cmd.Option(
               "--noBuild",
               @"Do not build project before testing.",
               CommandOptionType.NoValue);

            cmd.OnExecute(() =>
            {
                var msbuildArgs = new List<string>()
                {
                    "/t:VSTest"
                };
<commit_msg>Fix typo in dotnet test help message<commit_after>﻿// Copyright(c) .NET Foundation and contributors.All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

using System;
using System.Collections.Generic;
using Microsoft.DotNet.Cli.CommandLine;
using Microsoft.DotNet.Cli.Utils;
using Microsoft.DotNet.Tools.MSBuild;
using System.IO;
using System.Text.RegularExpressions;

namespace Microsoft.DotNet.Tools.Test
{
    public class TestCommand
    {
        public static int Run(string[] args)
        {
            DebugHelper.HandleDebugSwitch(ref args);

            var cmd = new CommandLineApplication(throwOnUnexpectedArg: false)
            {
                Name = "dotnet test",
                FullName = ".NET Test Driver",
                Description = "Test Driver for the .NET Platform"
            };

            cmd.HelpOption("-h|--help");

            var argRoot = cmd.Argument(
                "<PROJECT>",
                "The project to test, defaults to the current directory.",
                multipleValues: false);

            var settingOption = cmd.Option(
                "-s|--settings <SettingsFile>",
                "Settings to use when running tests.",
                CommandOptionType.SingleValue);

            var listTestsOption = cmd.Option(
                "-lt|--listTests",
                @"Lists discovered tests",
                CommandOptionType.NoValue);

            var testCaseFilterOption = cmd.Option(
                "-tcf|--testCaseFilter <Expression>",
                @"Run tests that match the given expression.
                                        Examples:
                                        --testCaseFilter:""Priority = 1""
                                        --testCaseFilter: ""(FullyQualifiedName~Nightly | Name = MyTestMethod)""",
                CommandOptionType.SingleValue);

            var testAdapterPathOption = cmd.Option(
                "-tap|--testAdapterPath",
                @"Use custom adapters from the given path in the test run.
                                        Example: --testAdapterPath:<pathToCustomAdapters>",
                CommandOptionType.SingleValue);

            var loggerOption = cmd.Option(
                "-l|--logger <LoggerUri/FriendlyName>",
                @"Specify a logger for test results. 
                                        Example: --logger:trx",
                CommandOptionType.SingleValue);

            var configurationOption = cmd.Option(
                "-c|--configuration <configuration>",
                @"Configuration under which to build, i.e. Debug/Release",
                CommandOptionType.SingleValue);

            var frameworkOption = cmd.Option(
                "-f|--framework <FrameworkVersion>",
                @"Looks for test binaries for a specific framework",
                CommandOptionType.SingleValue);

            var outputOption = cmd.Option(
                "-o|--output <OutputDir>",
                @"Directory in which to find the binaries to be run",
                CommandOptionType.SingleValue);

            var diagOption = cmd.Option(
                "-d|--diag <PathToLogFile>",
                @"Enable verbose logs for test platform.
                                        Logs are written to the provided file.",
                CommandOptionType.SingleValue);

            var noBuildtOption = cmd.Option(
               "--noBuild",
               @"Do not build project before testing.",
               CommandOptionType.NoValue);

            cmd.OnExecute(() =>
            {
                var msbuildArgs = new List<string>()
                {
                    "/t:VSTest"
                };

{'fraction_non_alphanumeric': 0.09021956087824351, 'fraction_numerical': 0.0002661343978709248, 'mean_word_length': 1.4862719153159114, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 14, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5703253', 'n_tokens_mistral': 1755, 'n_tokens_neox': 1606, 'n_words': 478}