forked from sidecut/log4net
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tests.build
100 lines (83 loc) · 4.65 KB
/
tests.build
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
<?xml version="1.0" ?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to you under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<project name="log4net-tests" default="runtests" xmlns="http://tempuri.org/nant-vs.xsd">
<property name="log4net.basedir" value="." readonly="false" />
<property name="project.build.config" value="debug" readonly="false" />
<property name="project.build.package" value="false" readonly="false" />
<property name="current.assembly" value="log4net.Tests"/>
<!-- Include log4net helpers -->
<include buildfile="${log4net.basedir}/src/buildsupport/log4net.include" />
<include buildfile="${log4net.basedir}/src/buildsupport/multi-framework-compilation.include" />
<!-- Targets that should always be executed -->
<call target="set-build-configuration" />
<call target="set-framework-configuration" />
<!-- Target for compiling the tests on all frameworks -->
<target name="compile-all"
description="Builds all log4net tests"
depends="-compile-all"/>
<target name="-compile-for-one-framework" depends="check-log4net-basedir, clean-current-bin-dir, check-log4net-assembly">
<foreach item="Folder" property="dir">
<in>
<items>
<!-- copy log4net build output -->
<include name="${log4net.main.output.dir}"/>
<!-- copy referenced libraries to build output -->
<include name="${log4net.basedir}/lib/test"/>
<include name="${log4net.basedir}/lib/test/${framework::get-family(framework::get-target-framework())}/${framework::get-version(framework::get-target-framework())}"/>
</items>
</in>
<do>
<copy todir="${current.bin.dir}">
<fileset basedir="${dir}">
<include name="*.dll" />
</fileset>
</copy>
</do>
</foreach>
<property name="current.sources" value="log4net.Tests"/>
<property name="current.keyfile" value="log4net.snk"/>
<property name="current.bin.subdir" value=""/>
<property name="warnaserror" value="false"/>
<property name="with.test.assemblies" value="true"/>
<property name="with.log4net" value="true"/>
<property name="with.assemblyversioninfo" value="true"/>
<call target="parameterized-compilation" />
</target>
<!-- Currently we cannot run the tests in the environment of the target framework only in the host framework -->
<target name="runtests" description="Runs log4net tests">
<!--
Because the <nunit2> task does not support multiple frameworks through the
nant.settings.currentframework setting we cannot just run the tests for each framework.
Only the tests for the current framework are run.
-->
<if test="${target::exists('runtests-' + nant.settings.currentframework)}">
<echo message="Running tests for ${framework::get-target-framework()}" />
<call target="runtests-${nant.settings.currentframework}" />
</if>
</target>
<target name="runtests-net-2.0" description="Runs log4net tests on .NET Framework 2.0 version" depends="-compile-net-2.0,-runtests"/>
<target name="runtests-mono-2.0" description="Runs log4net tests on Mono Framework 2.0 version" depends="-compile-mono-2.0,-runtests"/>
<target name="runtests-net-3.5" description="Runs log4net tests on .NET Framework 3.5 version" depends="-compile-net-3.5,-runtests"/>
<target name="runtests-net-3.5-cp" description="Runs log4net tests on .NET Framework 3.5 Client Profile version" depends="-compile-net-3.5-cp,-runtests"/>
<target name="runtests-net-4.0" description="Runs log4net tests on .NET Framework 4.0 version" depends="-compile-net-4.0,-runtests"/>
<target name="runtests-net-4.0-cp" description="Runs log4net tests on .NET Framework 4.0 Client Profile version" depends="-compile-net-4.0-cp,-runtests"/>
<target name="-runtests">
<nunit2>
<formatter type="Plain" />
<test assemblyname="${current.bin.dir}/log4net.Tests.dll" />
</nunit2>
</target>
</project>