40
42
public class LocalCopyTests : TestBase
43
[Ignore ("We don't install the msbuild assemblies in the right place for this tests")]
45
[Platform (Exclude = "Win")]
44
46
public void CheckLocalCopy ()
46
48
string solFile = Util.GetSampleProject ("vs-local-copy", "VSLocalCopyTest.sln");
52
54
AssertCleanBuild (sol, "Debug");
53
55
AssertCleanBuild (sol, "Release");
57
string dllDebug = Platform.IsWindows ? ".pdb" : ".dll.mdb";
58
string exeDebug = Platform.IsWindows ? ".pdb" : ".exe.mdb";
55
60
AssertOutputFiles (sol, "VSLocalCopyTest", "Debug", new string[] {
56
61
"ClassLibrary1.dll",
57
"ClassLibrary1.dll.mdb",
62
"ClassLibrary1" + dllDebug,
58
63
"ClassLibrary2.dll",
59
"ClassLibrary2.dll.mdb",
64
"ClassLibrary2" + dllDebug,
60
65
"ClassLibrary4.dll",
61
"ClassLibrary4.dll.mdb",
66
"ClassLibrary4" + dllDebug,
62
67
"VSLocalCopyTest.exe",
63
"VSLocalCopyTest.exe.mdb",
68
"VSLocalCopyTest" + exeDebug,
114
123
AssertOutputFiles (sol, "ClassLibrary3", "Debug", new string[] {
115
124
"ClassLibrary3.dll",
116
"ClassLibrary3.dll.mdb"
125
"ClassLibrary3" + dllDebug
119
128
AssertOutputFiles (sol, "ClassLibrary3", "Release", new string[] {
123
132
AssertOutputFiles (sol, "ClassLibrary4", "Debug", new string[] {
124
133
"ClassLibrary4.dll",
125
"ClassLibrary4.dll.mdb"
134
"ClassLibrary4" + dllDebug
128
137
AssertOutputFiles (sol, "ClassLibrary4", "Release", new string[] {
132
141
AssertOutputFiles (sol, "ClassLibrary5", "Debug", new string[] {
133
142
"ClassLibrary5.dll",
134
"ClassLibrary5.dll.mdb",
143
"ClassLibrary5" + dllDebug,
137
146
AssertOutputFiles (sol, "ClassLibrary5", "Release", new string[] {
182
191
BuildResult cr = sol.Build (Util.GetMonitor (), configuration);
183
192
Assert.IsNotNull (cr);
184
193
Assert.AreEqual (0, cr.ErrorCount);
185
Assert.AreEqual (0, cr.WarningCount);
195
// Warning check disabled due to bug #15121
196
// Assert.AreEqual (0, cr.WarningCount);
200
[Ignore ("Check for build warnings disabled due to a bug in xbuild (BXC 15121)")]
201
public void CheckLocalCopyBuildWarnings ()
203
// See commented assert in AssertCleanBuild
207
[Platform (Exclude = "Win")]
208
public void LocalCopyDefault ()
210
string solFile = Util.GetSampleProject ("local-copy-package", "ConsoleProject.sln");
212
WorkspaceItem item = Services.ProjectService.ReadWorkspaceItem (Util.GetMonitor (), solFile);
213
Solution sol = (Solution) item;
214
var p = (DotNetProject)sol.Items [0];
216
var ar = p.References.First (r => r.Reference.Contains ("gtk"));
217
Assert.AreEqual (false, ar.LocalCopy);
219
Assert.AreEqual (true, ar.LocalCopy);
221
ar = p.References.First (r => r.Reference.Contains ("System.Data"));
222
Assert.AreEqual (false, ar.LocalCopy);
224
Assert.AreEqual (true, ar.LocalCopy);
226
ar = p.References.First (r => r.Reference.Contains ("LibProject"));
227
Assert.AreEqual (true, ar.LocalCopy);
228
ar.LocalCopy = false;
229
Assert.AreEqual (false, ar.LocalCopy);
231
ar = p.References.First (r => r.Reference.Contains ("Xwt"));
232
Assert.AreEqual (true, ar.LocalCopy);
233
ar.LocalCopy = false;
234
Assert.AreEqual (false, ar.LocalCopy);
236
sol.Save (new NullProgressMonitor ());
237
sol.Build (new NullProgressMonitor (), "Debug");
239
string exeDebug = Platform.IsWindows ? ".pdb" : ".exe.mdb";
241
AssertOutputFiles (sol, "ConsoleProject", "Debug", new string[] {
242
"ConsoleProject.exe",
243
"ConsoleProject" + exeDebug,
248
string projectXml1 = Util.GetXmlFileInfoset (p.FileName.ParentDirectory.Combine ("ConsoleProject.csproj.saved"));
249
string projectXml2 = Util.GetXmlFileInfoset (p.FileName);
250
Assert.AreEqual (projectXml1, projectXml2);