diff options
author | Atsushi Eno <atsushieno@gmail.com> | 2014-08-11 11:51:34 +0400 |
---|---|---|
committer | Atsushi Eno <atsushieno@gmail.com> | 2014-08-11 16:53:34 +0400 |
commit | 7ec59c31770f4e341b423830a090fc74e1a32b25 (patch) | |
tree | 487146ee40480860afee9b540ce043030112dddc /mcs/class/Microsoft.Build/Test | |
parent | d09be4600c29734b60a2b2fcedbac4aa58816ea6 (diff) |
[ms.build] Fix bug #20961 - add KeepDuplicates etc. to 4.0 as internal.
Since NET_4_0 and NET_4_5 share the same ToolsVersion (4.0) there seems no
way to distinguish the appropriate framework .targets file, so I ended up
to add the missing members as internal for 4.0.
Diffstat (limited to 'mcs/class/Microsoft.Build/Test')
-rw-r--r-- | mcs/class/Microsoft.Build/Test/Microsoft.Build.Evaluation/ProjectCollectionTest.cs | 6 | ||||
-rw-r--r-- | mcs/class/Microsoft.Build/Test/Microsoft.Build.Evaluation/ProjectTest.cs | 55 |
2 files changed, 23 insertions, 38 deletions
diff --git a/mcs/class/Microsoft.Build/Test/Microsoft.Build.Evaluation/ProjectCollectionTest.cs b/mcs/class/Microsoft.Build/Test/Microsoft.Build.Evaluation/ProjectCollectionTest.cs index 2430ecce09e..970240fa74b 100644 --- a/mcs/class/Microsoft.Build/Test/Microsoft.Build.Evaluation/ProjectCollectionTest.cs +++ b/mcs/class/Microsoft.Build/Test/Microsoft.Build.Evaluation/ProjectCollectionTest.cs @@ -40,15 +40,13 @@ namespace MonoTests.Microsoft.Build.Evaluation public class ProjectCollectionTest { [Test] -#if NET_4_0 - // BXC #20961 - [Category ("NotWorking")] -#endif public void GlobalProperties () { var g = ProjectCollection.GlobalProjectCollection; Assert.AreEqual (0, g.GlobalProperties.Count, "#1"); + #if NET_4_5 Assert.IsTrue (g.GlobalProperties.IsReadOnly, "#2"); + #endif } [Test] diff --git a/mcs/class/Microsoft.Build/Test/Microsoft.Build.Evaluation/ProjectTest.cs b/mcs/class/Microsoft.Build/Test/Microsoft.Build.Evaluation/ProjectTest.cs index f5f880a0b5f..f5de47d4a73 100644 --- a/mcs/class/Microsoft.Build/Test/Microsoft.Build.Evaluation/ProjectTest.cs +++ b/mcs/class/Microsoft.Build/Test/Microsoft.Build.Evaluation/ProjectTest.cs @@ -143,12 +143,12 @@ namespace MonoTests.Microsoft.Build.Evaluation [Test] public void BuildCSharpTargetGetFrameworkPaths () { - string project_xml = @"<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003'> + string project_xml = @"<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003'> <Import Project='$(MSBuildToolsPath)\Microsoft.CSharp.targets' /> </Project>"; - var xml = XmlReader.Create (new StringReader (project_xml)); - var root = ProjectRootElement.Create (xml); - var proj = new Project (root); + var xml = XmlReader.Create (new StringReader (project_xml)); + var root = ProjectRootElement.Create (xml); + var proj = new Project (root); root.FullPath = "ProjectTest.BuildCSharpTargetGetFrameworkPaths.proj"; Assert.IsTrue (proj.Build ("GetFrameworkPaths", new ILogger [] {/*new ConsoleLogger ()*/})); } @@ -156,14 +156,14 @@ namespace MonoTests.Microsoft.Build.Evaluation [Test] public void ProperiesMustBeDistinct () { - string project_xml = @"<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003'> + string project_xml = @"<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003'> <PropertyGroup> <AssemblyName>Foo</AssemblyName> <OutputPath>Test</OutputPath> </PropertyGroup> </Project>"; - var xml = XmlReader.Create (new StringReader (project_xml)); - var root = ProjectRootElement.Create (xml); + var xml = XmlReader.Create (new StringReader (project_xml)); + var root = ProjectRootElement.Create (xml); root.FullPath = "ProjectTest.BuildCSharpTargetBuild.proj"; var proj = new Project (root); var list = new List<ProjectProperty> (); @@ -173,20 +173,16 @@ namespace MonoTests.Microsoft.Build.Evaluation } [Test] -#if NET_4_0 - // BXC #20961 - [Category ("NotWorking")] -#endif public void BuildCSharpTargetBuild () { - string project_xml = @"<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003'> + string project_xml = @"<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003'> <PropertyGroup> <AssemblyName>Foo</AssemblyName> </PropertyGroup> <Import Project='$(MSBuildToolsPath)\Microsoft.CSharp.targets' /> </Project>"; - var xml = XmlReader.Create (new StringReader (project_xml)); - var root = ProjectRootElement.Create (xml); + var xml = XmlReader.Create (new StringReader (project_xml)); + var root = ProjectRootElement.Create (xml); root.FullPath = "ProjectTest.BuildCSharpTargetBuild.proj"; var proj = new Project (root, null, "4.0"); Assert.IsFalse (proj.Build ("Build", new ILogger [] {/*new ConsoleLogger (LoggerVerbosity.Diagnostic)*/})); // missing mandatory properties @@ -195,7 +191,7 @@ namespace MonoTests.Microsoft.Build.Evaluation [Test] public void EvaluateItemConditionThenIgnored () { - string project_xml = @"<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003'> + string project_xml = @"<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003'> <PropertyGroup> <P></P> </PropertyGroup> @@ -218,7 +214,7 @@ namespace MonoTests.Microsoft.Build.Evaluation public void EvaluateSamePropertiesInOrder () { // used in Microsoft.Common.targets - string project_xml = @"<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003'> + string project_xml = @"<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003'> <PropertyGroup> <BaseIntermediateOutputPath Condition=""'$(BaseIntermediateOutputPath)' == ''"">obj\</BaseIntermediateOutputPath> </PropertyGroup> @@ -258,52 +254,44 @@ namespace MonoTests.Microsoft.Build.Evaluation } [Test] -#if NET_4_0 - // BXC #20961 - [Category ("NotWorking")] -#endif public void CreateProjectInstance () { - string project_xml = @"<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003'> + string project_xml = @"<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003'> <PropertyGroup> <AssemblyName>Foo</AssemblyName> </PropertyGroup> <Import Project='$(MSBuildToolsPath)\Microsoft.CSharp.targets' /> </Project>"; - var xml = XmlReader.Create (new StringReader (project_xml)); - var root = ProjectRootElement.Create (xml); + var xml = XmlReader.Create (new StringReader (project_xml)); + var root = ProjectRootElement.Create (xml); var proj = new Project (root, null, "4.0"); var inst = proj.CreateProjectInstance (); Assert.AreEqual ("4.0", inst.ToolsVersion, "#1"); } [Test] -#if NET_4_0 - // BXC #20961 - [Category ("NotWorking")] -#endif public void LoadCaseInsensitive () { - string project_xml = @"<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003'> + string project_xml = @"<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003'> <PropertyGroup> <AssemblyName>Foo</AssemblyName> </PropertyGroup> <Import Project='$(MSBuildToolsPath)\Microsoft.CSharp.Targets' /> </Project>"; - var xml = XmlReader.Create (new StringReader (project_xml)); - var root = ProjectRootElement.Create (xml); + var xml = XmlReader.Create (new StringReader (project_xml)); + var root = ProjectRootElement.Create (xml); new Project (root, null, "4.0"); } [Test] public void SameNameTargets () { - string project_xml = @"<Project DefaultTargets='Foo' xmlns='http://schemas.microsoft.com/developer/msbuild/2003'> + string project_xml = @"<Project DefaultTargets='Foo' xmlns='http://schemas.microsoft.com/developer/msbuild/2003'> <Target Name='Foo'><Message Text='This should not be written' /></Target> <Target Name='Foo'><Message Text='This will be written' /></Target> </Project>"; - var xml = XmlReader.Create (new StringReader (project_xml)); - var root = ProjectRootElement.Create (xml); + var xml = XmlReader.Create (new StringReader (project_xml)); + var root = ProjectRootElement.Create (xml); var proj = new Project (root, null, "4.0"); var sw = new StringWriter (); proj.Build (new ConsoleLogger (LoggerVerbosity.Diagnostic, sw.WriteLine, null, null)); @@ -338,4 +326,3 @@ namespace MonoTests.Microsoft.Build.Evaluation } } } - |