~ubuntu-branches/ubuntu/vivid/monodevelop/vivid-proposed

« back to all changes in this revision

Viewing changes to tests/UnitTests/MonoDevelop.Projects/LocalCopyTests.cs

  • Committer: Package Import Robot
  • Author(s): Jo Shields
  • Date: 2014-10-09 14:09:23 UTC
  • mfrom: (10.3.5)
  • Revision ID: package-import@ubuntu.com-20141009140923-s0d22u5f9kg8jvds
Tags: 5.5.0.227-1
* [b2c8331] Imported Upstream version 5.5.0.227 (Closes: #754316)
* [d210995] Delete obsolete patches
* [1b59ae1] Clear patch fizz, via quilt refresh
* [3dd147d] Fix error in configure.in which applies for tarball builds but 
  not git builds when running autoreconf
* [21c2a57] Remove Metacity references for good
* [3331661] Ensure NUnit 2.6.3 is installed
* [fd85c88] Build-depend on NuGet
* [a1ae116] Add WebKit to build dependencies, for Xwt moduleref resolution
* [9b4cf12] Since the GDB addin is integrated now, declare it in 
  debian/control
* [6231562] Correct NUnit links
* [3d2b693] Fix NuGet addin, by copying libs locally
* [74bf9a8] Don't symlink unused Mocks NUnit assembly
* [ade52b2] Ensure IKVM.Reflection is built with default (4.5) profile

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
using NUnit.Framework;
33
33
using UnitTests;
34
34
using MonoDevelop.Core;
 
35
using System.Linq;
 
36
using MonoDevelop.Core.ProgressMonitoring;
35
37
 
36
38
namespace MonoDevelop.Projects
37
39
{
40
42
        public class LocalCopyTests : TestBase
41
43
        {
42
44
                [Test]
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 ()
45
47
                {
46
48
                        string solFile = Util.GetSampleProject ("vs-local-copy", "VSLocalCopyTest.sln");
51
53
                        
52
54
                        AssertCleanBuild (sol, "Debug");
53
55
                        AssertCleanBuild (sol, "Release");
 
56
 
 
57
                        string dllDebug = Platform.IsWindows ? ".pdb" : ".dll.mdb";
 
58
                        string exeDebug = Platform.IsWindows ? ".pdb" : ".exe.mdb";
54
59
                        
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,
64
69
                                "TextFile1.txt",
 
70
                                "TextFile2.txt",
 
71
                                "app.config",
65
72
                                "folder/baz.txt",
66
73
                                "foo/bar.txt",
67
74
                                "quux.txt",
76
83
                                "ClassLibrary4.dll",
77
84
                                "VSLocalCopyTest.exe",
78
85
                                "TextFile1.txt",
 
86
                                "TextFile2.txt",
 
87
                                "app.config",
79
88
                                "folder/baz.txt",
80
89
                                "foo/bar.txt",
81
90
                                "quux.txt",
84
93
                        
85
94
                        AssertOutputFiles (sol, "ClassLibrary1", "Debug", new string[] {
86
95
                                "ClassLibrary1.dll",
87
 
                                "ClassLibrary1.dll.mdb",
 
96
                                "ClassLibrary1" + dllDebug,
88
97
                                "ClassLibrary2.dll",
89
 
                                "ClassLibrary2.dll.mdb",
 
98
                                "ClassLibrary2" + dllDebug,
90
99
                                "TextFile1.txt",
91
100
                                "TextFile2.txt",
92
101
                                "foo/bar.txt",
102
111
                        
103
112
                        AssertOutputFiles (sol, "ClassLibrary2", "Debug", new string[] {
104
113
                                "ClassLibrary2.dll",
105
 
                                "ClassLibrary2.dll.mdb",
 
114
                                "ClassLibrary2" + dllDebug,
106
115
                                "TextFile2.txt"
107
116
                        });
108
117
                        
113
122
                        
114
123
                        AssertOutputFiles (sol, "ClassLibrary3", "Debug", new string[] {
115
124
                                "ClassLibrary3.dll",
116
 
                                "ClassLibrary3.dll.mdb"
 
125
                                "ClassLibrary3" + dllDebug
117
126
                        });
118
127
                        
119
128
                        AssertOutputFiles (sol, "ClassLibrary3", "Release", new string[] {
122
131
                        
123
132
                        AssertOutputFiles (sol, "ClassLibrary4", "Debug", new string[] {
124
133
                                "ClassLibrary4.dll",
125
 
                                "ClassLibrary4.dll.mdb"
 
134
                                "ClassLibrary4" + dllDebug
126
135
                        });
127
136
                        
128
137
                        AssertOutputFiles (sol, "ClassLibrary4", "Release", new string[] {
131
140
                        
132
141
                        AssertOutputFiles (sol, "ClassLibrary5", "Debug", new string[] {
133
142
                                "ClassLibrary5.dll",
134
 
                                "ClassLibrary5.dll.mdb",
 
143
                                "ClassLibrary5" + dllDebug,
135
144
                        });
136
145
                        
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);
 
194
 
 
195
                        // Warning check disabled due to bug #15121
 
196
                        // Assert.AreEqual (0, cr.WarningCount); 
 
197
                }
 
198
 
 
199
                [Test]
 
200
                [Ignore ("Check for build warnings disabled due to a bug in xbuild (BXC 15121)")]
 
201
                public void CheckLocalCopyBuildWarnings ()
 
202
                {
 
203
                        // See commented assert in AssertCleanBuild
 
204
                }
 
205
 
 
206
                [Test]
 
207
                [Platform (Exclude = "Win")]
 
208
                public void LocalCopyDefault ()
 
209
                {
 
210
                        string solFile = Util.GetSampleProject ("local-copy-package", "ConsoleProject.sln");
 
211
 
 
212
                        WorkspaceItem item = Services.ProjectService.ReadWorkspaceItem (Util.GetMonitor (), solFile);
 
213
                        Solution sol = (Solution) item;
 
214
                        var p = (DotNetProject)sol.Items [0];
 
215
 
 
216
                        var ar = p.References.First (r => r.Reference.Contains ("gtk"));
 
217
                        Assert.AreEqual (false, ar.LocalCopy);
 
218
                        ar.LocalCopy = true;
 
219
                        Assert.AreEqual (true, ar.LocalCopy);
 
220
 
 
221
                        ar = p.References.First (r => r.Reference.Contains ("System.Data"));
 
222
                        Assert.AreEqual (false, ar.LocalCopy);
 
223
                        ar.LocalCopy = true;
 
224
                        Assert.AreEqual (true, ar.LocalCopy);
 
225
 
 
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);
 
230
 
 
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);
 
235
 
 
236
                        sol.Save (new NullProgressMonitor ());
 
237
                        sol.Build (new NullProgressMonitor (), "Debug");
 
238
 
 
239
                        string exeDebug = Platform.IsWindows ? ".pdb" : ".exe.mdb";
 
240
 
 
241
                        AssertOutputFiles (sol, "ConsoleProject", "Debug", new string[] {
 
242
                                "ConsoleProject.exe",
 
243
                                "ConsoleProject" + exeDebug,
 
244
                                "System.Data.dll",
 
245
                                "gtk-sharp.dll"
 
246
                        });
 
247
 
 
248
                        string projectXml1 = Util.GetXmlFileInfoset (p.FileName.ParentDirectory.Combine ("ConsoleProject.csproj.saved"));
 
249
                        string projectXml2 = Util.GetXmlFileInfoset (p.FileName);
 
250
                        Assert.AreEqual (projectXml1, projectXml2);
186
251
                }
187
252
        }
188
253
}