Imported Upstream version 3.8.0

Former-commit-id: 6a76a29bd07d86e57c6c8da45c65ed5447d38a61
This commit is contained in:
Jo Shields
2014-09-04 09:07:35 +01:00
parent a575963da9
commit fe777c5c82
1062 changed files with 12460 additions and 5983 deletions

View File

@@ -40,6 +40,10 @@ 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;

View File

@@ -173,6 +173,10 @@ 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'>
@@ -254,6 +258,10 @@ 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'>
@@ -270,6 +278,10 @@ namespace MonoTests.Microsoft.Build.Evaluation
}
[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'>

View File

@@ -291,6 +291,56 @@ namespace MonoTests.Microsoft.Build.Execution
Assert.IsNotNull (p, "#1");
Assert.AreEqual ("False", p.EvaluatedValue, "#2");
}
[Test]
public void ConditionalExpression ()
{
string project_xml = @"<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003'>
<PropertyGroup>
<NoCompilerStandardLib>true</NoCompilerStandardLib>
<ResolveAssemblyReferencesDependsOn>$(ResolveAssemblyReferencesDependsOn);_AddCorlibReference</ResolveAssemblyReferencesDependsOn>
</PropertyGroup>
</Project>";
var xml = XmlReader.Create (new StringReader (project_xml));
var root = ProjectRootElement.Create (xml);
root.FullPath = "ProjectInstanceTest.ConditionalExpression.proj";
var proj = new ProjectInstance (root);
var p = proj.GetProperty ("ResolveAssemblyReferencesDependsOn");
Assert.IsNotNull (p, "#1");
Assert.AreEqual (";_AddCorlibReference", p.EvaluatedValue, "#2");
}
[Test]
[Category ("NotWorking")] // until we figure out why it fails on wrench.
public void ItemsInTargets ()
{
string project_xml = @"<Project DefaultTargets='Default' xmlns='http://schemas.microsoft.com/developer/msbuild/2003'>
<Target Name='Default'>
<PropertyGroup>
<_ExplicitMSCorlibPath>$([Microsoft.Build.Utilities.ToolLocationHelper]::GetPathToStandardLibraries ('$(TargetFrameworkIdentifier)', '$(TargetFrameworkVersion)', '$(TargetFrameworkProfile)'))\mscorlib.dll</_ExplicitMSCorlibPath>
</PropertyGroup>
<ItemGroup>
<_ExplicitReference
Include='$(_ExplicitMSCorlibPath)'
Condition='Exists($(_ExplicitMSCorlibPath))'>
<Private>false</Private>
</_ExplicitReference>
</ItemGroup>
</Target>
<Import Project='$(MSBuildBinPath)\\Microsoft.CSharp.targets' />
</Project>";
var xml = XmlReader.Create (new StringReader (project_xml));
var root = ProjectRootElement.Create (xml);
root.FullPath = "ProjectInstanceTest.ConditionalExpression.proj";
var proj = new ProjectInstance (root, null, "4.0", ProjectCollection.GlobalProjectCollection);
proj.Build ();
// make sure the property value expansion is done successfully.
Assert.IsTrue (!string.IsNullOrEmpty (proj.GetPropertyValue ("_ExplicitMSCorlibPath")), "premise: propertyValue by ToolLocationHelper func call");
var items = proj.GetItems ("_ExplicitReference");
// make sure items are stored after build.
Assert.IsTrue (items.Any (), "items.Any");
Assert.IsTrue (!string.IsNullOrEmpty (items.First ().EvaluatedInclude), "item.EvaluatedInclude");
}
}
namespace SubNamespace

View File

@@ -335,6 +335,22 @@ namespace MonoTests.Microsoft.Build.Internal
var result = p.Build (new ILogger [] { new ConsoleLogger (LoggerVerbosity.Minimal, sw.WriteLine, null, null)});
Assert.IsTrue (result, "#1: " + sw);
}
[Test]
public void FunctionCall ()
{
string project_xml = @"<Project xmlns='http://schemas.microsoft.com/developer/msbuild/2003'>
<Target Name='Foo'>
<Warning Text=""$([Microsoft.Build.Utilities.ToolLocationHelper]::GetPathToStandardLibraries ('$(TargetFrameworkIdentifier)', '$(TargetFrameworkVersion)', '$(TargetFrameworkProfile)'))\mscorlib.dll'"" />
</Target>
</Project>";
var xml = XmlReader.Create (new StringReader (project_xml));
var root = ProjectRootElement.Create (xml);
var p = new ProjectInstance (root, null, "4.0", ProjectCollection.GlobalProjectCollection);
var sw = new StringWriter ();
var result = p.Build (new ILogger [] { new ConsoleLogger (LoggerVerbosity.Minimal, sw.WriteLine, null, null)});
Assert.IsTrue (result, "#1: " + sw);
}
}
}