diff --git a/AspNetCoreSdkTests/RuntimeIdentifier.cs b/AspNetCoreSdkTests/RuntimeIdentifier.cs index ced811a32b..caed20eac4 100644 --- a/AspNetCoreSdkTests/RuntimeIdentifier.cs +++ b/AspNetCoreSdkTests/RuntimeIdentifier.cs @@ -22,6 +22,12 @@ namespace AspNetCoreSdkTests OSPlatforms = new[] { OSPlatform.Linux, }, }; + public static RuntimeIdentifier OSX_x64 = new RuntimeIdentifier() + { + Name = "osx-x64", + OSPlatforms = new[] { OSPlatform.OSX, }, + }; + private RuntimeIdentifier() { } public string Name { get; private set; } diff --git a/AspNetCoreSdkTests/TemplateTests.cs b/AspNetCoreSdkTests/TemplateTests.cs index ece9ec3561..b12726b405 100644 --- a/AspNetCoreSdkTests/TemplateTests.cs +++ b/AspNetCoreSdkTests/TemplateTests.cs @@ -77,6 +77,7 @@ namespace AspNetCoreSdkTests Template.GetInstance(NuGetPackageSource.NuGetOrg, RuntimeIdentifier.Win_x64), // Self-contained, linux-x64 + // ClassLibrary does not require a package source, even for self-contained deployments Template.GetInstance(NuGetPackageSource.None, RuntimeIdentifier.Linux_x64), Template.GetInstance(NuGetPackageSource.NuGetOrg, RuntimeIdentifier.Linux_x64), Template.GetInstance(NuGetPackageSource.NuGetOrg, RuntimeIdentifier.Linux_x64), @@ -87,6 +88,19 @@ namespace AspNetCoreSdkTests Template.GetInstance(NuGetPackageSource.NuGetOrg, RuntimeIdentifier.Linux_x64), Template.GetInstance(NuGetPackageSource.NuGetOrg, RuntimeIdentifier.Linux_x64), Template.GetInstance(NuGetPackageSource.NuGetOrg, RuntimeIdentifier.Linux_x64), + + // Self-contained, osx-x64 + // ClassLibrary does not require a package source, even for self-contained deployments + Template.GetInstance(NuGetPackageSource.None, RuntimeIdentifier.OSX_x64), + Template.GetInstance(NuGetPackageSource.NuGetOrg, RuntimeIdentifier.OSX_x64), + Template.GetInstance(NuGetPackageSource.NuGetOrg, RuntimeIdentifier.OSX_x64), + Template.GetInstance(NuGetPackageSource.NuGetOrg, RuntimeIdentifier.OSX_x64), + Template.GetInstance(NuGetPackageSource.NuGetOrg, RuntimeIdentifier.OSX_x64), + Template.GetInstance(NuGetPackageSource.NuGetOrg, RuntimeIdentifier.OSX_x64), + Template.GetInstance(NuGetPackageSource.NuGetOrg, RuntimeIdentifier.OSX_x64), + Template.GetInstance(NuGetPackageSource.NuGetOrg, RuntimeIdentifier.OSX_x64), + Template.GetInstance(NuGetPackageSource.NuGetOrg, RuntimeIdentifier.OSX_x64), + Template.GetInstance(NuGetPackageSource.NuGetOrg, RuntimeIdentifier.OSX_x64), }; public static IEnumerable RestoreData = _restoreTemplates.Select(t => new TestCaseData(t)); diff --git a/AspNetCoreSdkTests/Templates/ConsoleApplicationTemplate.cs b/AspNetCoreSdkTests/Templates/ConsoleApplicationTemplate.cs index 71afa460a3..25651f5f60 100644 --- a/AspNetCoreSdkTests/Templates/ConsoleApplicationTemplate.cs +++ b/AspNetCoreSdkTests/Templates/ConsoleApplicationTemplate.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.IO; using System.Linq; +using System.Text.RegularExpressions; namespace AspNetCoreSdkTests.Templates { @@ -29,6 +30,7 @@ namespace AspNetCoreSdkTests.Templates Path.Combine("netcoreapp2.1", RuntimeIdentifier.Path, "host", $"{Name}"), } }, + { RuntimeIdentifier.OSX_x64, () => _additionalObjFilesAfterBuild[RuntimeIdentifier.Linux_x64]() }, }; public override IEnumerable ExpectedObjFilesAfterBuild => @@ -62,6 +64,10 @@ namespace AspNetCoreSdkTests.Templates "libhostpolicy.so", }.Select(p => Path.Combine(OutputPath, p))) }, + { RuntimeIdentifier.OSX_x64, () => + _additionalBinFilesAfterBuild[RuntimeIdentifier.Linux_x64]() + .Select(f => Regex.Replace(f, ".so$", ".dylib")) + }, }; public override IEnumerable ExpectedBinFilesAfterBuild => @@ -334,6 +340,18 @@ namespace AspNetCoreSdkTests.Templates "System.Security.Cryptography.Native.OpenSsl.so", }) }, + { RuntimeIdentifier.OSX_x64, () => + _additionalFilesAfterPublish[RuntimeIdentifier.Linux_x64]() + .Where(f => f != "createdump") + .Where(f => f != "libcoreclrtraceptprovider.so") + .Where(f => f != "libsosplugin.so") + .Select(f => Regex.Replace(f, ".so$", ".dylib")) + .Concat(new[] + { + "System.Security.Cryptography.Native.Apple.a", + "System.Security.Cryptography.Native.Apple.dylib", + }) + } }; public override IEnumerable ExpectedFilesAfterPublish => diff --git a/AspNetCoreSdkTests/Templates/RazorApplicationBaseTemplate.cs b/AspNetCoreSdkTests/Templates/RazorApplicationBaseTemplate.cs index 0db1f3baac..34ea6e5d27 100644 --- a/AspNetCoreSdkTests/Templates/RazorApplicationBaseTemplate.cs +++ b/AspNetCoreSdkTests/Templates/RazorApplicationBaseTemplate.cs @@ -31,6 +31,7 @@ namespace AspNetCoreSdkTests.Templates Path.Combine("netcoreapp2.1", RuntimeIdentifier.Path, "host", $"{Name}"), }) }, + { RuntimeIdentifier.OSX_x64, () => _additionalObjFilesAfterBuild[RuntimeIdentifier.Linux_x64]() }, }; public override IEnumerable ExpectedObjFilesAfterBuild => diff --git a/AspNetCoreSdkTests/Templates/RazorClassLibraryTemplate.cs b/AspNetCoreSdkTests/Templates/RazorClassLibraryTemplate.cs index f30b2bc07f..4b22df7eb2 100644 --- a/AspNetCoreSdkTests/Templates/RazorClassLibraryTemplate.cs +++ b/AspNetCoreSdkTests/Templates/RazorClassLibraryTemplate.cs @@ -345,6 +345,7 @@ namespace AspNetCoreSdkTests.Templates "System.Private.Uri.dll", }) }, + { RuntimeIdentifier.OSX_x64, () => _additionalFilesAfterPublish[RuntimeIdentifier.Linux_x64]() }, }; public override IEnumerable ExpectedFilesAfterPublish => diff --git a/AspNetCoreSdkTests/Templates/WebTemplate.cs b/AspNetCoreSdkTests/Templates/WebTemplate.cs index ae44dc7e1a..ecb6030cf9 100644 --- a/AspNetCoreSdkTests/Templates/WebTemplate.cs +++ b/AspNetCoreSdkTests/Templates/WebTemplate.cs @@ -211,6 +211,7 @@ namespace AspNetCoreSdkTests.Templates "System.Threading.Channels.dll", }) }, + { RuntimeIdentifier.OSX_x64, () => _additionalFilesAfterPublish[RuntimeIdentifier.Linux_x64]() }, }; public override IEnumerable ExpectedFilesAfterPublish =>