Skip to content

Commit d749b41

Browse files
ngbrownhazzik
authored andcommitted
NH-3900 - Update NAnt build configuration to use NUnit 3 console runner.
1 parent 0c7fbea commit d749b41

File tree

3 files changed

+12
-27
lines changed

3 files changed

+12
-27
lines changed

build-common/common-project.xml

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -118,22 +118,14 @@
118118
description="Run NUnit tests">
119119
<call target="common.find-nunit" unless="${property::exists('nunit.found')}" />
120120
<property name="common.run-tests.failonerror" value="${not property::exists(test.file + '.IgnoreFail')}"/>
121+
<property name="common.run-tests.x86" value="--x86" unless="${property::exists('nunit-x64')}" />
122+
<property name="common.run-tests.x86" value="" if="${property::exists('nunit-x64')}" />
123+
<property name="common.run-tests.teamcity" value="--teamcity" if="${property::exists('config.teamcity')}" />
124+
<property name="common.run-tests.teamcity" value="" unless="${property::exists('common.run-tests.teamcity')}" />
121125
<exec program="${nunit-console}" failonerror="${common.run-tests.failonerror}">
122-
<arg line="${bin.dir}/${test.file}.dll /xml:${testresults.dir}/${test.file}.dll-results.xml /framework:${framework::get-target-framework()}" />
126+
<arg line="${bin.dir}/${test.file}.dll --result=${testresults.dir}/${test.file}.dll-results.xml;format=nunit2 --framework=${framework::get-target-framework()} ${common.run-tests.teamcity} ${common.run-tests.x86}" />
123127
</exec>
124128

125-
<!--<nunit2>
126-
<formatter
127-
type="Xml"
128-
usefile="true"
129-
extension=".xml"
130-
outputdir="${bin.dir}"
131-
/>
132-
<test
133-
assemblyname="${bin.dir}/${test.file}.dll"
134-
appconfig="${bin.dir}/${test.file}.dll.config" />
135-
</nunit2>-->
136-
137129
</target>
138130

139131
<target name="common.run-database-tests"

build-common/common.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@
261261
</target>
262262

263263
<target name="common.find-nunit">
264-
<property name="nunit-console" value="${tools.dir}/NUnit/nunit-console-x86.exe" />
264+
<property name="nunit-console" value="${tools.dir}/NUnit.ConsoleRunner.3.6.0/tools/nunit3-console.exe" />
265265
</target>
266266
<target name="common.find-ndoc">
267267
<property name="ndoc-console" value="${tools.dir}/ndoc/NDocConsole.exe" />

teamcity.build

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,7 @@
1212

1313
<property name="build.number" value="${CCNetLabel}" if="${property::exists('CCNetLabel')}" />
1414

15-
<target name="clean-configure-test" depends="cleanall init copy-nunitaddin copy-teamcity-configuration binaries test verify-test-results binaries-zip" />
16-
17-
<target name="copy-nunitaddin" depends="init">
18-
<if test="${property::exists('teamcity.dotnet.nunitaddin')}">
19-
<copy todir="${tools.dir}/NUnit/addins">
20-
<fileset>
21-
<include name="${teamcity.dotnet.nunitaddin}-2.6.1.*" />
22-
</fileset>
23-
</copy>
24-
</if>
25-
</target>
15+
<target name="clean-configure-test" depends="cleanall init copy-teamcity-configuration binaries test verify-test-results binaries-zip" />
2616

2717
<target name="copy-teamcity-configuration">
2818
<copy file="build-common/teamcity-hibernate.cfg.xml" tofile="${bin.dir}/hibernate.cfg.xml" />
@@ -81,6 +71,7 @@
8171
</target>
8272

8373
<target name="setup-teamcity-sqlServerCe64">
74+
<property name="nunit-x64" value="true" />
8475
<property name="nhibernate.connection.driver_class" value="NHibernate.Driver.SqlServerCeDriver" />
8576
<property name="nhibernate.dialect" value="NHibernate.Dialect.MsSqlCe40Dialect" />
8677
<property name="nhibernate.connection.connection_string" value="Data Source=NHibernate.sdf" />
@@ -109,8 +100,7 @@
109100
</target>
110101

111102
<target name="setup-teamcity-firebird64">
112-
<property name="nunit-console" value="${tools.dir}/NUnit/nunit-console.exe" />
113-
<property name="nunit.found" value="true" />
103+
<property name="nunit-x64" value="true" />
114104
<property name="nhibernate.connection.driver_class" value="NHibernate.Driver.FirebirdClientDriver" />
115105
<property name="nhibernate.dialect" value="NHibernate.Dialect.FirebirdDialect" />
116106
<property name="nhibernate.connection.connection_string" value="Database=NHibernate.fdb;ServerType=1;UserID=SYSDBA" />
@@ -136,6 +126,7 @@
136126
</target>
137127

138128
<target name="setup-teamcity-sqlite64">
129+
<property name="nunit-x64" value="true" />
139130
<property name="nhibernate.connection.driver_class" value="NHibernate.Driver.SQLite20Driver" />
140131
<property name="nhibernate.dialect" value="NHibernate.Dialect.SQLiteDialect" />
141132
<property name="nhibernate.connection.connection_string" value="Data Source=NHibernate.db" />
@@ -179,6 +170,7 @@
179170
</target>
180171

181172
<target name="setup-teamcity-oracle64">
173+
<property name="nunit-x64" value="true" />
182174
<property name="nhibernate.connection.driver_class" value="NHibernate.Driver.OracleDataClientDriver" />
183175
<property name="nhibernate.dialect" value="NHibernate.Dialect.Oracle10gDialect" />
184176
<property name="nhibernate.connection.connection_string" value="User ID=nhibernate;Password=nhibernate;Data Source=(DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = XE)))" />
@@ -210,6 +202,7 @@
210202
</target>
211203

212204
<target name="setup-teamcity-oracle-managed64">
205+
<property name="nunit-x64" value="true" />
213206
<property name="nhibernate.connection.driver_class" value="NHibernate.Driver.OracleManagedDataClientDriver" />
214207
<property name="nhibernate.dialect" value="NHibernate.Dialect.Oracle10gDialect" />
215208
<property name="nhibernate.connection.connection_string" value="User ID=nhibernate;Password=nhibernate;Data Source=(DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = XE)))" />

0 commit comments

Comments
 (0)