Skip to content

hosho/testrunner

 
 

Repository files navigation

TestRunner

A console MSTest runner

Features

Lightweight, standalone, no external dependencies.

Cross-platform, tested on Microsoft .NET Framework and .NET Core on Windows, and Mono and .NET Core on Linux.

Multi-process, runs test assemblies in their own isolated processes.

Reflection-based, runs test assemblies built against any variant or version of the MSTest dll.

Provides System.Diagnostics.Trace output.

Provides test timing information.

Provides detailed exception information in the case of failures.

Supports test attributes [TestClass], [TestMethod], [TestInitialize], [TestCleanup], [ClassInitialize], [ClassCleanup], [AssemblyInitialize], [AssemblyCleanup], [ExpectedException], and [Ignore].

Supports TestContext members CurrentTestOutcome, FullyQualifiedTestClassName, and TestName.

Supports test assembly .config files.

Limitations

Partial test attribute coverage (see Features).

Partial TestContext coverage on .NET Framework (see Features).

Test assembly .config files don't work on Mono because of a bug in Mono.

<bindingRedirect>s in test assembly .config files may not work.

Requirements

.NET Framework v4.6.1 (or newer) OR .NET Core 2.0 (or newer) OR Mono v5.0.0 (or newer).

NuGet Package

Available as a NuGet package named TestRunner.

Synopsis

testrunner.exe <testassemblies>

Options

<testassemblies> - Path(s) to assembly(s) containing MSTest tests

Exit Status

0 if all specified test assemblies succeed, otherwise non-zero.

Test assemblies succeed if all test, initialization, and cleanup methods run successfully.

Test assemblies succeed if they contain no tests.

Test assemblies succeed if they are not .NET assemblies.

Test assemblies fail if any test, initialization, or cleanup methods fail.

Test assemblies fail if the file does not exist.

Examples

.NET Framework

C:\> testrunner.exe C:\Path\To\TestAssembly.dll C:\Path\To\AnotherTestAssembly.dll

.NET Core

C:\> dotnet testrunner.dll C:\Path\To\TestAssembly.dll C:\Path\To\AnotherTestAssembly.dll

Mono

$ mono --debug testrunner.exe /path/to/TestAssembly.dll /path/to/AnotherTestAssembly.dll

Building

.NET Framework

dotnet publish -f net461

.NET Core

dotnet publish -f netcoreapp2.0

Mono

msbuild /p:TargetFramework=net461 /t:Restore
msbuild /p:TargetFramework=net461 /t:Rebuild
msbuild /p:TargetFramework=net461 /t:Publish

License

MS-PL <https://github.com/macro187/testrunner/blob/master/license.txt>

Copyright

Copyright (c) 2012-2018
Ron MacNeil <https://github.com/macro187>
Rickenberg <https://www.codeplex.com/site/users/view/Rickenberg>
JDeltorp <https://github.com/JDeltorp>

History

Forked from <https://testrunner.codeplex.com/> revision 87713 on September 24th, 2016

Continuous Integration

Appveyor (Windows)

Build status

net461 build and tests

netcoreapp2.0 build and tests

Travis (Linux)

Build Status

net461 build and tests (Mono)

netcoreapp2.0 build and tests (.NET Core)

Packages

No packages published

Languages

  • C# 100.0%