Skip to content

Commit f18e6a1

Browse files
authored
Merge 74bbecb into 00a9f52
2 parents 00a9f52 + 74bbecb commit f18e6a1

File tree

11 files changed

+135
-37
lines changed

11 files changed

+135
-37
lines changed

README.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,11 @@ should still support .NET Framework 3.5 and Mono.
125125

126126
The `core` library provides all functionality needed to test XML
127127
output and hasn't got any dependencies. It uses NUnit 3.x for its own
128-
tests. The core library is complemented by two libaries of NUnit
129-
constraints targeting NUnit 2.x and 3.x respectively.
128+
tests. The core library is complemented by libaries of NUnit
129+
constraints targeting NUnit 2.x, 3.x and 4.x respectively.
130+
131+
Building NUnit 4.x support requires .NET 6 or .NET Framework 4.6.2 or
132+
newer (the minimal targets supported by NUnit 4.x).
130133

131134
## Checking out XMLUnit.NET
132135

@@ -225,6 +228,14 @@ assemblies. In order to run the tests use
225228
> dotnet test src/tests/net-placeholders/XMLUnit.Placeholders.Tests.csproj
226229
```
227230

231+
NUnit4 support is not part of the default solution so the solution can
232+
be built for .NET prior to .NET 6. In order to build and test it, use
233+
234+
```sh
235+
> dotnet build src/main/net-constraints-nunit4/XMLUnit.NUnit4.Constraints.csproj
236+
> dotnet test src/tests/net-constraints-nunit4/XMLUnit.NUnit4.Constraints.Test.csproj
237+
```
238+
228239
You may need to specify
229240
[`--roll-forward`](https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet#rollforward)
230241
or

XMLUnit.NET.sln

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "XMLUnit.Placeholders.Tests"
2929
EndProject
3030
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{AEB02F96-2A15-4740-84CB-6F7E36F85062}"
3131
EndProject
32-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XMLUnit.NUnit4.Constraints.Test", "src\tests\net-constraints-nunit4\XMLUnit.NUnit4.Constraints.Test.csproj", "{A4710B49-EB5D-4E6E-A515-AE73AC9773CF}"
33-
EndProject
34-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XMLUnit.NUnit4.Constraints", "src\main\net-constraints-nunit4\XMLUnit.NUnit4.Constraints.csproj", "{9E6EA8DE-F1E9-4DC0-8E9C-EDCAF0E44FA7}"
35-
EndProject
3632
Global
3733
GlobalSection(SolutionConfigurationPlatforms) = preSolution
3834
Debug|Any CPU = Debug|Any CPU
@@ -63,14 +59,6 @@ Global
6359
{97290BD0-CCF0-48CF-95F2-B1A9F6C3EE9F}.Debug|Any CPU.Build.0 = Debug|Any CPU
6460
{97290BD0-CCF0-48CF-95F2-B1A9F6C3EE9F}.Release|Any CPU.ActiveCfg = Release|Any CPU
6561
{97290BD0-CCF0-48CF-95F2-B1A9F6C3EE9F}.Release|Any CPU.Build.0 = Release|Any CPU
66-
{A4710B49-EB5D-4E6E-A515-AE73AC9773CF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
67-
{A4710B49-EB5D-4E6E-A515-AE73AC9773CF}.Debug|Any CPU.Build.0 = Debug|Any CPU
68-
{A4710B49-EB5D-4E6E-A515-AE73AC9773CF}.Release|Any CPU.ActiveCfg = Release|Any CPU
69-
{A4710B49-EB5D-4E6E-A515-AE73AC9773CF}.Release|Any CPU.Build.0 = Release|Any CPU
70-
{9E6EA8DE-F1E9-4DC0-8E9C-EDCAF0E44FA7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
71-
{9E6EA8DE-F1E9-4DC0-8E9C-EDCAF0E44FA7}.Debug|Any CPU.Build.0 = Debug|Any CPU
72-
{9E6EA8DE-F1E9-4DC0-8E9C-EDCAF0E44FA7}.Release|Any CPU.ActiveCfg = Release|Any CPU
73-
{9E6EA8DE-F1E9-4DC0-8E9C-EDCAF0E44FA7}.Release|Any CPU.Build.0 = Release|Any CPU
7462
EndGlobalSection
7563
GlobalSection(SolutionProperties) = preSolution
7664
HideSolutionNode = FALSE
@@ -79,7 +67,6 @@ Global
7967
{9BF85579-75BF-4D44-953A-46FAFCD814C0} = {AEB02F96-2A15-4740-84CB-6F7E36F85062}
8068
{33760FFE-9F43-46BE-8F64-ED34AE6B798C} = {AEB02F96-2A15-4740-84CB-6F7E36F85062}
8169
{97290BD0-CCF0-48CF-95F2-B1A9F6C3EE9F} = {AEB02F96-2A15-4740-84CB-6F7E36F85062}
82-
{A4710B49-EB5D-4E6E-A515-AE73AC9773CF} = {AEB02F96-2A15-4740-84CB-6F7E36F85062}
8370
EndGlobalSection
8471
GlobalSection(ExtensibilityGlobals) = postSolution
8572
SolutionGuid = {62909FEB-64D4-42B9-845A-E7E1AAD5F331}

appveyor.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,29 @@ for:
2929
- matrix:
3030
only:
3131
- image: Visual Studio 2017
32+
before_build:
33+
- dotnet restore XMLUnit.NET.sln
34+
build:
35+
project: XMLUnit.NET.sln
36+
test_script:
37+
- dotnet test src/tests/net-core/XMLUnit.Core.Tests.csproj
38+
- dotnet test src/tests/net-constraints-nunit3/XMLUnit.NUnit3.Constraints.Test.csproj
39+
- dotnet test src/tests/net-placeholders/XMLUnit.Placeholders.Tests.csproj
40+
41+
- matrix:
42+
only:
3243
- image: Visual Studio 2022
3344
- image: Ubuntu2204
3445
before_build:
3546
- dotnet restore XMLUnit.NET.sln
36-
- dotnet --version
3747
build:
3848
project: XMLUnit.NET.sln
3949
test_script:
4050
- dotnet test src/tests/net-core/XMLUnit.Core.Tests.csproj
4151
- dotnet test src/tests/net-constraints-nunit3/XMLUnit.NUnit3.Constraints.Test.csproj
42-
- dotnet test src/tests/net-constraints-nunit4/XMLUnit.NUnit4.Constraints.Test.csproj
4352
- dotnet test src/tests/net-placeholders/XMLUnit.Placeholders.Tests.csproj
53+
- dotnet build src/main/net-constraints-nunit4/XMLUnit.NUnit4.Constraints.csproj
54+
- dotnet test src/tests/net-constraints-nunit4/XMLUnit.NUnit4.Constraints.Test.csproj
4455

4556
install:
4657
- cmd: git submodule update --init
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<Namespace Name="Org.XmlUnit.Constraints">
2+
<Docs>
3+
<summary>NUnit 4.x Constraints on top of XMLUnit's core.</summary>
4+
<remarks>NUnit 4.x Constraints on top of XMLUnit's core.</remarks>
5+
</Docs>
6+
</Namespace>

src/doc/monodoc/core/index.xml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@
1515
contains <format type="text/html"><a
1616
href="http://nunit.org/">NUnit 3.x</a></format>
1717
constraints on top of <c>XMLUnit.Core</c>.</term></item>
18+
<item><term><c>XMLUnit.NUnit4.Constraints</c>
19+
contains <format type="text/html"><a
20+
href="http://nunit.org/">NUnit 4.x</a></format>
21+
constraints on top of <c>XMLUnit.Core</c>.</term></item>
1822
</list>
1923

2024
<para>While XMLUnit is focussed on testing, parts of it may be useful
@@ -58,5 +62,5 @@
5862
under <format type="text/html"><a href="https://github.com/xmlunit/xmlunit.net/blob/main/LICENSE">the
5963
Apache License, Version 2.0</a></format>.</para></Remarks>
6064
<Copyright></Copyright>
61-
<Title>XMLUnit.NET 2.10.1</Title>
65+
<Title>XMLUnit.NET 2.11.0</Title>
6266
</Overview>

src/doc/monodoc/run-monodoc.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ cp -r "$MY_DIR/core" "$MY_DIR/placeholders" "$MY_DIR/constraints-nunit2" "$MY_DI
1515
monodocer -pretty -importslashdoc:"$DEBUG_DIR/xmlunit-core.xml"\
1616
-assembly:"$DEBUG_DIR/xmlunit-core.dll"\
1717
-path:"$OUT_DIR/core"
18+
monodocer -pretty -importslashdoc:"$DEBUG_DIR/xmlunit-nunit4-constraints.xml"\
19+
-assembly:"$DEBUG_DIR/xmlunit-nunit4-constraints.dll"\
20+
-path:"$OUT_DIR/constraints-nunit4"
1821
monodocer -pretty -importslashdoc:"$DEBUG_DIR/xmlunit-nunit3-constraints.xml"\
1922
-assembly:"$DEBUG_DIR/xmlunit-nunit3-constraints.dll"\
2023
-path:"$OUT_DIR/constraints-nunit3"
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
This file is licensed to You under the Apache License, Version 2.0
4+
(the "License"); you may not use this file except in compliance with
5+
the License. You may obtain a copy of the License at
6+
7+
http://www.apache.org/licenses/LICENSE-2.0
8+
9+
Unless required by applicable law or agreed to in writing, software
10+
distributed under the License is distributed on an "AS IS" BASIS,
11+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
See the License for the specific language governing permissions and
13+
limitations under the License.
14+
-->
15+
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
16+
<PropertyGroup>
17+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
18+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
19+
<ProjectGuid>{B0EA2DD8-D0BC-4B55-B17A-E3EE17D6C718}</ProjectGuid>
20+
<OutputType>Library</OutputType>
21+
<NoStandardLibraries>false</NoStandardLibraries>
22+
<AssemblyName>xmlunit-nunit4-constraints</AssemblyName>
23+
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
24+
<FileAlignment>512</FileAlignment>
25+
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\..\..\</SolutionDir>
26+
<RestorePackages>true</RestorePackages>
27+
</PropertyGroup>
28+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
29+
<DebugSymbols>true</DebugSymbols>
30+
<DebugType>full</DebugType>
31+
<Optimize>false</Optimize>
32+
<OutputPath>..\..\..\..\build\NetFramework\bin\Debug</OutputPath>
33+
<DefineConstants>DEBUG;TRACE</DefineConstants>
34+
<ErrorReport>prompt</ErrorReport>
35+
<WarningLevel>4</WarningLevel>
36+
<DocumentationFile>..\..\..\..\build\NetFramework\bin\Debug\xmlunit-nunit4-constraints.xml</DocumentationFile>
37+
</PropertyGroup>
38+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
39+
<DebugType>pdbonly</DebugType>
40+
<Optimize>true</Optimize>
41+
<OutputPath>..\..\..\..\build\NetFramework\bin\Release</OutputPath>
42+
<DefineConstants>TRACE</DefineConstants>
43+
<ErrorReport>prompt</ErrorReport>
44+
<WarningLevel>4</WarningLevel>
45+
<DocumentationFile>..\..\..\..\build\NetFramework\bin\Release\xmlunit-nunit4-constraints.xml</DocumentationFile>
46+
</PropertyGroup>
47+
<PropertyGroup>
48+
<SignAssembly>true</SignAssembly>
49+
</PropertyGroup>
50+
<PropertyGroup>
51+
<AssemblyOriginatorKeyFile>..\..\..\..\xmlunit.snk</AssemblyOriginatorKeyFile>
52+
</PropertyGroup>
53+
<PropertyGroup>
54+
<RootNamespace>Org.XmlUnit.Constraints</RootNamespace>
55+
</PropertyGroup>
56+
<ItemGroup>
57+
<Reference Include="nunit.framework, Version=4.3.2.0, Culture=neutral, PublicKeyToken=2638cd05610744eb">
58+
<HintPath>..\..\..\..\packages\NUnit.4.3.2\lib\nunit.framework.dll</HintPath>
59+
<Private>True</Private>
60+
</Reference>
61+
<Reference Include="System" />
62+
<Reference Include="System.Core" />
63+
<Reference Include="System.Xml" />
64+
<Reference Include="System.Xml.Linq" />
65+
</ItemGroup>
66+
<ItemGroup>
67+
<ProjectReference Include="..\..\net-core\NetFramework\XMLUnit.Core.NetFramework.csproj">
68+
<Project>{97960a9c-7e2b-4548-90bd-31105c54e129}</Project>
69+
<Name>XMLUnit.Core</Name>
70+
</ProjectReference>
71+
</ItemGroup>
72+
<ItemGroup>
73+
<Compile Include="..\..\..\shared\CommonAssemblyInfo.cs">
74+
<Link>..\CommonAssemblyInfo.cs</Link>
75+
</Compile>
76+
<Compile Include="..\AssemblyInfo.cs" />
77+
<Compile Include="..\CompareConstraint.cs" />
78+
<Compile Include="..\EvaluateXPathConstraint.cs" />
79+
<Compile Include="..\HasXPathConstraint.cs" />
80+
<Compile Include="..\ValidationConstraints.cs" />
81+
</ItemGroup>
82+
<ItemGroup>
83+
<None Include="packages.config" />
84+
</ItemGroup>
85+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSHARP.Targets" />
86+
<ProjectExtensions>
87+
<VisualStudio AllowExistingFolder="true" />
88+
</ProjectExtensions>
89+
</Project>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<packages>
3+
<package id="NUnit" version="4.3.2" targetFramework="net462" />
4+
</packages>

src/main/net-constraints-nunit4/XMLUnit.NUnit4.Constraints.csproj

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,7 @@
1313
limitations under the License.
1414
-->
1515

16-
<Project>
17-
18-
<Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" />
16+
<Project Sdk="Microsoft.NET.Sdk">
1917

2018
<PropertyGroup Label="Build">
2119
<TargetFrameworks>net6.0;net462</TargetFrameworks>
@@ -53,8 +51,4 @@
5351
<ItemGroup>
5452
<PackageReference Include="NUnit" Version="4.3.2" />
5553
</ItemGroup>
56-
57-
<Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" />
58-
<Import Project="..\..\shared\no-build.targets"
59-
Condition="$([System.Environment]::Version) &lt; 6.0.0.0"/>
6054
</Project>

src/shared/no-build.targets

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)