From 20a42782e9fc05f6d75b03dbb76e5f6e7d303cf8 Mon Sep 17 00:00:00 2001 From: Ankit Jain Date: Wed, 9 Mar 2011 18:01:15 +0530 Subject: [PATCH] [xbuild] Fix test on windows. AssignTargetPathTest.TestLink : Fix test on windows --- .../AssignTargetPathTest.cs | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) 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); -- 2.25.1