From: Ankit Jain Date: Wed, 9 Mar 2011 12:31:15 +0000 (+0530) Subject: [xbuild] Fix test on windows. X-Git-Url: http://wien.tomnetworks.com/gitweb/?p=mono.git;a=commitdiff_plain;h=20a42782e9fc05f6d75b03dbb76e5f6e7d303cf8 [xbuild] Fix test on windows. AssignTargetPathTest.TestLink : Fix test on windows --- diff --git a/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/AssignTargetPathTest.cs b/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/AssignTargetPathTest.cs index 6524e0b1f2e..43917b03e34 100755 --- a/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/AssignTargetPathTest.cs +++ b/mcs/class/Microsoft.Build.Tasks/Test/Microsoft.Build.Tasks/AssignTargetPathTest.cs @@ -148,7 +148,11 @@ namespace MonoTests.Microsoft.Build.Tasks Assert.IsTrue(project.Build("1"), id + "1 : Error in building"); string [] files = new string [] { "xyz.cs", "rel/bar.resx", "rel/qwe.txt"}; - string [] assignedFiles = new string [] { "Test/Link/xyz.cs", "Test/Link/bar.resx", "../Test/Link/qwe.txt"}; + string [] assignedFiles = new string [] { + PathCombine ("Test", "Link", "xyz.cs"), + PathCombine ("Test", "Link", "bar.resx"), + PathCombine ("..", "Test", "Link", "qwe.txt") + }; BuildItemGroup include = project.GetEvaluatedItemsByName("FooPath"); Assert.AreEqual(files.Length, include.Count, id + "2"); @@ -162,6 +166,18 @@ namespace MonoTests.Microsoft.Build.Tasks } } + string PathCombine (string path1, params string[] parts) + { + if (parts == null || parts.Length == 0) + return path1; + + string final_path = path1; + foreach (string part in parts) + final_path = Path.Combine (final_path, part); + + return final_path; + } + void CheckTargetPath(string[] files, string[] assignedFiles, string rootFolder, string id) { Engine engine = new Engine(Consts.BinPath);