xunit - xunit.runner.visualstudio 2.4.2-preview.52.g19fc37fb0a

Visual Studio 2017 15.9+ Test Explorer runner for the xUnit.net framework. Capable of running xUnit.net v1.9.2 and v2.0+ tests. Supports .NET 2.0 or later, .NET Core 2.1 or later, and Universal Windows 10.0.16299 or later.

PM> Install-Package xunit.runner.visualstudio -Version 2.4.2-preview.52.g19fc37fb0a -Source https://www.myget.org/F/xunit/api/v3/index.json

Copy to clipboard

> nuget.exe install xunit.runner.visualstudio -Version 2.4.2-preview.52.g19fc37fb0a -Source https://www.myget.org/F/xunit/api/v3/index.json

Copy to clipboard

> dotnet add package xunit.runner.visualstudio --version 2.4.2-preview.52.g19fc37fb0a --source https://www.myget.org/F/xunit/api/v3/index.json

Copy to clipboard
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.2-preview.52.g19fc37fb0a" />
Copy to clipboard
source https://www.myget.org/F/xunit/api/v3/index.json

nuget xunit.runner.visualstudio  ~> 2.4.2-preview.52.g19fc37fb0a
Copy to clipboard

> choco install xunit.runner.visualstudio --version 2.4.2-preview.52.g19fc37fb0a --source https://www.myget.org/F/xunit/api/v2

Copy to clipboard
Import-Module PowerShellGet
Register-PSRepository -Name "xunit" -SourceLocation "https://www.myget.org/F/xunit/api/v2"
Install-Module -Name "xunit.runner.visualstudio" -RequiredVersion "2.4.2-preview.52.g19fc37fb0a" -Repository "xunit" -AllowPreRelease
Copy to clipboard

About This Project

This project contains the Visual Studio runner for xUnit.net. It supports the built-in Test Explorer feature in Visual Studio 2012 and later (all editions except Express). It supports Desktop .NET 2.0, Windows 8.1, Windows Phone 8.1 Applications, and Universal Windows Apps 10.0 (and later). It can run tests from xUnit.net 1.9.2 and later.

To open an issue for this project, please visit the core xUnit.net project issue tracker.

Debugging

Debugging the VS Adapter is tricky. There are two ways to do it depending on whether you want to do it under net46 or netcoreapp2.1. In all cases, you'll currently need to build your own test adapter NuGet package using build.ps1, build.ps1 Packages first to ensure you have local symbols. The symbols are not in the public package. It's helpful to add it to a local \packages directory and then use an entry like <add key="Local Packages" value=".\packages" /> in your NuGet.config file to point to it. Don't forget to eventually delete it from your global profile .nuget\packages\xunit... when you're done.

net46

Easiest thing to do is add a launchSettings.json file that adds the vstest.console.exe as a startup project and point it to an xunit dll. Something like the following (use /listtests if you just want to debug the discovery portion):

{
  "profiles": {
    "vstest console": {
      "executablePath": "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\Common7\\IDE\\CommonExtensions\\Microsoft\\TestWindow\\vstest.console.exe",
      "commandLineArgs": ".\\bin\\Debug\\net46\\Tests.System.Reactive.dll /TestAdapterPath:.\\bin\\Debug\\net46 /listtests",
      "workingDirectory": "C:\\dev\\RxNET\\Rx.NET\\Source\\Tests.System.Reactive\\"
    }
  }
}

With that as the startup project, you can set breakpoints and then hit them. You may need to manually load symbols the first time if it's not detected automatically.

netcoreapp2.1

Debugging the .NET Core version of the runner is currently much more difficult. You'll need Process Explorer to help locate the correct process to debug. This limitation should be improved in subsequent .NET Test Platform releases.

  1. Start a PowerShell console and navigate to the directory with your test project
  2. Set an environment variable in that console session: $env:VSTEST_HOST_DEBUG = 1
  3. Build your test project: dotnet build
  4. Have VS open with the xUnit solution loaded
  5. Have Process Explorer open and in Tree View mode. You may want to update the "highlight delay" settings to 2-3 settings. Defaults to 1. Make the list scroll roughly to the "d's"
  6. Execute the test: dotnet vstest .\bin\debug\netcoreapp2.1\MyTest.dll (you can use the -lt switch to do discovery only)
  7. The test adapter will wait for about 30 seconds for you to attach a debugger. You need to look for the "lowest" dotnet.exe process in the tree like this: img. In this case, the PID you're looking for is 79404.
  8. In VS, go to Debug -> Attach to Process and look for the PID (easiest to sort the column by PID). Ensure the debugger type is "Automatic" and it'll choose the CoreCLR debugger.
  9. Attach and then quickly hit Continue. It should load up the adapter and related code with symbols.

