Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for testing 'Portable' Class Library projects #4

Closed
jcansdale opened this issue Jul 4, 2016 · 6 comments
Closed

Add support for testing 'Portable' Class Library projects #4

jcansdale opened this issue Jul 4, 2016 · 6 comments
Assignees
Milestone

Comments

@jcansdale
Copy link
Owner

jcansdale commented Jul 4, 2016

This currently seems to work when running ad-hoc methods, but should also work with other runners (with a few tweaks).

For example, with xUnit, place the following TestDriven.Net configuration file:

<TestRunner>
  <FriendlyName>xUnit.net {0}.{1}.{2} build {3}</FriendlyName>
  <AssemblyPath>..\net45\xunit.runner.tdnet.dll</AssemblyPath>
  <TypeName>Xunit.Runner.TdNet.TdNetRunner</TypeName>
</TestRunner>

...in your solution's NuGet folder:
packages\xunit.extensibility.core.*\lib\netstandard1.0\

Paging, @bradwilson

@bradwilson
Copy link

Are you also planning to support .xproj projects?

@bradwilson
Copy link

Also, right now our TD.NET runner is bound against the desktop CLR. Are you planning to support running tests in .NET Core as well? If so, how do I write my adapter to enable support for .NET Core?

@bradwilson
Copy link

You should be able to test this with 2.2.0-beta3-build3303 (or later), available on MyGet.

@jcansdale
Copy link
Owner Author

Are you also planning to support .xproj projects?

Yes, absolutely. I have ad-hoc test methods working already. :)

If so, how do I write my adapter to enable support for .NET Core?

I'm planing to piggyback off the "dotnet test" runner stuff. I'll need a way to discover the extra parameters that need to be passed (e.g. dotnet test -method Class.Method). I welcome suggestions about how to handle this. Maybe this could be in a file called 'dotnet-test-xunit.tdnet.json' (next to the runner assembly). Alternatively, there could be a setting inside 'dotnet-test-xunit.runtimeconfig.json' (to avoid clutter).

You should be able to test this with 2.2.0-beta3-build3303 (or later), available on MyGet.

Excellent, I can confirm that it works!

Was there a reason you decided not to use the following:
<AssemblyPath>..\net45\xunit.runner.tdnet.dll</AssemblyPath>

It will get run inside the desktop CLR and I assume xunit.runner.tdnet.dll was built for desktop as well?

@bradwilson
Copy link

I'm planing to piggyback off the "dotnet test" runner stuff.

I'm surprised. I expected you to ask people to code to your existing API, just with a .NET Core compatible API surface.

Given that you're doing that, you should look at the special hooks already required by the Visual Studio test runner, and see if you can reuse them. They are noted here:

https://github.com/xunit/dotnet-test-xunit/blob/765f506f598a88055705b5c49c9da71b50d900e4/src/dotnet-test-xunit/CommandLine.cs#L244-L282

@jcansdale
Copy link
Owner Author

I can confirm this works with xUnit 2.2.0-beta3. 👍

Doesn't work with the latest NUnit. 😢

@jcansdale jcansdale added this to the v4.0-RC milestone Oct 7, 2016
@jcansdale jcansdale self-assigned this Oct 7, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants