diff --git a/src/redist/targets/BundledTemplates.targets b/src/redist/targets/BundledTemplates.targets index 7a3502743..28e7f1f75 100644 --- a/src/redist/targets/BundledTemplates.targets +++ b/src/redist/targets/BundledTemplates.targets @@ -26,6 +26,11 @@ + + + + + diff --git a/test/EndToEnd/GivenUnixPlatform.cs b/test/EndToEnd/GivenUnixPlatform.cs new file mode 100644 index 000000000..83e377f7a --- /dev/null +++ b/test/EndToEnd/GivenUnixPlatform.cs @@ -0,0 +1,29 @@ +using System; +using System.IO; +using System.Linq; +using System.Xml.Linq; +using Microsoft.DotNet.TestFramework; +using Microsoft.DotNet.Tools.Test.Utilities; +using Xunit; + +namespace EndToEnd.Tests +{ + public class GivenUnixPlatform : TestBase + { + [UnixOnlyTheory] + [InlineData("wpf")] + [InlineData("winforms")] + public void ItDoesNotIncludeWindowsOnlyProjectTemplates(string template) + { + var directory = TestAssets.CreateTestDirectory(); + + new NewCommandShim() + .WithWorkingDirectory(directory.FullName) + .Execute(template) + .Should() + .Fail() + .And + .HaveStdErrContaining($": {template}."); + } + } +} diff --git a/test/Microsoft.DotNet.Tools.Tests.Utilities/UnixOnlyTheoryAttribute.cs b/test/Microsoft.DotNet.Tools.Tests.Utilities/UnixOnlyTheoryAttribute.cs new file mode 100644 index 000000000..fe0557b88 --- /dev/null +++ b/test/Microsoft.DotNet.Tools.Tests.Utilities/UnixOnlyTheoryAttribute.cs @@ -0,0 +1,19 @@ +// Copyright (c) .NET Foundation and contributors. All rights reserved. +// Licensed under the MIT license. See LICENSE file in the project root for full license information. + +using Microsoft.DotNet.PlatformAbstractions; +using Xunit; + +namespace Microsoft.DotNet.Tools.Test.Utilities +{ + public class UnixOnlyTheoryAttribute : TheoryAttribute + { + public UnixOnlyTheoryAttribute() + { + if (RuntimeEnvironment.OperatingSystemPlatform == Platform.Windows) + { + this.Skip = "This test requires Unix to run"; + } + } + } +}