Author: msierad
Date: 2007-02-18 08:07:20 -0500 (Sun, 18 Feb 2007)
New Revision: 73073
Added:
trunk/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/ResolveAssemblyReferenceTest.cs
Modified:
trunk/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks_test.dll.sources
trunk/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/ChangeLog
Log:
007-02-18 Marek Sieradzki <[EMAIL PROTECTED]>
* ResolveAssemblyReferenceTest.cs: Added.
Modified:
trunk/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks_test.dll.sources
===================================================================
---
trunk/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks_test.dll.sources
2007-02-18 13:04:26 UTC (rev 73072)
+++
trunk/mcs/class/Microsoft.Build.Tasks/Microsoft.Build.Tasks_test.dll.sources
2007-02-18 13:07:20 UTC (rev 73073)
@@ -10,5 +10,6 @@
Microsoft.Build.Tasks/ManagedCompilerTest.cs
Microsoft.Build.Tasks/MessageTest.cs
Microsoft.Build.Tasks/RemoveDirTest.cs
+Microsoft.Build.Tasks/ResolveAssemblyReferenceTest.cs
Microsoft.Build.Tasks/TestEngine.cs
Microsoft.Build.Tasks/WarningTest.cs
Modified:
trunk/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/ChangeLog
===================================================================
--- trunk/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/ChangeLog
2007-02-18 13:04:26 UTC (rev 73072)
+++ trunk/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/ChangeLog
2007-02-18 13:07:20 UTC (rev 73073)
@@ -1,3 +1,7 @@
+2007-02-18 Marek Sieradzki <[EMAIL PROTECTED]>
+
+ * ResolveAssemblyReferenceTest.cs: Added.
+
2006-12-11 Marek Sieradzki <[EMAIL PROTECTED]>
* GetFrameworkSdkPath.cs, GetFrameworkPath.cs, CreateItemTest.cs,
Added:
trunk/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/ResolveAssemblyReferenceTest.cs
===================================================================
---
trunk/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/ResolveAssemblyReferenceTest.cs
2007-02-18 13:04:26 UTC (rev 73072)
+++
trunk/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/ResolveAssemblyReferenceTest.cs
2007-02-18 13:07:20 UTC (rev 73073)
@@ -0,0 +1,105 @@
+//
+// ResolveAssemblyReferenceTest.cs
+//
+// Author:
+// Marek Sieradzki ([EMAIL PROTECTED])
+//
+// (C) 2006 Marek Sieradzki
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+using System;
+using System.Collections;
+using Microsoft.Build.BuildEngine;
+using Microsoft.Build.Framework;
+using Microsoft.Build.Tasks;
+using Microsoft.Build.Utilities;
+using NUnit.Framework;
+
+namespace MonoTests.Microsoft.Build.Tasks {
+
+ [TestFixture]
+ public class ResolveAssemblyReferenceTest {
+
+ Engine engine;
+ Project project;
+ BuildItemGroup big;
+
+ [Test]
+ public void TestGac1 ()
+ {
+ string documentString = @"
+ <Project
xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">
+ <ItemGroup>
+ <Reference Include='System' />
+ </ItemGroup>
+ <Target Name='A'>
+ <ResolveAssemblyReference
+
Assemblies='@(Reference)'
+ SearchPaths=' '
+ >
+ <Output
TaskParameter='ResolvedFiles' ItemName='ResolvedFiles'/>
+ </ResolveAssemblyReference>
+ </Target>
+ </Project>
+ ";
+
+ engine = new Engine (Consts.BinPath);
+ project = engine.CreateNewProject ();
+ project.LoadXml (documentString);
+
+ Assert.IsTrue (project.Build ("A"), "A1");
+ big = project.GetEvaluatedItemsByName ("ResolvedFiles");
+ Assert.AreEqual (1, big.Count, "A2");
+ Assert.IsTrue (big [0].Include.EndsWith (".dll"), "A3");
+ }
+
+ [Test]
+ public void TestHintPath1 ()
+ {
+ string documentString = @"
+ <Project
xmlns=""http://schemas.microsoft.com/developer/msbuild/2003"">
+ <ItemGroup>
+ <Reference Include='test'>
+
<HintPath>Test/resources/test.dll</HintPath>
+ </Reference>
+ </ItemGroup>
+ <Target Name='A'>
+ <ResolveAssemblyReference
+
Assemblies='@(Reference)'
+ SearchPaths=' '
+ >
+ <Output
TaskParameter='ResolvedFiles' ItemName='ResolvedFiles'/>
+ </ResolveAssemblyReference>
+ </Target>
+ </Project>
+ ";
+
+ engine = new Engine (Consts.BinPath);
+ project = engine.CreateNewProject ();
+ project.LoadXml (documentString);
+
+ Assert.IsTrue (project.Build ("A"), "A1");
+ big = project.GetEvaluatedItemsByName ("ResolvedFiles");
+ Assert.AreEqual (1, big.Count, "A2");
+ Assert.IsTrue (big [0].Include.EndsWith (".exe"), "A3");
+ }
+ }
+}
Property changes on:
trunk/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/ResolveAssemblyReferenceTest.cs
___________________________________________________________________
Name: svn:eol-style
+ native
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches