From 747bba2bc901cf28a6f375114dc58ef764e6ffdd Mon Sep 17 00:00:00 2001 From: Alex Zaytsev Date: Thu, 13 Oct 2022 13:34:36 +1300 Subject: [PATCH 1/4] Fail build if tests fail --- test.cmd | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/test.cmd b/test.cmd index 9596647f..f28a15f6 100644 --- a/test.cmd +++ b/test.cmd @@ -4,11 +4,10 @@ nunit3-console ^ src\DelegateDecompiler.Tests\bin\Release\net45\DelegateDecompiler.Tests.dll ^ src\DelegateDecompiler.Tests.VB\bin\Release\net45\DelegateDecompiler.Tests.VB.dll ^ src\DelegateDecompiler.EntityFramework.Tests\bin\Release\net45\DelegateDecompiler.EntityFramework.Tests.dll ^ - --result=DelegateDecompiler.testsresults.xml;format=AppVeyor - -dotnet test --no-build -c Release -f netcoreapp3.1 src\DelegateDecompiler.Tests -dotnet test --no-build -c Release -f netcoreapp3.1 src\DelegateDecompiler.Tests.VB -dotnet test --no-build -c Release -f netcoreapp3.1 src\DelegateDecompiler.EntityFramework.Tests -dotnet test --no-build -c Release -f netcoreapp3.1 src\DelegateDecompiler.EntityFrameworkCore.Tests -dotnet test --no-build -c Release -f netcoreapp3.1 src\DelegateDecompiler.EntityFrameworkCore3.Tests + --result=DelegateDecompiler.testsresults.xml;format=AppVeyor & ^ +dotnet test --no-build -c Release -f netcoreapp3.1 src\DelegateDecompiler.Tests & ^ +dotnet test --no-build -c Release -f netcoreapp3.1 src\DelegateDecompiler.Tests.VB & ^ +dotnet test --no-build -c Release -f netcoreapp3.1 src\DelegateDecompiler.EntityFramework.Tests & ^ +dotnet test --no-build -c Release -f netcoreapp3.1 src\DelegateDecompiler.EntityFrameworkCore.Tests & ^ +dotnet test --no-build -c Release -f netcoreapp3.1 src\DelegateDecompiler.EntityFrameworkCore3.Tests & ^ dotnet test --no-build -c Release -f net5.0 src\DelegateDecompiler.EntityFrameworkCore5.Tests From 2e0e3612f40c9d162f17b93a495d3b100ef5fdf4 Mon Sep 17 00:00:00 2001 From: Alex Zaytsev Date: Thu, 13 Oct 2022 13:43:09 +1300 Subject: [PATCH 2/4] exit error level --- test.cmd | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test.cmd b/test.cmd index f28a15f6..5639d04d 100644 --- a/test.cmd +++ b/test.cmd @@ -11,3 +11,5 @@ dotnet test --no-build -c Release -f netcoreapp3.1 src\DelegateDecompiler.Entity dotnet test --no-build -c Release -f netcoreapp3.1 src\DelegateDecompiler.EntityFrameworkCore.Tests & ^ dotnet test --no-build -c Release -f netcoreapp3.1 src\DelegateDecompiler.EntityFrameworkCore3.Tests & ^ dotnet test --no-build -c Release -f net5.0 src\DelegateDecompiler.EntityFrameworkCore5.Tests + +exit /b %ERRORLEVEL% \ No newline at end of file From ebcec3e5c8ff53122cbbd12062b80cb1a1b95aea Mon Sep 17 00:00:00 2001 From: Alex Zaytsev Date: Thu, 13 Oct 2022 13:52:53 +1300 Subject: [PATCH 3/4] Fix --- test.cmd | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/test.cmd b/test.cmd index 5639d04d..2a985241 100644 --- a/test.cmd +++ b/test.cmd @@ -4,12 +4,11 @@ nunit3-console ^ src\DelegateDecompiler.Tests\bin\Release\net45\DelegateDecompiler.Tests.dll ^ src\DelegateDecompiler.Tests.VB\bin\Release\net45\DelegateDecompiler.Tests.VB.dll ^ src\DelegateDecompiler.EntityFramework.Tests\bin\Release\net45\DelegateDecompiler.EntityFramework.Tests.dll ^ - --result=DelegateDecompiler.testsresults.xml;format=AppVeyor & ^ -dotnet test --no-build -c Release -f netcoreapp3.1 src\DelegateDecompiler.Tests & ^ -dotnet test --no-build -c Release -f netcoreapp3.1 src\DelegateDecompiler.Tests.VB & ^ -dotnet test --no-build -c Release -f netcoreapp3.1 src\DelegateDecompiler.EntityFramework.Tests & ^ -dotnet test --no-build -c Release -f netcoreapp3.1 src\DelegateDecompiler.EntityFrameworkCore.Tests & ^ -dotnet test --no-build -c Release -f netcoreapp3.1 src\DelegateDecompiler.EntityFrameworkCore3.Tests & ^ -dotnet test --no-build -c Release -f net5.0 src\DelegateDecompiler.EntityFrameworkCore5.Tests + --result=DelegateDecompiler.testsresults.xml;format=AppVeyor && ^ -exit /b %ERRORLEVEL% \ No newline at end of file +dotnet test --no-build -c Release -f netcoreapp3.1 src\DelegateDecompiler.Tests && ^ +dotnet test --no-build -c Release -f netcoreapp3.1 src\DelegateDecompiler.Tests.VB && ^ +dotnet test --no-build -c Release -f netcoreapp3.1 src\DelegateDecompiler.EntityFramework.Tests && ^ +dotnet test --no-build -c Release -f netcoreapp3.1 src\DelegateDecompiler.EntityFrameworkCore.Tests && ^ +dotnet test --no-build -c Release -f netcoreapp3.1 src\DelegateDecompiler.EntityFrameworkCore3.Tests && ^ +dotnet test --no-build -c Release -f net5.0 src\DelegateDecompiler.EntityFrameworkCore5.Tests From 7ea6df3a6470f6aca5328c7bc0959a6b43d089ac Mon Sep 17 00:00:00 2001 From: Alex Zaytsev Date: Thu, 13 Oct 2022 13:57:15 +1300 Subject: [PATCH 4/4] Fix test --- src/DelegateDecompiler/OptimizeExpressionVisitor.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/DelegateDecompiler/OptimizeExpressionVisitor.cs b/src/DelegateDecompiler/OptimizeExpressionVisitor.cs index 106a388a..96331bc2 100644 --- a/src/DelegateDecompiler/OptimizeExpressionVisitor.cs +++ b/src/DelegateDecompiler/OptimizeExpressionVisitor.cs @@ -460,7 +460,7 @@ protected override Expression VisitMethodCall(MethodCallExpression node) { if (node.Method.Name == nameof(Expression.Constant) && node.Method.DeclaringType == typeof(Expression) && - node.Arguments[0] is Expression parameter) + node.Arguments[0] is ParameterExpression parameter) { return Expression.Constant(parameter); }