Skip to content

Commit

Permalink
Merge pull request dotnet#563 from radical/fix-win-tests
Browse files Browse the repository at this point in the history
Disable tests on windows/mono - green build
  • Loading branch information
AndyGerlicher committed Apr 8, 2016
2 parents ce0297d + fa10327 commit 5a2dcc6
Show file tree
Hide file tree
Showing 16 changed files with 51 additions and 22 deletions.
1 change: 1 addition & 0 deletions dir.targets
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
<XunitOptions Condition="'$(OS)'=='FreeBSD'">$(XunitOptions) -notrait category=nonfreebsdtests</XunitOptions>

<XunitOptions Condition="'$(OS)'=='OSX' and '$(MonoBuild)' == 'true'">$(XunitOptions) -notrait category=mono-osx-failing</XunitOptions>
<XunitOptions Condition="'$(OS)'=='Windows_NT' and '$(MonoBuild)' == 'true'">$(XunitOptions) -notrait category=mono-windows-failing</XunitOptions>
</PropertyGroup>

<Target Name="CopyBuildOutputToDeploymentDirectories">
Expand Down
9 changes: 9 additions & 0 deletions src/Shared/NativeMethodsShared.cs
Original file line number Diff line number Diff line change
Expand Up @@ -539,6 +539,15 @@ internal static string OSName
}
}

/// <summary>
/// OS name that can be used for the msbuildExtensionsPathSearchPaths element
/// for a toolset
/// </summary>
internal static string GetOSNameForExtensionsPath()
{
return IsOSX ? "osx" : (IsUnix ? "unix" : "windows");
}

