Skip to content

Merge .NET Core support into the portable libraries - #915

Merged
rprouse merged 15 commits into
masterfrom
issue-575
Oct 24, 2015
Merged

rprouse merged 15 commits into
masterfrom
issue-575

Conversation

@rprouse

@rprouse rprouse commented Oct 21, 2015

Copy link
Copy Markdown
Member

Fixes #575 and #876

Based on his work with XUnit, @bradwilson recommended in #575 that we switch to using portable profile 259 which will allow the portable version of the framework to be used in the following platforms,

  • .NET 4.5+
  • .NET Core (Universal Windows Apps 10+, DNX Core 5+)
  • Windows 8
  • Windows Phone 8 (Silverlight)
  • Windows Universal (Windows Phone 8.1+, Windows 8.1+)
  • Xamarin (MonoTouch, MonoAndroid, Xamarin iOS Universal)
  • Portable Libraries (supporting Profile259)

I have removed the existing DNX solution and projects and merged the NETCORE changes into the existing portable framework. This is a large pull request, but the majority is just merging the various PORTABLE and NETCORE #defines

This also resulted in the removal of SilverLight from the portable framework, thus the fix for #876.

Many of the reflection API's that we rely on are not available in this profile. To keep as much of our existing code from changing, I created extension methods for everything that we use that is missing and added an extensive test suite to ensure they behave the same as their counterparts in the desktop framework.

Portable now has an NUnitLite package. It doesn't use Console, but you can create a console runner from it by passing Console.Out/In into AutoRun. On platforms without a console, you can pass in a TextWriter/TextReader. The portable assembly was added to the NUnitLite nuget package.

The portable version of NUnitLite drops support for a color console, but it could be re-added in the future if we switched NUnitLite to use an interface that wraps the console.

I also added the NUnitLite.Tests to the portable project. NUnit.proj has been updated to build and run all portable projects and their tests.

@CharliePoole, could you pull this branch and see if you can build it? I think it requires updating to VS 2015. The changes also need testing on CF. I am currently on a machine without VS2008.

I still want to do some testing with the NuGet packages and different platforms, but this is ready to merge. Any additional problems can be fixed in subsequent issues.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We cannot set the CurrentCulture in this profile. If anyone knows another way...

@CharliePoole

Copy link
Copy Markdown
Member

@rprouse I'll pull and test either tonight or in the morning. I'll have to do some installing first.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Uninstalling BCL.Async from the portable projects caused the other projects to update, thus these changes.

@CharliePoole

Copy link
Copy Markdown
Member

Code looks good and tests pass (I have not yet run CF) so I'll just make general comments.

  1. Our standard so far has been to name the assemblies the same for all builds. You have at least one that has "portable" in the name. Is that by design?
  2. We only have a portable nunitlite, because it has to reference the framework, and it references the portable framework. The framework tests are not portable, but reference both the framework and nunitlite. This would work equally well if the "portable" runner were not actually portable, but was a .NET 4.5 application. We might have an two nunitlites per platform supported - one that references the native framework and one that references the the portable framework. I'm not sure whether this would be needed for anything except testing NUnit, however. We may want to discuss this after merging.

@rprouse

rprouse commented Oct 23, 2015

Copy link
Copy Markdown
Member Author

The portable in the name was intentional since there are no other equivalent projects. We can rename?

@CharliePoole

Copy link
Copy Markdown
Member

I see. I just saw the name nunit.portable.tests.exe and thought it was some kind of tests. It's actually a single-line runner. If you can think of a name that won't confuse me, feel free to change. :-)

If not we can wait till we think of one.

@CharliePoole

Copy link
Copy Markdown
Member

A number of your ReflectionExtensionTests fail in CF. I'll fix and push but probably not before tomorrow.

Also, the "reversing" of the console display doesn't work well when viewing it in a scrollable box - that is in CF and Silverlight. You have to scroll down to see the result. We might want it to be in a different order in those platforms. This is minor and could wait for another PR though.

@rprouse

rprouse commented Oct 23, 2015

Copy link
Copy Markdown
Member Author

It is interesting that the reflection tests fail on CF. Those test all pass on the desktop framework so to me that means that some of the reflection APIs behave differently on CF than they do on desktop, so we might end up having different behaviour on that platform. None of the extensions are used except on portable, so test failures are just differences in the frameworks 😦

@CharliePoole

Copy link
Copy Markdown
Member

CF Reflection is big-time-different!

@rprouse

rprouse commented Oct 23, 2015

Copy link
Copy Markdown
Member Author

Maybe just #ifdef out all those tests for CF? They are mainly intended to
ensure portable acts like desktop.
On Oct 22, 2015 10:31 PM, "CharliePoole" [email protected] wrote:

CF Reflection is big-time-different!

—
Reply to this email directly or view it on GitHub
#915 (comment).

@CharliePoole

Copy link
Copy Markdown
Member

If there are no references to the extensions, I could #ifdef them out as
well.

On Thu, Oct 22, 2015 at 7:43 PM, Rob Prouse [email protected]
wrote:

Maybe just #ifdef out all those tests for CF? They are mainly intended to
ensure portable acts like desktop.
On Oct 22, 2015 10:31 PM, "CharliePoole" [email protected] wrote:

CF Reflection is big-time-different!

—
Reply to this email directly or view it on GitHub
#915 (comment).

—
Reply to this email directly or view it on GitHub
#915 (comment).

@rprouse

rprouse commented Oct 23, 2015

Copy link
Copy Markdown
Member Author

The extensions are already #ifdef'd out for all platforms except portable
except for gettypeinfo which is a straight passthrough.
On Oct 23, 2015 2:18 AM, "CharliePoole" [email protected] wrote:

If there are no references to the extensions, I could #ifdef them out as
well.

On Thu, Oct 22, 2015 at 7:43 PM, Rob Prouse [email protected]
wrote:

Maybe just #ifdef out all those tests for CF? They are mainly intended to
ensure portable acts like desktop.
On Oct 22, 2015 10:31 PM, "CharliePoole" [email protected]
wrote:

CF Reflection is big-time-different!

—
Reply to this email directly or view it on GitHub
#915 (comment).

—
Reply to this email directly or view it on GitHub
#915 (comment).

—
Reply to this email directly or view it on GitHub
#915 (comment).

@CharliePoole

Copy link
Copy Markdown
Member

I think this is ready to merge.

@rprouse

rprouse commented Oct 24, 2015

Copy link
Copy Markdown
Member Author

Your additional changes look good to me.

rprouse added a commit that referenced this pull request Oct 24, 2015
Merge .NET Core support into the portable libraries
@rprouse
rprouse merged commit d7f8451 into master Oct 24, 2015
@rprouse
rprouse deleted the issue-575 branch October 24, 2015 20:32
@ctaggart

Copy link
Copy Markdown
Contributor

This is really great to see coreclr support! I'm really looking forward to a new NuGet build with this so that we can get the Visual F# tests working for coreclr. dotnet/fsharp#697

@rprouse

rprouse commented Oct 25, 2015

Copy link
Copy Markdown
Member Author

@ctaggart, if only we were pushing NuGet packages to MyGet.org from CI builds! One of too many things on our ToDo list and not enough hands 😄

I am testing the NuGet now with Xamarin and DNX. If everything looks good, I can get you a copy for testing.

@ctaggart

Copy link
Copy Markdown
Contributor

@ctaggart

Copy link
Copy Markdown
Contributor

I'm working on setting this up. I may have have a pull request ready in about an hour.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for ASP.NET 5 and the new Core CLR

3 participants