Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/mcs
diff options
context:
space:
mode:
authorRodrigo B. de Oliveira <rbo@acm.org>2010-01-21 16:04:03 +0300
committerRodrigo B. de Oliveira <rbo@acm.org>2010-01-21 16:04:03 +0300
commitf1228133ba6303bce0b26681e0f23fd4027ec93e (patch)
tree8b8c63e880e4fedb8f08b53d4f568e4c351c24d3 /mcs
parent7b5e57861361bed09b594d6d6ecc15f8bc564e47 (diff)
NUnit tests for xbuild
svn path=/trunk/mcs/; revision=149965
Diffstat (limited to 'mcs')
-rw-r--r--mcs/tools/xbuild/ChangeLog7
-rw-r--r--mcs/tools/xbuild/Makefile3
-rw-r--r--mcs/tools/xbuild/Test/ChangeLog5
-rw-r--r--mcs/tools/xbuild/Test/xbuild.tests/ParametersTest.cs59
-rw-r--r--mcs/tools/xbuild/Test/xbuild.tests/xbuild.tests.csproj50
-rw-r--r--mcs/tools/xbuild/xbuild.sln89
-rw-r--r--mcs/tools/xbuild/xbuild_test.dll.sources1
7 files changed, 175 insertions, 39 deletions
diff --git a/mcs/tools/xbuild/ChangeLog b/mcs/tools/xbuild/ChangeLog
index ff8f4c1c98f..2ea8e1caed6 100644
--- a/mcs/tools/xbuild/ChangeLog
+++ b/mcs/tools/xbuild/ChangeLog
@@ -1,3 +1,10 @@
+2010-01-21 Rodrigo B. de Oliveira <rodrigo@unity3d.com>
+
+ * Makefile
+ * xbuild_test.dll.sources
+ * xbuild.sln
+ * Test/*: added NUnit tests (Test/xbuild.tests)
+
2009-12-22 Ankit Jain <jankit@novell.com>
Fix bug #566087.
diff --git a/mcs/tools/xbuild/Makefile b/mcs/tools/xbuild/Makefile
index 1672dd2550b..e9d89da3131 100644
--- a/mcs/tools/xbuild/Makefile
+++ b/mcs/tools/xbuild/Makefile
@@ -1,6 +1,7 @@
thisdir = tools/xbuild
SUBDIRS =
include ../../build/rules.make
+HAS_NUNIT_TEST = yes
LOCAL_MCS_FLAGS = -r:Microsoft.Build.Framework.dll -r:Microsoft.Build.Utilities.dll -r:Microsoft.Build.Engine.dll
PROGRAM = xbuild.exe
@@ -36,4 +37,6 @@ EXTRA_DISTFILES = \
xbuild/MSBuild/Microsoft.Build.Core.xsd \
xbuild/Microsoft.VisualBasic.targets \
xbuild/Microsoft.WebApplication.targets
+
+
diff --git a/mcs/tools/xbuild/Test/ChangeLog b/mcs/tools/xbuild/Test/ChangeLog
new file mode 100644
index 00000000000..6c3761c0d25
--- /dev/null
+++ b/mcs/tools/xbuild/Test/ChangeLog
@@ -0,0 +1,5 @@
+2010-01-21 Rodrigo B. de Oliveira <rodrigo@unity3d.com>
+
+ * xbuild.tests/ParametersTest.cs
+ * xbuild.tests/xbuild.tests.csproj:
+ NUnit tests for the Parameters class
diff --git a/mcs/tools/xbuild/Test/xbuild.tests/ParametersTest.cs b/mcs/tools/xbuild/Test/xbuild.tests/ParametersTest.cs
new file mode 100644
index 00000000000..a0bc236890d
--- /dev/null
+++ b/mcs/tools/xbuild/Test/xbuild.tests/ParametersTest.cs
@@ -0,0 +1,59 @@
+// (C) 2009 Rodrigo B. de Oliveira
+//
+// 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.
+
+#if NET_2_0
+
+using System;
+using NUnit.Framework;
+using Mono.XBuild.CommandLine;
+using System.IO;
+
+namespace xbuild.tests
+{
+ [TestFixture]
+ public class ParametersTest
+ {
+ /// <summary>
+ /// Tests TeamCity style xbuild integration.
+ /// </summary>
+ [Test]
+ public void TeamCityStyleResponseFile ()
+ {
+ var responseFile = Path.GetTempFileName ();
+ var contents =
+ "/p:idea_build_agent_port=\"9090\" " +
+ "/p:idea_build_server_build_id=\"13852\" " +
+ "/p:path_separator=\":\"";
+ File.WriteAllText (responseFile, contents);
+
+ var binPath = "bin";
+ var parameters = new Parameters (binPath);
+ parameters.ParseArguments (
+ new [] { string.Format ("@\"{0}\"", responseFile), "\"project.xml\""});
+
+ var properties = parameters.Properties;
+ Assert.AreEqual(3, properties.Count);
+ }
+ }
+}
+
+#endif
+
diff --git a/mcs/tools/xbuild/Test/xbuild.tests/xbuild.tests.csproj b/mcs/tools/xbuild/Test/xbuild.tests/xbuild.tests.csproj
new file mode 100644
index 00000000000..a196ddc11e1
--- /dev/null
+++ b/mcs/tools/xbuild/Test/xbuild.tests/xbuild.tests.csproj
@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>8.0.50727</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{929D9BCD-2280-4B6D-AD69-0FD089E344C2}</ProjectGuid>
+ <OutputType>Library</OutputType>
+ <RootNamespace>xbuild.tests</RootNamespace>
+ <AssemblyName>xbuild.tests</AssemblyName>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\Debug</OutputPath>
+ <DefineConstants>DEBUG</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <ConsolePause>false</ConsolePause>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>none</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\Release</OutputPath>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <ConsolePause>false</ConsolePause>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="System" />
+ <Reference Include="nunit.framework, Version=2.4.8.0, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\..\xbuild.csproj">
+ <Project>{89938F1A-C851-41D5-96D2-C329E00887B6}</Project>
+ <Name>xbuild</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
+ <ProjectExtensions>
+ <MonoDevelop>
+ <Properties InternalTargetFrameworkVersion="3.5" />
+ </MonoDevelop>
+ </ProjectExtensions>
+ <ItemGroup>
+ <Compile Include="ParametersTest.cs" />
+ </ItemGroup>
+</Project> \ No newline at end of file
diff --git a/mcs/tools/xbuild/xbuild.sln b/mcs/tools/xbuild/xbuild.sln
index 6f596626902..a0815a59650 100644
--- a/mcs/tools/xbuild/xbuild.sln
+++ b/mcs/tools/xbuild/xbuild.sln
@@ -1,39 +1,50 @@
-
-Microsoft Visual Studio Solution File, Format Version 9.00
-# Visual Studio 2005
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Build.Engine", "..\..\class\Microsoft.Build.Engine\Microsoft.Build.Engine.csproj", "{49CC9B64-E28A-4818-97F9-301E14B383B9}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "xbuild", "xbuild.csproj", "{89938F1A-C851-41D5-96D2-C329E00887B6}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Build.Engine.Test", "..\..\class\Microsoft.Build.Engine\Microsoft.Build.Engine.Test.csproj", "{A2F451CD-8701-434A-A562-EF1809E2DB7D}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Any CPU = Debug|Any CPU
- DebugMS|Any CPU = DebugMS|Any CPU
- Release|Any CPU = Release|Any CPU
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {49CC9B64-E28A-4818-97F9-301E14B383B9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {49CC9B64-E28A-4818-97F9-301E14B383B9}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {49CC9B64-E28A-4818-97F9-301E14B383B9}.DebugMS|Any CPU.ActiveCfg = DebugMS|Any CPU
- {49CC9B64-E28A-4818-97F9-301E14B383B9}.DebugMS|Any CPU.Build.0 = DebugMS|Any CPU
- {49CC9B64-E28A-4818-97F9-301E14B383B9}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {49CC9B64-E28A-4818-97F9-301E14B383B9}.Release|Any CPU.Build.0 = Release|Any CPU
- {89938F1A-C851-41D5-96D2-C329E00887B6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {89938F1A-C851-41D5-96D2-C329E00887B6}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {89938F1A-C851-41D5-96D2-C329E00887B6}.DebugMS|Any CPU.ActiveCfg = DebugMS|Any CPU
- {89938F1A-C851-41D5-96D2-C329E00887B6}.DebugMS|Any CPU.Build.0 = DebugMS|Any CPU
- {89938F1A-C851-41D5-96D2-C329E00887B6}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {89938F1A-C851-41D5-96D2-C329E00887B6}.Release|Any CPU.Build.0 = Release|Any CPU
- {A2F451CD-8701-434A-A562-EF1809E2DB7D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {A2F451CD-8701-434A-A562-EF1809E2DB7D}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {A2F451CD-8701-434A-A562-EF1809E2DB7D}.DebugMS|Any CPU.ActiveCfg = DebugMS|Any CPU
- {A2F451CD-8701-434A-A562-EF1809E2DB7D}.DebugMS|Any CPU.Build.0 = DebugMS|Any CPU
- {A2F451CD-8701-434A-A562-EF1809E2DB7D}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {A2F451CD-8701-434A-A562-EF1809E2DB7D}.Release|Any CPU.Build.0 = Release|Any CPU
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
-EndGlobal
+
+Microsoft Visual Studio Solution File, Format Version 9.00
+# Visual Studio 2005
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Build.Engine", "..\..\class\Microsoft.Build.Engine\Microsoft.Build.Engine.csproj", "{49CC9B64-E28A-4818-97F9-301E14B383B9}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "xbuild", "xbuild.csproj", "{89938F1A-C851-41D5-96D2-C329E00887B6}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Build.Engine.Test", "..\..\class\Microsoft.Build.Engine\Microsoft.Build.Engine.Test.csproj", "{A2F451CD-8701-434A-A562-EF1809E2DB7D}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "xbuild.tests", "Test\xbuild.tests\xbuild.tests.csproj", "{929D9BCD-2280-4B6D-AD69-0FD089E344C2}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ DebugMS|Any CPU = DebugMS|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {49CC9B64-E28A-4818-97F9-301E14B383B9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {49CC9B64-E28A-4818-97F9-301E14B383B9}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {49CC9B64-E28A-4818-97F9-301E14B383B9}.DebugMS|Any CPU.ActiveCfg = DebugMS|Any CPU
+ {49CC9B64-E28A-4818-97F9-301E14B383B9}.DebugMS|Any CPU.Build.0 = DebugMS|Any CPU
+ {49CC9B64-E28A-4818-97F9-301E14B383B9}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {49CC9B64-E28A-4818-97F9-301E14B383B9}.Release|Any CPU.Build.0 = Release|Any CPU
+ {89938F1A-C851-41D5-96D2-C329E00887B6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {89938F1A-C851-41D5-96D2-C329E00887B6}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {89938F1A-C851-41D5-96D2-C329E00887B6}.DebugMS|Any CPU.ActiveCfg = DebugMS|Any CPU
+ {89938F1A-C851-41D5-96D2-C329E00887B6}.DebugMS|Any CPU.Build.0 = DebugMS|Any CPU
+ {89938F1A-C851-41D5-96D2-C329E00887B6}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {89938F1A-C851-41D5-96D2-C329E00887B6}.Release|Any CPU.Build.0 = Release|Any CPU
+ {929D9BCD-2280-4B6D-AD69-0FD089E344C2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {929D9BCD-2280-4B6D-AD69-0FD089E344C2}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {929D9BCD-2280-4B6D-AD69-0FD089E344C2}.DebugMS|Any CPU.ActiveCfg = Debug|Any CPU
+ {929D9BCD-2280-4B6D-AD69-0FD089E344C2}.DebugMS|Any CPU.Build.0 = Debug|Any CPU
+ {929D9BCD-2280-4B6D-AD69-0FD089E344C2}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {929D9BCD-2280-4B6D-AD69-0FD089E344C2}.Release|Any CPU.Build.0 = Release|Any CPU
+ {A2F451CD-8701-434A-A562-EF1809E2DB7D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {A2F451CD-8701-434A-A562-EF1809E2DB7D}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {A2F451CD-8701-434A-A562-EF1809E2DB7D}.DebugMS|Any CPU.ActiveCfg = DebugMS|Any CPU
+ {A2F451CD-8701-434A-A562-EF1809E2DB7D}.DebugMS|Any CPU.Build.0 = DebugMS|Any CPU
+ {A2F451CD-8701-434A-A562-EF1809E2DB7D}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {A2F451CD-8701-434A-A562-EF1809E2DB7D}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(MonoDevelopProperties) = preSolution
+ StartupItem = ..\..\class\Microsoft.Build.Engine\Microsoft.Build.Engine.csproj
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/mcs/tools/xbuild/xbuild_test.dll.sources b/mcs/tools/xbuild/xbuild_test.dll.sources
new file mode 100644
index 00000000000..d91474f0038
--- /dev/null
+++ b/mcs/tools/xbuild/xbuild_test.dll.sources
@@ -0,0 +1 @@
+xbuild.tests/ParametersTest.cs