Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,10 @@ jobs:
- name: Build
run: dotnet build --no-restore --verbosity normal
- name: Test
run: dotnet test --no-restore --verbosity normal --logger trx --results-directory test-results/
run: dotnet test --no-restore -- --results-directory ${{ github.workspace }}/test-results/ --report-xunit-trx
- name: Upload Test Results
if: always()
uses: actions/upload-artifact@v4
with:
name: Test Results (${{ matrix.os }} ${{ matrix.configuration }} ${{ matrix.projectloadstyle }})
path: test-results/*
path: ${{ github.workspace }}/test-results/*
1 change: 1 addition & 0 deletions .github/workflows/code-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ on:

jobs:
build_and_test:
if: false # Disable for now while getting XUnit v3 working
name: Run

env:
Expand Down
19 changes: 10 additions & 9 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,11 @@
<NoWarn>$(NoWarn);CS1685</NoWarn>
<ProductTargetFrameworks>net35</ProductTargetFrameworks>
<FrameworkTargetFrameworks>net35</FrameworkTargetFrameworks>
<TestTargetFrameworks>net462</TestTargetFrameworks>
<AssetsTargetFrameworks>net462</AssetsTargetFrameworks>
<LatestTargetFramework>net462</LatestTargetFramework>
<TestTargetFrameworks>net472</TestTargetFrameworks>
<AssetsTargetFrameworks>net472</AssetsTargetFrameworks>
<LatestTargetFramework>net472</LatestTargetFramework>
<SamplesFrameworks>net472</SamplesFrameworks>
<DefineConstants>$(DefineConstants);FEATURE_NO_VALIDATOR_CANCELLATIONTOKEN</DefineConstants>
</PropertyGroup>
</When>
<When Condition=" '$(ProjectLoadStyle)' == 'net40' ">
Expand All @@ -53,22 +54,22 @@
<NoWarn>$(NoWarn);CS1685</NoWarn>
<ProductTargetFrameworks>net40</ProductTargetFrameworks>
<FrameworkTargetFrameworks>net40</FrameworkTargetFrameworks>
<TestTargetFrameworks>net462</TestTargetFrameworks>
<AssetsTargetFrameworks>net462</AssetsTargetFrameworks>
<LatestTargetFramework>net462</LatestTargetFramework>
<TestTargetFrameworks>net472</TestTargetFrameworks>
<AssetsTargetFrameworks>net472</AssetsTargetFrameworks>
<LatestTargetFramework>net472</LatestTargetFramework>
<SamplesFrameworks>net472</SamplesFrameworks>
</PropertyGroup>
</When>
<Otherwise>
<PropertyGroup>
<ProductTargetFrameworks>netstandard2.0;net8.0;net35;net40;net46</ProductTargetFrameworks>
<FrameworkTargetFrameworks>netstandard2.0;net6.0;net8.0;net35;net40;net46</FrameworkTargetFrameworks>
<AssetsTargetFrameworks>netstandard2.0;net462</AssetsTargetFrameworks>
<AssetsTargetFrameworks>netstandard2.0;net472</AssetsTargetFrameworks>
<TestTargetFrameworks>net8.0</TestTargetFrameworks>
<TestTargetFrameworks Condition=" '$(OS)' == 'Windows_NT' ">$(TestTargetFrameworks);net462</TestTargetFrameworks>
<TestTargetFrameworks Condition=" '$(OS)' == 'Windows_NT' ">$(TestTargetFrameworks);net472</TestTargetFrameworks>
<LatestTargetFramework>net8.0</LatestTargetFramework>
<SamplesFrameworks>net8.0</SamplesFrameworks>
<SamplesFrameworks Condition=" '$(OS)' == 'Windows_NT' ">$(TestTargetFrameworks);net472</SamplesFrameworks>
<SamplesFrameworks Condition=" '$(OS)' == 'Windows_NT' ">$(SamplesFrameworks);net472</SamplesFrameworks>
</PropertyGroup>
</Otherwise>
</Choose>
Expand Down
4 changes: 2 additions & 2 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageVersion Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.3" />
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="8.0.0" />
<PackageVersion Include="Microsoft.Testing.Extensions.CodeCoverage" Version="17.13.1" />
<PackageVersion Include="Newtonsoft.Json" Version="13.0.3" />
<PackageVersion Include="NSubstitute" Version="5.3.0" />
<PackageVersion Include="NuGet.Common" Version="6.12.1" />
Expand All @@ -30,7 +31,6 @@
<PackageVersion Include="System.Text.Json" Version="9.0.0" />
<PackageVersion Include="System.Xml.ReaderWriter" Version="4.3.1" />
<PackageVersion Include="System.ValueTuple" Version="4.5.0" />
<PackageVersion Include="xunit" Version="2.9.2" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.8.2" />
<PackageVersion Include="xunit.v3" Version="1.0.0" />
</ItemGroup>
</Project>
7 changes: 0 additions & 7 deletions Open-XML-SDK.sln
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "gen", "gen", "{3653266D-2C8
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DocumentFormat.OpenXml.Generator", "gen\DocumentFormat.OpenXml.Generator\DocumentFormat.OpenXml.Generator.csproj", "{E04F2FB4-DBC6-46DC-857C-F0E89B42F385}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DocumentFormat.OpenXml.Generator.Tests", "test\DocumentFormat.OpenXml.Generator.Tests\DocumentFormat.OpenXml.Generator.Tests.csproj", "{BAC36A8F-AA8E-4097-B2BA-2EFE559BEE62}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Linq", "Linq", "{C5AE39F0-A152-471A-B90E-B8F4E94AA6C2}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SvgExampleLinq", "samples\Linq\SvgExample\SvgExampleLinq.csproj", "{DE06FC2B-EABB-4535-BC73-C51A32B5AC01}"
Expand Down Expand Up @@ -149,10 +147,6 @@ Global
{E04F2FB4-DBC6-46DC-857C-F0E89B42F385}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E04F2FB4-DBC6-46DC-857C-F0E89B42F385}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E04F2FB4-DBC6-46DC-857C-F0E89B42F385}.Release|Any CPU.Build.0 = Release|Any CPU
{BAC36A8F-AA8E-4097-B2BA-2EFE559BEE62}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BAC36A8F-AA8E-4097-B2BA-2EFE559BEE62}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BAC36A8F-AA8E-4097-B2BA-2EFE559BEE62}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BAC36A8F-AA8E-4097-B2BA-2EFE559BEE62}.Release|Any CPU.Build.0 = Release|Any CPU
{DE06FC2B-EABB-4535-BC73-C51A32B5AC01}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DE06FC2B-EABB-4535-BC73-C51A32B5AC01}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DE06FC2B-EABB-4535-BC73-C51A32B5AC01}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand Down Expand Up @@ -211,7 +205,6 @@ Global
{E157C5F1-D70B-4939-A199-0B758FED8541} = {0782A132-968D-4BDD-911A-2C3074EAF886}
{3B82C340-3B10-42BF-9A2C-2E2327A9CFD4} = {0782A132-968D-4BDD-911A-2C3074EAF886}
{E04F2FB4-DBC6-46DC-857C-F0E89B42F385} = {3653266D-2C88-4487-8977-839CB3E78A0A}
{BAC36A8F-AA8E-4097-B2BA-2EFE559BEE62} = {0782A132-968D-4BDD-911A-2C3074EAF886}
{C5AE39F0-A152-471A-B90E-B8F4E94AA6C2} = {7DAF7304-40CC-4180-88A5-9A89DD13C565}
{DE06FC2B-EABB-4535-BC73-C51A32B5AC01} = {7DAF7304-40CC-4180-88A5-9A89DD13C565}
{890B74DD-6316-4D56-B42A-5D66F10F88C6} = {C5AE39F0-A152-471A-B90E-B8F4E94AA6C2}
Expand Down
2 changes: 1 addition & 1 deletion test/Common/ITestOutputHelperExtenstions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
using System.IO;
using Xunit.Abstractions;
using Xunit;
Copy link

Copilot AI Mar 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The file name 'ITestOutputHelperExtenstions.cs' appears to contain a typographical error; consider renaming it to 'ITestOutputHelperExtensions.cs' for clarity.

Copilot uses AI. Check for mistakes.

namespace DocumentFormat.OpenXml.Tests
{
Expand Down
1 change: 0 additions & 1 deletion test/Common/VerifiableLog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

using System;
using Xunit;
using Xunit.Abstractions;

namespace LogUtil
{
Expand Down
20 changes: 8 additions & 12 deletions test/Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
<Project>
<Choose>
<When Condition="$(IsTestProject)">
<PropertyGroup>
<UseMicrosoftTestingPlatformRunner>true</UseMicrosoftTestingPlatformRunner>
<TestingPlatformDotnetTestSupport>true</TestingPlatformDotnetTestSupport>
</PropertyGroup>

<PropertyGroup>
<NoWarn>$(NoWarn);CA1303;CA1307;CA1309;CA1822;CA1062</NoWarn>
<CommonFilesDirectory>$(MSBuildThisFileDirectory)Common/</CommonFilesDirectory>
Expand All @@ -12,20 +17,11 @@
<Link>Common/$([MSBuild]::MakeRelative($(CommonFilesDirectory), %(FullPath)))</Link>
</Compile>
</ItemGroup>

<ItemGroup>
<PackageReference Include="Newtonsoft.Json" />
<PackageReference Include="System.ValueTuple" />
<PackageReference Include="Microsoft.NET.Test.Sdk" />
<PackageReference Include="NSubstitute" />
<PackageReference Include="xunit" />
<PackageReference Include="xunit.runner.visualstudio">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="coverlet.collector">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.Testing.Extensions.CodeCoverage" />
<PackageReference Include="xunit.v3" />
</ItemGroup>
</When>
</Choose>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
<ItemGroup>
<PackageReference Include="BenchmarkDotNet" />
<PackageReference Include="BenchmarkDotNet.Diagnostics.Windows" />
<PackageReference Include="xunit" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\DocumentFormat.OpenXml\DocumentFormat.OpenXml.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<IsTestProject>true</IsTestProject>
<Nullable>enable</Nullable>
<IncludeFrameworkShims>true</IncludeFrameworkShims>
<OutputType>Exe</OutputType>
</PropertyGroup>

<ItemGroup>
Expand All @@ -15,4 +16,9 @@
<ProjectReference Include="..\..\src\DocumentFormat.OpenXml.Features\DocumentFormat.OpenXml.Features.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Newtonsoft.Json" />
<PackageReference Include="NSubstitute" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<TargetFrameworks>$(TestTargetFrameworks)</TargetFrameworks>
<IsTestProject>true</IsTestProject>
<IsPackable>false</IsPackable>
<OutputType>Exe</OutputType>
</PropertyGroup>

<ItemGroup>
Expand All @@ -24,4 +25,9 @@
<ProjectReference Include="..\DocumentFormat.OpenXml.Tests.Assets\DocumentFormat.OpenXml.Tests.Assets.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Newtonsoft.Json" />
<PackageReference Include="NSubstitute" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
using System.Linq;
using System.Reflection;
using Xunit;
using Xunit.Abstractions;

using static DocumentFormat.OpenXml.Framework.Tests.TestUtility;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
using System.Collections.Generic;
using System.Xml;
using Xunit;
using Xunit.Abstractions;

namespace DocumentFormat.OpenXml.Framework.Tests;

Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,16 @@
<TargetFrameworks>$(TestTargetFrameworks)</TargetFrameworks>
<IsTestProject>true</IsTestProject>
<Nullable>enable</Nullable>
<OutputType>Exe</OutputType>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\DocumentFormat.OpenXml.Linq\DocumentFormat.OpenXml.Linq.csproj" />
<ProjectReference Include="..\..\src\DocumentFormat.OpenXml\DocumentFormat.OpenXml.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Newtonsoft.Json" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<PropertyGroup>
<TargetFrameworks>$(TestTargetFrameworks)</TargetFrameworks>
<IsTestProject>true</IsTestProject>
<OutputType>Exe</OutputType>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
using System.Linq;
using System.Reflection;
using Xunit;
using Xunit.Abstractions;

namespace DocumentFormat.OpenXml.Tests
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
using System.Linq;
using System.Reflection;
using Xunit;
using Xunit.Abstractions;

namespace DocumentFormat.OpenXml.Packaging.Tests
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,8 @@
<PropertyGroup>
<TargetFrameworks>$(AssetsTargetFrameworks)</TargetFrameworks>
<NoWarn>$(NoWarn);CA1822;CA1034</NoWarn>
<IsTestProject>false</IsTestProject>
</PropertyGroup>
<ItemGroup>
<EmbeddedResource Include="assets\**\*" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="xunit" />
</ItemGroup>
</Project>
6 changes: 4 additions & 2 deletions test/DocumentFormat.OpenXml.Tests.Assets/TestAssets.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
using System.IO;
using System.Linq;
using System.Reflection;
using Xunit;

namespace DocumentFormat.OpenXml.Tests
{
Expand Down Expand Up @@ -51,7 +50,10 @@ public static Stream GetStream(string name)
var stream = assembly.GetManifestResourceStream($"DocumentFormat.OpenXml.Tests.Assets.assets.{name}");
var names = assembly.GetManifestResourceNames().OrderBy(t => t).ToList();

Assert.NotNull(stream);
if (stream is null)
{
throw new InvalidOperationException($"Could not find stream '{name}' for test");
}

return stream;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
using DocumentFormat.OpenXml.Tests.ChartTrackingRefBasedClass;
using System.IO;
using Xunit;
using Xunit.Abstractions;

namespace DocumentFormat.OpenXml.Tests.ChartTrackingRefBased
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public void CommentExInvalidFormat()
using (var doc = WordprocessingDocument.Open(stream, false))
{
var validator = new OpenXmlValidator(FileFormatVersions.Office2013);
var validateResults = validator.Validate(doc);
var validateResults = validator.Validate(doc, TestContext.Current.CancellationToken);

Assert.Empty(validateResults);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
using DocumentFormat.OpenXml.Tests.CommentExPeopleClass;
using System.IO;
using Xunit;
using Xunit.Abstractions;

namespace DocumentFormat.OpenXml.Tests.CommentExPeople
{
Expand Down
Loading
Loading