added "test.integration.data" build flag to run integration tests

This commit is contained in:
eeichinger
2009-08-02 23:25:30 +00:00
parent 442d943ebe
commit 7db5ac4a84
3 changed files with 62 additions and 32 deletions

View File

@@ -19,10 +19,17 @@ Main build targets:
Build properties that may be set:
=================================
"project.build.sign":
values: bool: true|false
signs all assemblies. Requires the key file $/Spring.Net.snk to be in place
"package.version":
values: string: a 3-part number xx.xx.xx
set the package version
"test.integration.data":
values: bool: true|false
set this to true to run integration tests
Additional Remarks:
===================
@@ -32,8 +39,21 @@ Additional Remarks:
*) Building Spring.Testing.Microsoft
if you want to build Spring.Testing.Microsoft (MSTest Support), you need to have VS MSTest support installed (mstest.exe)
Examples:
=========
Running Integration Tests:
==========================
*) Database Integration Tests
- you need to have an MSSQL 2005 Server instance installed and configured an alias "SPRINGQA" for this instance
- create a login "springqa" with password "springqa" and assign the 'db_sysadmin' role
on the commandline enable the "test.integration.data" flag, e.g.:
nant test -f:spring.build -D:test.integration.data=true
Commandline Examples:
=====================
*) to build the distribution package, copy the key file into $/Spring.Net.snk and execute
nant clean package -f:spring.build -D:project.build.sign=true -D:package.version=1.3.0
@@ -427,7 +447,7 @@ Examples:
<nant buildfile="test/Spring/Spring.Data.NHibernate30.Tests/Spring.Data.NHibernate30.Tests.build" target="test"
if="${build-data and nant.settings.currentframework == 'net-3.5'}"/>
<nant buildfile="test/Spring/Spring.Data.NHibernate30.Integration.Tests/Spring.Data.NHibernate30.Integration.Tests.build" target="test"
if="${build-data and nant.settings.currentframework == 'net-3.5' and not net-3.0}"/>
if="${build-data and nant.settings.currentframework == 'net-3.5'}"/>
<nant buildfile="test/Spring/Spring.Services.Tests/Spring.Services.Tests.build" target="test" if="${build-services and not net-3.5}"/>
<nant buildfile="test/Spring/Spring.Web.Tests/Spring.Web.Tests.build" target="test" if="${build-web and not net-3.0}"/>
<nant buildfile="test/Spring/Spring.Testing.NUnit.Tests/Spring.Testing.NUnit.Tests.build" target="test" if="${build-testing-nunit and not net-3.0}"/>
@@ -1463,6 +1483,7 @@ Examples:
</target>
<target name="set-build-namespaces-all">
<property name="build.allnamespaces" value="true"/>
<property name="test.integration.data" value="false" />
<property name="build-aop" value="true" />
<property name="build-data" value="true" />
<property name="build-services" value="true" />
@@ -1499,6 +1520,7 @@ Examples:
</fileset>
</target>
<target name="set-build-namespaces-release">
<property name="test.integration.data" value="false" />
<property name="build-aop" value="true"/>
<property name="build-data" value="true"/>
<property name="build-services" value="true"/>

View File

