From 7598a43d3aa01247272a737be37499c10d4d8ae9 Mon Sep 17 00:00:00 2001 From: Christoph Wille Date: Mon, 7 Jul 2025 10:31:34 +0200 Subject: [PATCH 1/5] .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 From f241025d40d5e2368f14d249d94ef64ff2335251 Mon Sep 17 00:00:00 2001 From: Christoph Wille Date: Mon, 7 Jul 2025 10:46:55 +0200 Subject: [PATCH 2/5] Make ILSpy.Tests.csproj look like the other two test projects wrt RID --- .github/workflows/build-ilspy.yml | 4 ++-- ILSpy.Tests/ILSpy.Tests.csproj | 9 ++++++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-ilspy.yml b/.github/workflows/build-ilspy.yml index 8393eb141..5281bab5c 100644 --- a/.github/workflows/build-ilspy.yml +++ b/.github/workflows/build-ilspy.yml @@ -72,7 +72,7 @@ jobs: name: test-results-${{ matrix.configuration }} 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.Tests/bin/${{ matrix.configuration }}/net10.0-windows/win-x64/TestResults/*.trx ILSpy.BamlDecompiler.Tests/bin/${{ matrix.configuration }}/net10.0-windows/win-x64/TestResults/*.trx - name: Create Test Report @@ -81,7 +81,7 @@ jobs: with: 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.Tests/bin/${{ matrix.configuration }}/net10.0-windows/win-x64/TestResults/*.trx ILSpy.BamlDecompiler.Tests/bin/${{ matrix.configuration }}/net10.0-windows/win-x64/TestResults/*.trx folded: true diff --git a/ILSpy.Tests/ILSpy.Tests.csproj b/ILSpy.Tests/ILSpy.Tests.csproj index 2e9af4df7..635dad18f 100644 --- a/ILSpy.Tests/ILSpy.Tests.csproj +++ b/ILSpy.Tests/ILSpy.Tests.csproj @@ -1,10 +1,17 @@  + + true + true + + net10.0-windows false - + win-x64 + win-arm64 + true true Exe From cc4f53b9e937ea84687bd4d542e37a7b158b018e Mon Sep 17 00:00:00 2001 From: Christoph Wille Date: Mon, 7 Jul 2025 11:01:07 +0200 Subject: [PATCH 3/5] Use ${{ matrix.configuration }} instead of hardcoded Debug in --configuration --- .github/workflows/build-ilspy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-ilspy.yml b/.github/workflows/build-ilspy.yml index 5281bab5c..a9bd095f2 100644 --- a/.github/workflows/build-ilspy.yml +++ b/.github/workflows/build-ilspy.yml @@ -63,7 +63,7 @@ jobs: run: msbuild ILSpy.sln /p:Configuration=${{ matrix.configuration }} /p:Platform=$env:BuildPlatform /m - name: Execute unit tests - run: dotnet test --solution ilspy.sln --configuration Debug --no-build --report-trx --report-trx-filename test-results.trx + run: dotnet test --solution ilspy.sln --configuration ${{ matrix.configuration }} --no-build --report-trx --report-trx-filename test-results.trx - name: Upload Test Logs uses: actions/upload-artifact@v4 From 0974a3659098b745e0089c51d6b6ac54b1af5013 Mon Sep 17 00:00:00 2001 From: Christoph Wille Date: Mon, 7 Jul 2025 11:25:40 +0200 Subject: [PATCH 4/5] Move to --results-directory instead of --report-trx-filename --- .github/workflows/build-ilspy.yml | 12 +++--------- .gitignore | 3 ++- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build-ilspy.yml b/.github/workflows/build-ilspy.yml index a9bd095f2..03bc37cc4 100644 --- a/.github/workflows/build-ilspy.yml +++ b/.github/workflows/build-ilspy.yml @@ -63,26 +63,20 @@ jobs: run: msbuild ILSpy.sln /p:Configuration=${{ matrix.configuration }} /p:Platform=$env:BuildPlatform /m - name: Execute unit tests - run: dotnet test --solution ilspy.sln --configuration ${{ matrix.configuration }} --no-build --report-trx --report-trx-filename test-results.trx + run: dotnet test --solution ilspy.sln --configuration ${{ matrix.configuration }} --no-build --report-trx --results-directory test-results/${{ matrix.configuration }} - name: Upload Test Logs uses: actions/upload-artifact@v4 if: success() || failure() with: name: test-results-${{ matrix.configuration }} - path: | - ICSharpCode.Decompiler.Tests/bin/${{ matrix.configuration }}/net10.0-windows/win-x64/TestResults/*.trx - ILSpy.Tests/bin/${{ matrix.configuration }}/net10.0-windows/win-x64/TestResults/*.trx - ILSpy.BamlDecompiler.Tests/bin/${{ matrix.configuration }}/net10.0-windows/win-x64/TestResults/*.trx + path: 'test-results/${{ matrix.configuration }}/*.trx' - name: Create Test Report uses: icsharpcode/test-summary-action@dist if: always() with: - paths: | - ICSharpCode.Decompiler.Tests/bin/${{ matrix.configuration }}/net10.0-windows/win-x64/TestResults/*.trx - ILSpy.Tests/bin/${{ matrix.configuration }}/net10.0-windows/win-x64/TestResults/*.trx - ILSpy.BamlDecompiler.Tests/bin/${{ matrix.configuration }}/net10.0-windows/win-x64/TestResults/*.trx + paths: "test-results/${{ matrix.configuration }}/*.trx" folded: true - name: Format check diff --git a/.gitignore b/.gitignore index e871f125d..841c2dcc8 100644 --- a/.gitignore +++ b/.gitignore @@ -20,4 +20,5 @@ ILSpy.Installer/wix/ /VERSION /ICSharpCode.Decompiler/Properties/DecompilerVersionInfo.cs */.vscode/ -DecompilerTests.config.json \ No newline at end of file +DecompilerTests.config.json +*.trx \ No newline at end of file From 1a41fd857ea1d9f4a438402252ee2c2a0ee556f3 Mon Sep 17 00:00:00 2001 From: Christoph Wille Date: Mon, 7 Jul 2025 12:53:51 +0200 Subject: [PATCH 5/5] Centralize EnableNUnitRunner, remove obsolete property TestingPlatformDotnetTestSupport --- Directory.Build.props | 4 ++++ .../ICSharpCode.Decompiler.Tests.csproj | 2 -- ILSpy.BamlDecompiler.Tests/ILSpy.BamlDecompiler.Tests.csproj | 3 --- ILSpy.Tests/ILSpy.Tests.csproj | 3 --- 4 files changed, 4 insertions(+), 8 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index 8281d7abd..8f2175855 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -2,4 +2,8 @@ IDE2000 + + + true + \ No newline at end of file diff --git a/ICSharpCode.Decompiler.Tests/ICSharpCode.Decompiler.Tests.csproj b/ICSharpCode.Decompiler.Tests/ICSharpCode.Decompiler.Tests.csproj index 73f2ca1e8..97dfc1c44 100644 --- a/ICSharpCode.Decompiler.Tests/ICSharpCode.Decompiler.Tests.csproj +++ b/ICSharpCode.Decompiler.Tests/ICSharpCode.Decompiler.Tests.csproj @@ -16,8 +16,6 @@ true ICSharpCode.Decompiler.Tests.MicrosoftTestingPlatformEntryPoint - true - true Exe True diff --git a/ILSpy.BamlDecompiler.Tests/ILSpy.BamlDecompiler.Tests.csproj b/ILSpy.BamlDecompiler.Tests/ILSpy.BamlDecompiler.Tests.csproj index c6a7e0583..a83191339 100644 --- a/ILSpy.BamlDecompiler.Tests/ILSpy.BamlDecompiler.Tests.csproj +++ b/ILSpy.BamlDecompiler.Tests/ILSpy.BamlDecompiler.Tests.csproj @@ -12,9 +12,6 @@ win-arm64 false - - true - true Exe false diff --git a/ILSpy.Tests/ILSpy.Tests.csproj b/ILSpy.Tests/ILSpy.Tests.csproj index 635dad18f..cad59a4a8 100644 --- a/ILSpy.Tests/ILSpy.Tests.csproj +++ b/ILSpy.Tests/ILSpy.Tests.csproj @@ -11,9 +11,6 @@ false win-x64 win-arm64 - - true - true Exe True