diff options
author | Atsushi Eno <atsushieno@gmail.com> | 2014-01-24 12:48:19 +0400 |
---|---|---|
committer | Atsushi Eno <atsushieno@gmail.com> | 2014-02-20 13:22:21 +0400 |
commit | c9122d4cba82f17e4f5c0b36c7380f95f95a78b8 (patch) | |
tree | ed0b9850c00a46285a2c706127f40095ee20c1fd /mcs/class/Microsoft.Build/Test | |
parent | 5597172dec1ec3477974ad406ef18dc0847a8f62 (diff) |
In a Project, Target can be overriden by another one with the identical name.
Diffstat (limited to 'mcs/class/Microsoft.Build/Test')
-rw-r--r-- | mcs/class/Microsoft.Build/Test/Microsoft.Build.Evaluation/ProjectTest.cs | 16 |
1 files changed, 16 insertions, 0 deletions
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 022a92f4030..bfbcf8bdf6b 100644 --- a/mcs/class/Microsoft.Build/Test/Microsoft.Build.Evaluation/ProjectTest.cs +++ b/mcs/class/Microsoft.Build/Test/Microsoft.Build.Evaluation/ProjectTest.cs @@ -282,6 +282,22 @@ namespace MonoTests.Microsoft.Build.Evaluation 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'> + <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 proj = new Project (root, null, "4.0"); + var sw = new StringWriter (); + proj.Build (new ConsoleLogger (LoggerVerbosity.Diagnostic, sw.WriteLine, null, null)); + Assert.IsTrue (sw.ToString ().Contains ("This will be written"), "#1"); + Assert.IsFalse (sw.ToString ().Contains ("This should not be written"), "#2"); + } } } |