About xUnit.net

xUnit.net is a free, open source, community-focused unit testing tool for the .NET Framework. Written by the original inventor of NUnit v2, xUnit.net is the latest technology for unit testing C#, F#, VB.NET and other .NET languages. xUnit.net works with ReSharper, CodeRush, TestDriven.NET and Xamarin. It is part of the .NET Foundation, and operates under their code of conduct. It is licensed under Apache 2 (an OSI approved license).

For project documentation, please visit the xUnit.net project home.

  • .NETFramework 4.5.2
  • .NETCoreApp 2.1
  • UAP 10.0.16299
  • .NETCoreApp 2.1: 2.1.0.0
  • .NETFramework 4.5.2: 4.5.2.0
  • UAP 10.0.16299: 10.0.16299.0

Owners

Brad Wilson Oren Novotny

Authors

.NET Foundation and Contributors

Project URL

https://github.com/xunit/visualstudio.xunit

License

Apache-2.0

Info

9534 total downloads
0 downloads for version 2.4.2-preview.52.g19fc37fb0a
Download (735.81 KB)
Found on the current feed only

Package history

Version Size Last updated Downloads Mirrored?
2.4.2-preview.52.g19fc37fb0a 735.81 KB Mon, 26 Aug 2019 16:46:14 GMT 0
2.4.2-preview.52 766.27 KB Mon, 26 Aug 2019 16:53:55 GMT 0
2.4.2-preview.50.g153048c51e 735.81 KB Mon, 19 Aug 2019 18:53:55 GMT 0
2.4.2-preview.50 766.25 KB Mon, 19 Aug 2019 19:00:07 GMT 0
2.4.2-preview.48.g7f49203be5 735.81 KB Mon, 12 Aug 2019 16:00:05 GMT 0
2.4.2-preview.48 766.27 KB Mon, 12 Aug 2019 16:06:37 GMT 0
2.4.2-preview.46.g5fb1bf9427 735.82 KB Mon, 05 Aug 2019 15:44:56 GMT 0
2.4.2-preview.46 766.22 KB Mon, 05 Aug 2019 15:48:03 GMT 0
2.4.2-preview.44.g652fd79def 735.84 KB Wed, 17 Jul 2019 14:24:18 GMT 0
2.4.2-preview.44 766.3 KB Wed, 17 Jul 2019 14:33:28 GMT 0
2.4.2-preview.42.ge4c4ffd0e0 735.86 KB Tue, 16 Jul 2019 14:19:07 GMT 0
2.4.2-preview.42 766.28 KB Tue, 16 Jul 2019 14:41:55 GMT 0
2.4.2-preview.40.g23dbf8a045 735.84 KB Mon, 15 Jul 2019 15:07:24 GMT 0
2.4.2-preview.40 766.3 KB Mon, 15 Jul 2019 15:13:55 GMT 0
2.4.2-preview.38.g9b7dc228e1 735.84 KB Tue, 09 Jul 2019 12:31:25 GMT 0
2.4.2-preview.38.g5def06b201 737.51 KB Wed, 26 Jun 2019 17:10:45 GMT 0
2.4.2-preview.38 766.3 KB Tue, 09 Jul 2019 12:46:55 GMT 0
2.4.2-preview.37.g7da12c29f0 737.53 KB Wed, 26 Jun 2019 16:36:34 GMT 0
2.4.2-preview.37.g51c2048195 735.94 KB Tue, 02 Jul 2019 15:25:09 GMT 0
2.4.2-preview.37 766.34 KB Tue, 09 Jul 2019 12:26:51 GMT 0
2.4.2-preview.36 766.38 KB Tue, 09 Jul 2019 12:25:56 GMT 0
2.4.2-preview.35.gb6a58b2dee 735.95 KB Thu, 27 Jun 2019 14:03:00 GMT 0
2.4.2-preview.35.g3da60845cf 735.94 KB Thu, 27 Jun 2019 14:04:01 GMT 0
2.4.2-preview.35.g37475049ad 735.93 KB Tue, 02 Jul 2019 14:19:16 GMT 0
2.4.2-preview.35 766.35 KB Tue, 02 Jul 2019 15:23:52 GMT 0
2.4.2-preview.33.gc25d7aa109 735.93 KB Wed, 26 Jun 2019 16:18:32 GMT 0
2.4.2-preview.33 766.36 KB Wed, 26 Jun 2019 16:23:57 GMT 0
2.4.2-preview.32.g9f90085277 735.92 KB Wed, 26 Jun 2019 16:14:17 GMT 0
2.4.2-preview.32.g76e27d2126 735.91 KB Wed, 26 Jun 2019 16:13:50 GMT 0
2.4.2-preview.32.89df2c843e 737.53 KB Tue, 25 Jun 2019 19:54:51 GMT 0
2.4.2-preview.32 766.36 KB Wed, 26 Jun 2019 16:19:06 GMT 0
2.4.2-preview.31.g1408609aec 735.92 KB Wed, 26 Jun 2019 16:11:47 GMT 0
2.4.2-preview.31 766.35 KB Wed, 26 Jun 2019 16:17:35 GMT 0
2.4.2-preview.30.ab0014f816 737.51 KB Tue, 25 Jun 2019 19:39:12 GMT 0
2.4.2-preview.30 766.36 KB Wed, 26 Jun 2019 16:12:20 GMT 0
2.4.2-preview.29 766.36 KB Wed, 26 Jun 2019 16:11:09 GMT 0
2.4.2-preview.28 766.41 KB Wed, 26 Jun 2019 16:13:21 GMT 0
2.4.2-preview.27.gce3579d6e6 735.91 KB Wed, 26 Jun 2019 16:03:30 GMT 0
2.4.2-preview.27.d4e1eb5ee9 735.9 KB Wed, 26 Jun 2019 16:02:06 GMT 0
2.4.2-preview.27.80925c57ea 735.96 KB Wed, 26 Jun 2019 16:02:55 GMT 0
2.4.2-preview.27.1f88f79574 735.88 KB Wed, 26 Jun 2019 16:05:02 GMT 0
2.4.2-preview.27.0e7517a5b7 735.94 KB Wed, 26 Jun 2019 16:04:35 GMT 0
2.4.2-preview.27.01db0e69a8 735.9 KB Wed, 26 Jun 2019 16:04:03 GMT 0
2.4.2-preview.27 766.35 KB Wed, 26 Jun 2019 16:12:50 GMT 0
2.4.2-preview.25 766.35 KB Tue, 25 Jun 2019 15:36:54 GMT 0
2.4.2-preview.22 765.51 KB Wed, 19 Dec 2018 03:08:06 GMT 0
2.4.2-preview.21 765.46 KB Wed, 19 Dec 2018 02:17:14 GMT 0
2.4.2-preview.18.1e6cc12b4e 734.91 KB Wed, 19 Dec 2018 01:36:02 GMT 0
2.4.2-preview.18 765.41 KB Wed, 19 Dec 2018 01:51:12 GMT 0
2.4.2-preview.17.19c89555ea 630.58 KB Wed, 19 Dec 2018 01:18:03 GMT 0
2.4.1 675.53 KB Mon, 29 Oct 2018 04:24:48 GMT 0
2.4.0 674.21 KB Tue, 17 Jul 2018 04:19:42 GMT 0
2.3.1 660.4 KB Fri, 27 Oct 2017 05:37:35 GMT 102
2.3.0 726.17 KB Fri, 06 Oct 2017 22:15:12 GMT 40
2.2.0 302.56 KB Sun, 19 Feb 2017 23:24:31 GMT 1390
2.1.0 183.46 KB Sun, 27 Sep 2015 17:45:48 GMT 8002