Skip to content

Enable Path, File and Directory Assert/Constraints in the .NET Standard Build #1915

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

Merged
merged 11 commits into from
Dec 1, 2016

Conversation

rprouse
Copy link
Member

@rprouse rprouse commented Nov 30, 2016

This started off as just dropping the PORTABLE define from the .NET Standard builds so that we can start to re-enable some of the features that are not available in the PORTABLE version of the framework. As a part of that, I have documented what is still not enabled and will create issues to document or re-enable those that are remaining.

As a part of this, I enabled all of the file, path and directory based asserts that weren't available in PORTABLE. I don't have an issue for that, so I am marking this PR with the 3.6 milestone to track for the release.

The steps I took for this were,

  1. Remove the PORTABLE define in all of the .NET Standard projects
  2. Wherever possible, rewrite code that wasn't compiling to work in .NET Standard
  3. As a last resort, add the needed #if NETSTANDARD1_6 blocks and document the not supported functionality

This is a large PR because so many files were touched, but most of the changes are fairly rote.

I also updated the nuspec files which fixes #1904

@rprouse rprouse added this to the 3.6 milestone Nov 30, 2016
var logName = string.Format(LOG_FILE_FORMAT, Process.GetCurrentProcess().Id, Path.GetFileName(assemblyPath));
: Directory.GetCurrentDirectory();
#if NETSTANDARD1_6
var id = DateTime.Now.ToString("o");
Copy link
Member Author

Choose a reason for hiding this comment

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

Can't get the process ID AFAIK, so opted for the current date as an id.

@@ -41,7 +41,7 @@ public static Exception Throws(IResolveConstraint expression, TestDelegate code,
{
Exception caughtException = null;

#if NET_4_0 || NET_4_5 || PORTABLE
#if NET_4_0 || NET_4_5 || PORTABLE || NETSTANDARD1_6
Copy link
Member Author

Choose a reason for hiding this comment

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

We should probably have a feature define like ASYNC for these.

@@ -49,12 +49,6 @@
<Compile Include="..\FrameworkVersion.cs">
<Link>Properties\FrameworkVersion.cs</Link>
</Compile>
<Compile Include="..\nunitlite\ColorConsole.cs">
Copy link
Member Author

Choose a reason for hiding this comment

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

These are now included in NUnitLite like in the other projects.

@@ -539,23 +539,6 @@ public override void GetObjectData (SerializationInfo info, StreamingContext con

public class OptionSet : KeyedCollection<string, Option>
{
#if !PORTABLE
Copy link
Member Author

Choose a reason for hiding this comment

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

We never use the localizer, so easier to easier to just use the PORTABLE null-op version for everything.

@rprouse
Copy link
Member Author

rprouse commented Nov 30, 2016

I have switched all of the async code to use #if ASYNC which is more explicit, like we do with #if PARALLEL

@CharliePoole
Copy link
Member

It looks good to me but I think you may want to merge in the latest from master manually. I believe I made some changes to defines that you don't have. I'm OK either way though.

@rprouse
Copy link
Member Author

rprouse commented Dec 1, 2016

I will pull in latest from master and make sure everything builds and tests pass before merging.

@rprouse
Copy link
Member Author

rprouse commented Dec 1, 2016

I've merge latest from master and ran all tests which are passing locally. This can be merged once CI passes.

@CharliePoole
Copy link
Member

I cancelled the Travis build so the netstandard branch could run. Everything was passing but it couldn't seem to find any Apple agents to run on.

@CharliePoole
Copy link
Member

Travis doesn't seem to be able to find Apple agents tonight, but the Linux jobs all passed so I'm going to go ahead and merge.

@CharliePoole CharliePoole merged commit 8a91958 into master Dec 1, 2016
@CharliePoole CharliePoole deleted the netstandard branch December 1, 2016 04:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add .NET Standard 1.6 Dependencies to the Nuspec Files
2 participants