diff options
author | Atsushi Eno <atsushieno@gmail.com> | 2014-08-13 14:32:38 +0400 |
---|---|---|
committer | Atsushi Eno <atsushieno@gmail.com> | 2014-08-13 14:35:12 +0400 |
commit | 778c3b5a0292c3691961ad5ce0351b5b9dfbc198 (patch) | |
tree | ec9dfa9fec267b3ad8df0ab81412822656f637eb /mcs/class/Microsoft.Build/Test | |
parent | b8d8f62956c377b535278195cfa5fc4c75653738 (diff) |
[MS.Build] add test regarding item condition and target-generated property.
Diffstat (limited to 'mcs/class/Microsoft.Build/Test')
-rw-r--r-- | mcs/class/Microsoft.Build/Test/Microsoft.Build.Execution/ProjectInstanceTest.cs | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/mcs/class/Microsoft.Build/Test/Microsoft.Build.Execution/ProjectInstanceTest.cs b/mcs/class/Microsoft.Build/Test/Microsoft.Build.Execution/ProjectInstanceTest.cs index 65064042864..4e23c2a7a5a 100644 --- a/mcs/class/Microsoft.Build/Test/Microsoft.Build.Execution/ProjectInstanceTest.cs +++ b/mcs/class/Microsoft.Build/Test/Microsoft.Build.Execution/ProjectInstanceTest.cs @@ -311,6 +311,34 @@ namespace MonoTests.Microsoft.Build.Execution } [Test] + public void ItemsAndPostEvaluationCondition () + { + // target-assigned property X is not considered when evaluating condition for C. + string project_xml = @"<Project DefaultTargets='X;Y' xmlns='http://schemas.microsoft.com/developer/msbuild/2003'> + <ItemGroup> + <A Include='foo.txt' /> + <B Condition='False' Include='bar.txt' /> + <C Condition=""'$(X)'=='True'"" Include='baz.txt' /> + </ItemGroup> + <Target Name='X'> + <CreateProperty Value='True'> + <Output TaskParameter='Value' PropertyName='X' /> + </CreateProperty> + </Target> + <Target Name='Y'> + <Error Condition=""'@(C)'==''"" Text='missing C. X is $(X)' /> + </Target> +</Project>"; + var xml = XmlReader.Create (new StringReader (project_xml)); + var root = ProjectRootElement.Create (xml); + root.FullPath = "ProjectInstanceTest.ItemsAndPostEvaluationCondition.proj"; + var proj = new ProjectInstance (root); + Assert.AreEqual (1, proj.Items.Count, "Count1"); + Assert.IsFalse (proj.Build (), "Build"); + Assert.AreEqual (1, proj.Items.Count, "Count2"); + } + + [Test] [Category ("NotWorking")] // until we figure out why it fails on wrench. public void ItemsInTargets () { |