diff options
author | Miguel de Icaza <miguel@gnome.org> | 2005-09-19 00:28:04 +0400 |
---|---|---|
committer | Miguel de Icaza <miguel@gnome.org> | 2005-09-19 00:28:04 +0400 |
commit | b146bfdd363e74441de5ed8d1a805491cc30bb7c (patch) | |
tree | bdf0670e064b636de321e94582f1a4f8e551b59f /mcs/class/Microsoft.Build.Engine/Test | |
parent | dff6d2a9e9c59e1eed5b1deb94c93a1da12ff16c (diff) |
Move from xbuild into mcs
svn path=/trunk/mcs/; revision=50195
Diffstat (limited to 'mcs/class/Microsoft.Build.Engine/Test')
7 files changed, 321 insertions, 0 deletions
diff --git a/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/ChangeLog b/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/ChangeLog new file mode 100644 index 00000000000..2153c5047e4 --- /dev/null +++ b/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/ChangeLog @@ -0,0 +1,8 @@ +2005-09-03 Marek Sieradzki <marek.sieradzki@gmail.com> + + * ProjectTest.cs, EngineTest.cs: Added next simple tests. + +2005-08-31 Marek Sieradzki <marek.sieradzki@gmail.com> + + * InternalLoggerExceptionTest.cs, InvalidProjectFileExceptionTest.cs: + Added simple tests. diff --git a/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/EngineTest.cs b/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/EngineTest.cs new file mode 100644 index 00000000000..9ab95dfca5c --- /dev/null +++ b/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/EngineTest.cs @@ -0,0 +1,45 @@ +// +// EngineTest.cs: +// +// Author: +// Marek Sieradzki (marek.sieradzki@gmail.com) +// +// (C) 2005 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 Microsoft.Build.BuildEngine; +using NUnit.Framework; + +namespace MonoTests.Microsoft.Build.BuildEngine { + [TestFixture] + public class EngineTest { + [Test] + public void AssignmentTest () + { + IEngine engine; + string binPath = "binPath"; + + engine = new Engine (binPath); + + Assert.AreEqual (binPath, engine.BinPath, "BinPath"); + } + } +} diff --git a/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/InternalLoggerExceptionTest.cs b/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/InternalLoggerExceptionTest.cs new file mode 100644 index 00000000000..ab35ad581b5 --- /dev/null +++ b/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/InternalLoggerExceptionTest.cs @@ -0,0 +1,59 @@ +// +// InternalLoggerExceptionTest.cs: +// +// Author: +// Marek Sieradzki (marek.sieradzki@gmail.com) +// +// (C) 2005 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 Microsoft.Build.BuildEngine; +using NUnit.Framework; + +namespace MonoTests.Microsoft.Build.BuildEngine { + [TestFixture] + public class InternalLoggerExceptionTest { + [Test] + public void CtorMessageTest () + { + InternalLoggerException ile; + string message = "message"; + + ile = new InternalLoggerException (message); + + Assert.AreEqual (message, ile.Message, "Message"); + } + + [Test] + public void CtorMessageExceptionTest () + { + InternalLoggerException ile; + string message = "message"; + Exception e = new Exception ("Inner exception message."); + + ile = new InternalLoggerException (message, e); + + Assert.AreEqual (message, ile.Message, "Message"); + Assert.AreEqual (e, ile.InnerException, "InnerException"); + } + } +}
\ No newline at end of file diff --git a/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/InvalidProjectFileExceptionTest.cs b/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/InvalidProjectFileExceptionTest.cs new file mode 100644 index 00000000000..4f782fbc73d --- /dev/null +++ b/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/InvalidProjectFileExceptionTest.cs @@ -0,0 +1,107 @@ +// +// InvalidProjectFileExceptionTest.cs: +// +// Author: +// Marek Sieradzki (marek.sieradzki@gmail.com) +// +// (C) 2005 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.Xml; +using Microsoft.Build.BuildEngine; +using NUnit.Framework; + +namespace MonoTests.Microsoft.Build.BuildEngine { + [TestFixture] + public class InvalidProjectFileExceptionTest { + [Test] + public void CtorMessageTest () + { + InvalidProjectFileException ipfe; + string message = "message"; + + ipfe = new InvalidProjectFileException (message); + + Assert.AreEqual (message, ipfe.Message, "Message"); + } + + [Test] + public void CtorProjectFileTest () + { + InvalidProjectFileException ipfe; + string projectFile = "projectFile"; + int lineNumber = 1; + int columnNumber = 2; + int endLineNumber = 3; + int endColumnNumber = 4; + string message = "message"; + string errorSubcategory = "errorSubcategory"; + string errorCode = "CS0000"; + string helpKeyword = "helpKeyword"; + + ipfe = new InvalidProjectFileException (projectFile, lineNumber, columnNumber, endLineNumber, endColumnNumber, + message, errorSubcategory, errorCode, helpKeyword); + + Assert.AreEqual (projectFile, ipfe.ProjectFile, "ProjectFile"); + Assert.AreEqual (lineNumber, ipfe.LineNumber, "LineNumber"); + Assert.AreEqual (columnNumber, ipfe.ColumnNumber, "ColumnNumber"); + Assert.AreEqual (endLineNumber, ipfe.EndLineNumber, "EndLineNumber"); + Assert.AreEqual (endColumnNumber, ipfe.EndColumnNumber, "EndColumnNumber"); + Assert.AreEqual (message, ipfe.Message, "Message"); + Assert.AreEqual (errorSubcategory, ipfe.ErrorSubcategory, "ErrorSubcategory"); + Assert.AreEqual (errorCode, ipfe.ErrorCode, "ErrorCode"); + Assert.AreEqual (helpKeyword, ipfe.HelpKeyword, "HelpKeyword"); + } + + [Test] + public void CtorMessageExceptionTest () + { + InvalidProjectFileException ipfe; + string message = "message"; + Exception e = new Exception ("Exception message"); + + ipfe = new InvalidProjectFileException (message, e); + + Assert.AreEqual (message, ipfe.Message, "Message"); + Assert.AreEqual (e, ipfe.InnerException, "InnerException"); + } + + [Test] + public void CtorNode () + { + InvalidProjectFileException ipfe; + XmlDocument xd = new XmlDocument (); + XmlNode xn = xd.CreateElement ("Element"); + string message = "message"; + string errorSubcategory = "errorSubcategory"; + string errorCode = "CS0000"; + string helpKeyword = "helpKeyword"; + + ipfe = new InvalidProjectFileException (xn, message, errorSubcategory, errorCode, helpKeyword); + + Assert.AreEqual (message, ipfe.Message, "Message"); + Assert.AreEqual (errorSubcategory, ipfe.ErrorSubcategory, "ErrorSubcategory"); + Assert.AreEqual (errorCode, ipfe.ErrorCode, "ErrorCode"); + Assert.AreEqual (helpKeyword, ipfe.HelpKeyword, "HelpKeyword"); + } + } +}
\ No newline at end of file diff --git a/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/ProjectTest.cs b/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/ProjectTest.cs new file mode 100644 index 00000000000..c9c867603da --- /dev/null +++ b/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.BuildEngine/ProjectTest.cs @@ -0,0 +1,55 @@ +// +// ProjectTest.cs: +// +// Author: +// Marek Sieradzki (marek.sieradzki@gmail.com) +// +// (C) 2005 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.Xml; +using Microsoft.Build.BuildEngine; +using NUnit.Framework; + +namespace MonoTests.Microsoft.Build.BuildEngine { + [TestFixture] + public class ProjectTest { + [Test] + public void AssignmentTest () + { + IEngine engine; + IProject project; + string binPath = "binPath"; + XmlDocument xd; + string documentString = + "<Project></Project>"; + + engine = new Engine (binPath); + project = engine.CreateNewProject (); + xd = new XmlDocument (); + xd.LoadXml (documentString); + project.LoadFromXml (xd); + + Assert.AreEqual (String.Empty, project.FullFileName, "FullFileName"); + } + } +}
\ No newline at end of file diff --git a/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.Engine.Test.mdp b/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.Engine.Test.mdp new file mode 100644 index 00000000000..a932eb2a0a1 --- /dev/null +++ b/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.Engine.Test.mdp @@ -0,0 +1,31 @@ +<Project name="Microsoft.Build.Engine.Test" fileversion="2.0" language="C#" ctype="DotNetProject"> + <Configurations active="Debug"> + <Configuration name="Debug" ctype="DotNetProjectConfiguration"> + <Output directory="./bin/Debug" assembly="Microsoft.Build.Engine.Test" /> + <Build debugmode="True" target="Library" /> + <Execution runwithwarnings="True" consolepause="True" runtime="MsNet" /> + <CodeGeneration compiler="Csc" warninglevel="4" optimize="True" unsafecodeallowed="False" generateoverflowchecks="True" mainclass="" generatexmldocumentation="False" ctype="CSharpCompilerParameters" /> + </Configuration> + <Configuration name="Release" ctype="DotNetProjectConfiguration"> + <Output directory="./bin/Release" assembly="Microsoft.Build.Engine.Test" /> + <Build debugmode="False" target="Library" /> + <Execution runwithwarnings="True" consolepause="True" runtime="MsNet" /> + <CodeGeneration compiler="Csc" warninglevel="4" optimize="True" unsafecodeallowed="False" generateoverflowchecks="True" mainclass="" generatexmldocumentation="False" ctype="CSharpCompilerParameters" /> + </Configuration> + </Configurations> + <DeploymentInformation strategy="File"> + <excludeFiles /> + </DeploymentInformation> + <Contents> + <File name="./Microsoft.Build.BuildEngine/InternalLoggerExceptionTest.cs" subtype="Code" buildaction="Compile" /> + <File name="./Microsoft.Build.BuildEngine/InvalidProjectFileExceptionTest.cs" subtype="Code" buildaction="Compile" /> + <File name="./Microsoft.Build.BuildEngine/EngineTest.cs" subtype="Code" buildaction="Compile" /> + <File name="./Microsoft.Build.BuildEngine/ProjectTest.cs" subtype="Code" buildaction="Compile" /> + </Contents> + <References> + <ProjectReference type="Gac" localcopy="True" refto="System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> + <ProjectReference type="Gac" localcopy="True" refto="System.Xml, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> + <ProjectReference type="Gac" localcopy="True" refto="nunit.framework, Version=2.2.0.0, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77" /> + <ProjectReference type="Project" localcopy="True" refto="Microsoft.Build.Engine" /> + </References> +</Project>
\ No newline at end of file diff --git a/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.Engine.Test.mds b/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.Engine.Test.mds new file mode 100644 index 00000000000..c8e69ea774c --- /dev/null +++ b/mcs/class/Microsoft.Build.Engine/Test/Microsoft.Build.Engine.Test.mds @@ -0,0 +1,16 @@ +<Combine name="Microsoft.Build.Engine.Test" fileversion="2.0"> + <Configurations active="Debug"> + <Configuration name="Debug" ctype="CombineConfiguration"> + <Entry configuration="Debug" build="True" name="Microsoft.Build.Engine.Test" /> + </Configuration> + <Configuration name="Release" ctype="CombineConfiguration"> + <Entry configuration="Debug" build="True" name="Microsoft.Build.Engine.Test" /> + </Configuration> + </Configurations> + <StartMode startupentry="Microsoft.Build.Engine.Test" single="True"> + <Execute type="None" entry="Microsoft.Build.Engine.Test" /> + </StartMode> + <Entries> + <Entry filename="./Microsoft.Build.Engine.Test.mdp" /> + </Entries> +</Combine>
\ No newline at end of file |