@@ -1,5 +1,8 @@
<?xml version="1.0" ?>
<project name="Spring.Data.NHibernate20.Integration.Tests" default="test" xmlns="http://nant.sf.net/schemas/nant.xsd">
<include buildfile="${spring.basedir}/common-project.include" />
<!--
Required properties:
* current.bin.dir - (path) root level to build to
@@ -8,6 +11,14 @@
-->
<target name="build">
<!-- copy nh libs -->
<echo message="NH Libs: ${nh20.lib.dir}" />
<copy todir="${current.bin.dir}" overwrite="true">
<fileset basedir="${nh20.lib.dir}">
<include name="**/*.dll" />
</fileset>
</copy>
<!-- build Spring.Data.NHibernate20.Integration.Tests -->
<csc target="library" define="${current.build.defines.csc},NH_2_0"
warnaserror="true"
@@ -18,28 +29,28 @@
<warning number="${nowarn.numbers.test}" />
</nowarn>
<sources failonempty="true">
<include name="**/*.cs" />
<include name="../CommonAssemblyInfo.cs" />
<include name="../Spring.Data.NHibernate.Integration.Tests/**/*.cs" />
<include name="**/*.cs" />
<exclude name="../Spring.Data.NHibernate.Tests/Data/NHibernate/SessionFactoryUtilsTests.cs" />
<exclude name="AssemblyInfo.cs" />
</sources>
<references basedir="${current.bin.dir}">
<lib>
<include name="${nh20.lib.dir}"/>
</lib>
<include name="System.Data.dll" />
<include name="System.EnterpriseServices.dll" />
<include name="log4net.dll" />
<include name="NHibernate.dll" />
<include name="*.dll" />
<exclude name="${project::get-name()}.dll" />
<exclude name="Spring.Data.NHibernate.Tests.dll" />
<exclude name="Spring.Data.NHibernate.dll" />
<exclude name="Spring.Data.NHibernate12.dll" />
<exclude name="Spring.Data.NHibernate21.dll" />
<exclude name="CloverRuntime.dll" />
<include name="System.Data.dll" />
<include name="System.EnterpriseServices.dll" />
<include name="*.dll" />
<include name="Spring.Data.NHibernate20.dll" />
<exclude name="Spring.Data.NHibernate.dll" />
<exclude name="Spring.Data.NHibernate12*.dll" />
<exclude name="Spring.Data.NHibernate21*.dll" />
<exclude name="Spring.Data.NHibernate*.Tests.dll" />
</references>
<resources prefix="Spring" dynamicprefix="true" failonempty="true">
<include name="**/*.xml" />
</resources>
<resources prefix="Spring" dynamicprefix="true" failonempty="true">
<include name="**/*.xml" />
<include name="**/*.sql" />
</resources>
<resources prefix="Spring" dynamicprefix="true" basedir="../Spring.Data.NHibernate.Integration.Tests" failonempty="true">
<include name="**/*.sql" />
</resources>
</csc>
<copy file="${project::get-base-directory()}/${project::get-name()}.dll.config"
@@ -47,13 +58,6 @@
</target>
<target name="test" depends="build">
<!-- skipping running of tests for now
<nunit2outproc>
<formatter type="Plain" />
<formatter type="Xml" usefile="true" extension=".xml"
outputdir="${current.bin.dir}/results" />
<test assemblyname="${current.bin.dir}/${project::get-name()}.dll" />
</nunit2outproc>
-->
<!-- call target="common.run-tests" if="${test.integration.data}" / -->
</target>
</project>

View File

@@ -29,8 +29,8 @@
<warning number="${nowarn.numbers.test}" />
</nowarn>
<sources failonempty="true">
<include name="../Spring.Data.NHibernate.Integration.Tests/**/*.cs" />
<include name="**/*.cs" />
<include name="../CommonAssemblyInfo.cs" />
</sources>
<references basedir="${current.bin.dir}">
<include name="System.Data.dll" />
@@ -44,6 +44,10 @@
</references>
<resources prefix="Spring" dynamicprefix="true" failonempty="true">
<include name="**/*.xml" />
<include name="**/*.sql" />
</resources>
<resources prefix="Spring" dynamicprefix="true" basedir="../Spring.Data.NHibernate.Integration.Tests" failonempty="true">
<include name="**/*.sql" />
</resources>
</csc>
@@ -54,7 +58,7 @@
<target name="test" depends="build">
<!-- property name="test.assemblyname" value="${project::get-name()}" / -->
<call target="common.run-tests" />
<call target="common.run-tests" if="${test.integration.data}" />
</target>
</project>