dotnet-installer/src/Microsoft.DotNet.Tools.Test
2016-10-03 14:48:33 -05:00
..
MessageHandlers Addressing code review comments. 2016-08-26 11:23:47 -07:00
Properties Addressing code review comments. 2016-08-26 11:23:47 -07:00
ReportingChannels Addressing code review comments. 2016-08-26 11:23:47 -07:00
TestRunners Addressing more code review comments. 2016-08-29 09:46:12 -07:00
AssemblyTestRunnerDecorator.cs Addressing more code review comments. 2016-08-29 09:46:12 -07:00
AssemblyUnderTest.cs Addressing code review comments. 2016-08-26 11:23:47 -07:00
CommandTestRunnerExtensions.cs Addressing code review comments. 2016-08-26 11:23:47 -07:00
ConsoleTestRunner.cs Addressing more code review comments. 2016-08-29 09:46:12 -07:00
DesignTimeRunner.cs Addressing more code review comments. 2016-08-29 09:46:12 -07:00
DotnetTest.cs Addressing code review comments. 2016-08-26 11:23:47 -07:00
DotnetTestExtensions.cs Addressing code review comments. 2016-08-26 11:23:47 -07:00
DotnetTestParams.cs Addressing code review comments. 2016-08-26 11:23:47 -07:00
DotnetTestRunnerFactory.cs Addressing more code review comments. 2016-08-29 09:46:12 -07:00
DotnetTestState.cs Addressing code review comments. 2016-08-26 11:23:47 -07:00
IDotnetTest.cs Addressing code review comments. 2016-08-26 11:23:47 -07:00
IDotnetTestRunner.cs Addressing code review comments. 2016-08-26 11:23:47 -07:00
IDotnetTestRunnerFactory.cs Addressing code review comments. 2016-08-26 11:23:47 -07:00
ITestMessagesCollection.cs Addressing code review comments. 2016-08-26 11:23:47 -07:00
Microsoft.DotNet.Tools.Test.xproj Ensure the project is built in dotnet run3. 2016-09-09 08:53:57 -05:00
project.json Set the "hashPath" when building the .deps.json file 2016-09-02 10:02:54 -07:00
ProjectJsonTestRunnerDecorator.cs Fix the merge of preview2 to build correctly. 2016-10-03 14:48:33 -05:00
README.md Addressing code review comments. 2016-08-26 11:23:47 -07:00
TestCommand.cs Addressing code review comments. 2016-08-26 11:23:47 -07:00
TestHostTracing.cs Addressing code review comments. 2016-08-26 11:23:47 -07:00
TestMessagesCollection.cs Addressing code review comments. 2016-08-26 11:23:47 -07:00
TestProjectBuilder.cs Addressing code review comments. 2016-08-26 11:23:47 -07:00
TestStartInfo.cs Addressing code review comments. 2016-08-26 11:23:47 -07:00

% DOTNET-TEST(1) % Microsoft Corporation dotnetclifeedback@microsoft.com % April 2016

NAME

dotnet-test - Runs unit tests using the configured test runner

SYNOPSIS

dotnet test [--configuration] [--output] [--build-base-path] [--framework] [--runtime] [--no-build] [--parentProcessId] [--port] [<project>]

DESCRIPTION

The dotnet test command is used to execute unit tests in a given project. Unit tests are class library projects that have dependencies on the unit test framework (for example, NUnit or xUnit) and the dotnet test runner for that unit testing framework. These are packaged as NuGet packages and are restored as ordinary dependencies for the project.

Test projects also need to specify a test runner property in project.json using the "testRunner" node. This value should contain the name of the unit test framework.

The following sample project.json shows the properties needed:

{
    "version": "1.0.0-*",

    "dependencies": {
        "Microsoft.NETCore.App": {
            "version": "1.0.0-rc2-3002702",
            "type": "platform"
        },
        "xunit": "2.1.0",
        "dotnet-test-xunit": "1.0.0-rc2-build10015"
    },
    "testRunner": "xunit",

    "frameworks": {
        "netcoreapp1.0": {
                "imports": [
                    "dnxcore50",
                    "portable-net45+win8"
                ]
        }
    }
}

dotnet test supports two running modes:

  1. Console: In console mode, dotnet test simply executes fully any command gets passed to it and outputs the results. Anytime you invoke dotnet test without passing --port, it runs in console mode, which in turn will cause the runner to run in console mode.
  2. Design time: used in the context of other tools, such as editors or Integrated Development Environments (IDEs). You can find out more about this mode in the dotnet-test protocol document.

OPTIONS

[project]

Specifies a path to the test project. If omitted, it defaults to current directory.

-c, --configuration [Debug|Release]

Configuration under which to build. The default value is Release.

-o, --output [DIR]

Directory in which to find binaries to run.

-b, --build-base-path [DIR]

Directory in which to place temporary outputs.

-f, --framework [FRAMEWORK]

Looks for test binaries for a specific framework.

-r, --runtime [RUNTIME_IDENTIFIER]

Look for test binaries for a for the specified runtime.

--no-build

Does not build the test project prior to running it.

--parentProcessId

Used by IDEs to specify their process ID. Test will exit if the parent process does.

--port

Used by IDEs to specify a port number to listen for a connection.

EXAMPLES

dotnet test

Runs the tests in the project in the current directory.

dotnet test /projects/test1/project.json

Runs the tests in the test1 project.