/// <summary>
/// The base directory for all framework paths in Mono
/// </summary>
Expand Down
1 change: 1 addition & 0 deletions src/Utilities/UnitTests/TaskItem_Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,7 @@ public void SetNullMetadataValue()
/// </summary>
[Fact]
[Trait("Category", "mono-osx-failing")]
[Trait("Category", "mono-windows-failing")]
public void RemoteTaskItem()
{
AppDomain appDomain = null;
Expand Down
2 changes: 2 additions & 0 deletions src/Utilities/UnitTests/ToolLocationHelper_Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3772,6 +3772,7 @@ public void ResolveSDKFromDirectory()
/// get the expected set out.
/// </summary>
[Fact]
[Trait("Category", "mono-windows-failing")]
public void ResolveSDKFromRegistry()
{
if (!NativeMethodsShared.IsWindows)
Expand Down Expand Up @@ -3865,6 +3866,7 @@ public void ResolveSDKFromRegistry()
/// </summary>
[Fact]
[Trait("Category", "mono-osx-failing")]
[Trait("Category", "mono-windows-failing")]
public void ResolveSDKFromRegistryAndDisk()
{
Dictionary<TargetPlatformSDK, TargetPlatformSDK> targetPlatforms = new Dictionary<TargetPlatformSDK, TargetPlatformSDK>();
Expand Down
21 changes: 1 addition & 20 deletions src/XMakeBuildEngine/Definition/ToolsetReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,7 @@ bool accumulateProperties
try
{
toolset = new Toolset(toolsVersion.Name, toolsPath == null ? binPath : toolsPath, properties, _environmentProperties, globalProperties, subToolsets, MSBuildOverrideTasksPath, DefaultOverrideToolsVersion);
toolset.MSBuildExtensionsPathSearchPathsTable = GetMSBuildExtensionPathsSearchPathsTable(toolsVersion.Name, GetOSNameForExtensionsPath());
toolset.MSBuildExtensionsPathSearchPathsTable = GetMSBuildExtensionPathsSearchPathsTable(toolsVersion.Name, NativeMethodsShared.GetOSNameForExtensionsPath());
}
catch (ArgumentException e)
{
Expand All @@ -526,25 +526,6 @@ bool accumulateProperties
return toolset;
}

/// <summary>
/// OS name that can be used for the msbuildExtensionsPathSearchPaths element
/// for a toolset
/// </summary>
private static string GetOSNameForExtensionsPath()
{
if (NativeMethodsShared.IsWindows)
{
return "windows";
}

if (NativeMethodsShared.IsOSX)
{
return "osx";
}

return "unix";
}

/// <summary>
/// Create a dictionary with standard properties.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,7 @@ public void SaveReadOnly3()
[Fact]
[Trait("Category", "netcore-osx-failing")]
[Trait("Category", "mono-osx-failing")]
[Trait("Category", "mono-windows-failing")]
public void SaveReadOnly4()
{
var doc = new XmlDocumentWithLocation(loadAsReadOnly: true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ public void ImportFromExtensionsPathAnd32And64()
<property name=""MSBuildToolsPath"" value="".""/>
<property name=""MSBuildBinPath"" value=""" + /*v4Folder*/"." + @"""/>
<msbuildExtensionsPathSearchPaths>
<searchPaths os=""osx"">
<searchPaths os=""" + NativeMethodsShared.GetOSNameForExtensionsPath() + @""">
<property name=""MSBuildExtensionsPath"" value=""{0}"" />
<property name=""MSBuildExtensionsPath32"" value=""{1}"" />
<property name=""MSBuildExtensionsPath64"" value=""{2}"" />
Expand Down Expand Up @@ -494,7 +494,7 @@ private ToolsetConfigurationReader WriteConfigFileAndGetReader(string extnPathPr
<property name=""MSBuildToolsPath"" value=""."" />
<property name=""MSBuildBinPath"" value=""."" />
<msbuildExtensionsPathSearchPaths>
<searchPaths os=""osx"">
<searchPaths os=""" + NativeMethodsShared.GetOSNameForExtensionsPath() + @""">
<property name=""" + extnPathPropertyName + @""" value=""" + combinedExtnDirs + @""" />
</searchPaths>
</msbuildExtensionsPathSearchPaths>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -702,6 +702,7 @@ public void EncodingGetterBasedOnActualEncodingWhenXmlDeclarationIsAbsent()
/// </summary>
[Fact]
[Trait("Category", "mono-osx-failing")]
[Trait("Category", "mono-windows-failing")]
public void SaveUnmodifiedWithNewEncoding()
{
ProjectRootElement project = ProjectRootElement.Create(XmlReader.Create(new StringReader(ObjectModelHelpers.CleanupFileContents(@"
Expand Down
2 changes: 2 additions & 0 deletions src/XMakeCommandLine/UnitTests/XMake_Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1002,6 +1002,7 @@ public void ResponseFileInProjectDirectoryCommandLineWins()
/// but lower precedence than the actual command line and higher than the msbuild.rsp next to msbuild.exe
/// </summary>
[Fact]
[Trait("Category", "mono-windows-failing")]
public void ResponseFileInProjectDirectoryWinsOverMainMSBuildRsp()
{
string directory = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString("N"));
Expand Down Expand Up @@ -1048,6 +1049,7 @@ public void ResponseFileInProjectDirectoryWinsOverMainMSBuildRsp()
/// but not if it's the same as the msbuild.exe directory
/// </summary>
[Fact]
[Trait("Category", "mono-windows-failing")]
public void ProjectDirectoryIsMSBuildExeDirectory()
{
string directory = Path.Combine(Path.GetTempPath(), Guid.NewGuid().ToString("N"));
Expand Down
1 change: 1 addition & 0 deletions src/XMakeTasks/UnitTests/AxTlbBaseTask_Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public void DelaySign()
/// Tests the /keycontainer: switch
/// </summary>
[Fact]
[Trait("Category", "mono-windows-failing")]
public void KeyContainer()
{
if (!NativeMethodsShared.IsWindows)
Expand Down
3 changes: 3 additions & 0 deletions src/XMakeTasks/UnitTests/CommandLineGenerator_Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ sealed public class CommandLineGenerator_Tests
/// </summary>
[Fact]
[Trait("Category", "mono-osx-failing")]
[Trait("Category", "mono-windows-failing")]
public void BasicCommandLine()
{
CommandLineGenerator generator = CreateGenerator();
Expand All @@ -109,6 +110,7 @@ public void BasicCommandLine()
/// </summary>
[Fact]
[Trait("Category", "mono-osx-failing")]
[Trait("Category", "mono-windows-failing")]
public void TemplatedCommandLine()
{
CommandLineGenerator generator = CreateGenerator();
Expand All @@ -122,6 +124,7 @@ public void TemplatedCommandLine()
/// </summary>
[Fact]
[Trait("Category", "mono-osx-failing")]
[Trait("Category", "mono-windows-failing")]
public void TemplateParametersAreCaseInsensitive()
{
CommandLineGenerator generator = CreateGenerator();
Expand Down
10 changes: 10 additions & 0 deletions src/XMakeTasks/UnitTests/GenerateResourceOutOfProc_Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
namespace Microsoft.Build.UnitTests.GenerateResource_Tests.OutOfProc
{
[Trait("Category", "mono-osx-failing")]
[Trait("Category", "mono-windows-failing")]
sealed public class RequiredTransformations
{
/// <summary>
Expand Down Expand Up @@ -513,6 +514,7 @@ public void NothingOutOfDate()
/// <remarks>System dll is not locked because it forces a new app domain</remarks>
[Fact]
[Trait("Category", "mono-osx-failing")]
[Trait("Category", "mono-windows-failing")]
public void NothingOutOfDateExceptReference()
{
string resxFile = null;
Expand Down Expand Up @@ -1204,6 +1206,7 @@ public void TextToResourcesBadFormat()
/// </summary>
[Fact]
[Trait("Category", "mono-osx-failing")]
[Trait("Category", "mono-windows-failing")]
public void FailedResXReader()
{
string resxFile1 = null;
Expand Down Expand Up @@ -1256,6 +1259,7 @@ public void FailedResXReader()
/// </summary>
[Fact]
[Trait("Category", "mono-osx-failing")]
[Trait("Category", "mono-windows-failing")]
public void FailedResXReaderWithAllOutputResourcesSpecified()
{
string resxFile1 = null;
Expand Down Expand Up @@ -1601,6 +1605,7 @@ public void OutputFilesNotSpecified()
/// </summary>
[Fact]
[Trait("Category", "mono-osx-failing")]
[Trait("Category", "mono-windows-failing")]
public void FilesWrittenSet()
{
GenerateResource t = Utilities.CreateTaskOutOfProc();
Expand Down Expand Up @@ -1643,6 +1648,7 @@ public void FilesWrittenSet()
/// </summary>
[Fact]
[Trait("Category", "mono-osx-failing")]
[Trait("Category", "mono-windows-failing")]
public void OutputFilesPartialInputs()
{
GenerateResource t = Utilities.CreateTaskOutOfProc();
Expand Down Expand Up @@ -1710,6 +1716,7 @@ public void OutputFilesPartialInputs()
/// </summary>
[Fact]
[Trait("Category", "mono-osx-failing")]
[Trait("Category", "mono-windows-failing")]
public void StronglyTypedClassName()
{
GenerateResource t = Utilities.CreateTaskOutOfProc();
Expand Down Expand Up @@ -1752,6 +1759,7 @@ public void StronglyTypedClassName()
/// </summary>
[Fact]
[Trait("Category", "mono-osx-failing")]
[Trait("Category", "mono-windows-failing")]
public void StronglyTypedFileName()
{
GenerateResource t = Utilities.CreateTaskOutOfProc();
Expand Down Expand Up @@ -1888,6 +1896,7 @@ public void SourceItemMissing()
/// </summary>
[Fact]
[Trait("Category", "mono-osx-failing")]
[Trait("Category", "mono-windows-failing")]
public void StateFileUnwritable()
{
GenerateResource t = Utilities.CreateTaskOutOfProc();
Expand Down Expand Up @@ -2087,6 +2096,7 @@ public void StronglyTypedResourceWithMoreThanOneInputResourceFile()
/// </summary>
[Fact]
[Trait("Category", "mono-osx-failing")]
[Trait("Category", "mono-windows-failing")]
public void BadStronglyTypedFilename()
{
string txtFile = null;
Expand Down
4 changes: 4 additions & 0 deletions src/XMakeTasks/UnitTests/GenerateResource_Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
namespace Microsoft.Build.UnitTests.GenerateResource_Tests.InProc
{
[Trait("Category", "mono-osx-failing")]
[Trait("Category", "mono-windows-failing")]
sealed public class RequiredTransformations
{
/// <summary>
Expand Down Expand Up @@ -1854,6 +1855,7 @@ public void OutputFilesPartialInputs()
[Fact(Skip = "Does not support strongly typed resources on netcore")]
#endif
[Trait("Category", "mono-osx-failing")]
[Trait("Category", "mono-windows-failing")]
public void StronglyTypedClassName()
{
GenerateResource t = Utilities.CreateTask();
Expand Down Expand Up @@ -1904,6 +1906,7 @@ public void StronglyTypedClassName()
[Fact(Skip = "Does not support strongly typed resources on netcore")]
#endif
[Trait("Category", "mono-osx-failing")]
[Trait("Category", "mono-windows-failing")]
public void StronglyTypedFileName()
{
GenerateResource t = Utilities.CreateTask();
Expand Down Expand Up @@ -2007,6 +2010,7 @@ public void ReferencesToBadAssemblies()
/// </summary>
[Fact]
[Trait("Category", "mono-osx-failing")]
[Trait("Category", "mono-windows-failing")]
public void SourceItemMissing()
{
string txtFile = null;
Expand Down
2 changes: 2 additions & 0 deletions src/XMakeTasks/UnitTests/GetInstalledSDKLocations_Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,7 @@ public void GetSDKVersions()
/// </summary>
[Fact]
[Trait("Category", "mono-osx-failing")]
[Trait("Category", "mono-windows-failing")]
public void GetGoodSDKs()
{
try
Expand Down Expand Up @@ -403,6 +404,7 @@ public void GetGoodSDKs()
/// </summary>
[Fact]
[Trait("Category", "mono-osx-failing")]
[Trait("Category", "mono-windows-failing")]
public void GetGoodSDKs2()
{
try
Expand Down
1 change: 1 addition & 0 deletions src/XMakeTasks/UnitTests/GetSDKReference_Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -504,6 +504,7 @@ public void VerifyNoCopyWhenReferenceOnlyIsTrue()
/// </summary>
[Fact]
[Trait("Category", "mono-osx-failing")]
[Trait("Category", "mono-windows-failing")]
public void GetReferenceAssembliesWhenExpandTrueCopyLocalFalse()
{
MockEngine engine = new MockEngine();
Expand Down
10 changes: 10 additions & 0 deletions src/XMakeTasks/UnitTests/ResolveAssemblyReference_Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5560,6 +5560,7 @@ sealed public class Perf : ResolveAssemblyReferenceTestFixture
{
[Fact]
[Trait("Category", "mono-osx-failing")]
[Trait("Category", "mono-windows-failing")]
public void AutoUnifyUsesMinimumIO()
{
// This WriteLine is a hack. On a slow machine, the Tasks unittest fails because remoting
Expand Down Expand Up @@ -5756,6 +5757,7 @@ public void SameVersionSameFrameworkInDirect()
/// </summary>
[Fact]
[Trait("Category", "mono-osx-failing")]
[Trait("Category", "mono-windows-failing")]
public void HigherVersionButSpecificVersionInDirect()
{
MockEngine e = new MockEngine();
Expand Down Expand Up @@ -5819,6 +5821,7 @@ public void HigherVersionInDirect()
/// </summary>
[Fact]
[Trait("Category", "mono-osx-failing")]
[Trait("Category", "mono-windows-failing")]
public void HigherVersionInDirectIgnoreMismatch()
{
MockEngine e = new MockEngine();
Expand Down Expand Up @@ -7812,6 +7815,7 @@ public void CopyLocalLegacyBehavior()
/// </summary>
[Fact]
[Trait("Category", "mono-osx-failing")]
[Trait("Category", "mono-windows-failing")]
public void Basic()
{
// This WriteLine is a hack. On a slow machine, the Tasks unittest fails because remoting
Expand Down Expand Up @@ -8748,6 +8752,7 @@ public void AssemblyFoldersExProcessorArchMSILX86()
/// </summary>
[Fact]
[PlatformSpecific(Xunit.PlatformID.Windows)]
[Trait("Category", "mono-windows-failing")]
public void VerifyProcessArchitectureMismatchWarning()
{
ResolveAssemblyReference t = new ResolveAssemblyReference();
Expand All @@ -8773,6 +8778,7 @@ public void VerifyProcessArchitectureMismatchWarning()
/// </summary>
[Fact]
[PlatformSpecific(Xunit.PlatformID.Windows)]
[Trait("Category", "mono-windows-failing")]
public void VerifyProcessArchitectureMismatchWarningDefault()
{
ResolveAssemblyReference t = new ResolveAssemblyReference();
Expand All @@ -8797,6 +8803,7 @@ public void VerifyProcessArchitectureMismatchWarningDefault()
/// </summary>
[Fact]
[PlatformSpecific(Xunit.PlatformID.Windows)]
[Trait("Category", "mono-windows-failing")]
public void VerifyProcessArchitectureMismatchError()
{
ResolveAssemblyReference t = new ResolveAssemblyReference();
Expand Down Expand Up @@ -11410,6 +11417,7 @@ public void ConflictingDependenciesWithNonMatchingNamesAndHardReferenceInProject
/// </summary>
[Fact]
[Trait("Category", "mono-osx-failing")]
[Trait("Category", "mono-windows-failing")]
public void SpecificVersionFalse()
{
ResolveAssemblyReference t = new ResolveAssemblyReference();
Expand Down Expand Up @@ -12920,6 +12928,7 @@ public void PartialNameMatchingFromRedist()

[Fact]
[Trait("Category", "mono-osx-failing")]
[Trait("Category", "mono-windows-failing")]
public void Regress46599_BogusInGACValueForAssemblyInRedistList()
{
ResolveAssemblyReference t = new ResolveAssemblyReference();
Expand Down Expand Up @@ -12972,6 +12981,7 @@ public void Regress46599_BogusInGACValueForAssemblyInRedistList()

[Fact]
[Trait("Category", "mono-osx-failing")]
[Trait("Category", "mono-windows-failing")]
public void VerifyFrameworkFileMetadataFiles()
{
ResolveAssemblyReference t = new ResolveAssemblyReference();
Expand Down

0 comments on commit 5a2dcc6

Please sign in to comment.