From 7598a43d3aa01247272a737be37499c10d4d8ae9 Mon Sep 17 00:00:00 2001 From: Christoph Wille Date: Mon, 7 Jul 2025 10:31:34 +0200 Subject: [PATCH] .NET 10 MTP dotnet test --- .github/workflows/build-ilspy.yml | 16 +++++++++------- Directory.Packages.props | 4 ++-- .../ICSharpCode.Decompiler.Tests.csproj | 9 +++++++-- .../ILSpy.BamlDecompiler.Tests.csproj | 7 +++++-- ILSpy.Tests/ILSpy.Tests.csproj | 7 +++++-- dotnet.config | 2 ++ 6 files changed, 30 insertions(+), 15 deletions(-) create mode 100644 dotnet.config diff --git a/.github/workflows/build-ilspy.yml b/.github/workflows/build-ilspy.yml index c684ff8c0..8393eb141 100644 --- a/.github/workflows/build-ilspy.yml +++ b/.github/workflows/build-ilspy.yml @@ -63,24 +63,26 @@ jobs: run: msbuild ILSpy.sln /p:Configuration=${{ matrix.configuration }} /p:Platform=$env:BuildPlatform /m - name: Execute unit tests - run: dotnet test --logger "trx;LogFileName=${{ matrix.configuration }}.trx" --results-directory test-results $env:Tests1 $env:Tests2 $env:Tests3 - env: - Tests1: ICSharpCode.Decompiler.Tests\bin\${{ matrix.configuration }}\net10.0-windows\win-x64\ICSharpCode.Decompiler.Tests.dll - Tests2: ILSpy.Tests\bin\${{ matrix.configuration }}\net10.0-windows\ILSpy.Tests.dll - Tests3: ILSpy.BamlDecompiler.Tests\bin\${{ matrix.configuration }}\net10.0-windows\win-x64\ILSpy.BamlDecompiler.Tests.dll + run: dotnet test --solution ilspy.sln --configuration Debug --no-build --report-trx --report-trx-filename test-results.trx - name: Upload Test Logs uses: actions/upload-artifact@v4 if: success() || failure() with: name: test-results-${{ matrix.configuration }} - path: 'test-results/${{ matrix.configuration }}.trx' + path: | + ICSharpCode.Decompiler.Tests/bin/${{ matrix.configuration }}/net10.0-windows/win-x64/TestResults/*.trx + ILSpy.Tests/bin/${{ matrix.configuration }}/net10.0-windows/TestResults/*.trx + ILSpy.BamlDecompiler.Tests/bin/${{ matrix.configuration }}/net10.0-windows/win-x64/TestResults/*.trx - name: Create Test Report uses: icsharpcode/test-summary-action@dist if: always() with: - paths: "test-results/${{ matrix.configuration }}.trx" + paths: | + ICSharpCode.Decompiler.Tests/bin/${{ matrix.configuration }}/net10.0-windows/win-x64/TestResults/*.trx + ILSpy.Tests/bin/${{ matrix.configuration }}/net10.0-windows/TestResults/*.trx + ILSpy.BamlDecompiler.Tests/bin/${{ matrix.configuration }}/net10.0-windows/win-x64/TestResults/*.trx folded: true - name: Format check diff --git a/Directory.Packages.props b/Directory.Packages.props index 37ef9ac32..583f84e85 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -11,7 +11,6 @@ - @@ -29,12 +28,13 @@ + - + diff --git a/ICSharpCode.Decompiler.Tests/ICSharpCode.Decompiler.Tests.csproj b/ICSharpCode.Decompiler.Tests/ICSharpCode.Decompiler.Tests.csproj index 50bc5be58..73f2ca1e8 100644 --- a/ICSharpCode.Decompiler.Tests/ICSharpCode.Decompiler.Tests.csproj +++ b/ICSharpCode.Decompiler.Tests/ICSharpCode.Decompiler.Tests.csproj @@ -13,7 +13,12 @@ win-arm64 false - AutoGeneratedProgram + + true + ICSharpCode.Decompiler.Tests.MicrosoftTestingPlatformEntryPoint + true + true + Exe True @@ -69,7 +74,7 @@ - + diff --git a/ILSpy.BamlDecompiler.Tests/ILSpy.BamlDecompiler.Tests.csproj b/ILSpy.BamlDecompiler.Tests/ILSpy.BamlDecompiler.Tests.csproj index 3c758f5ae..c6a7e0583 100644 --- a/ILSpy.BamlDecompiler.Tests/ILSpy.BamlDecompiler.Tests.csproj +++ b/ILSpy.BamlDecompiler.Tests/ILSpy.BamlDecompiler.Tests.csproj @@ -12,7 +12,10 @@ win-arm64 false - AutoGeneratedProgram + + true + true + Exe false true @@ -40,7 +43,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/ILSpy.Tests/ILSpy.Tests.csproj b/ILSpy.Tests/ILSpy.Tests.csproj index 5c361e11c..2e9af4df7 100644 --- a/ILSpy.Tests/ILSpy.Tests.csproj +++ b/ILSpy.Tests/ILSpy.Tests.csproj @@ -4,7 +4,10 @@ net10.0-windows false - AutoGeneratedProgram + + true + true + Exe True @@ -75,7 +78,7 @@ - + diff --git a/dotnet.config b/dotnet.config new file mode 100644 index 000000000..b87edde3a --- /dev/null +++ b/dotnet.config @@ -0,0 +1,2 @@ +[dotnet.test.runner] +name = "Microsoft.Testing.Platform" \ No newline at end of file