From 65e651506ce0291c9e42dd936c4c3a43e76a74a5 Mon Sep 17 00:00:00 2001 From: Michael Nebel Date: Thu, 8 Jun 2023 08:51:21 +0200 Subject: [PATCH] C#: Address review comments. --- csharp/tools/tracing-config.lua | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/csharp/tools/tracing-config.lua b/csharp/tools/tracing-config.lua index 49044226da3b..f04169caff50 100644 --- a/csharp/tools/tracing-config.lua +++ b/csharp/tools/tracing-config.lua @@ -21,6 +21,7 @@ function RegisterExtractorPack(id) -- if that's `build`, we append `-p:UseSharedCompilation=false` to the command line, -- otherwise we do nothing. local match = false + local testMatch = false local dotnetRunNeedsSeparator = false; local dotnetRunInjectionIndex = nil; local argv = compilerArguments.argv @@ -50,10 +51,11 @@ function RegisterExtractorPack(id) end if arg == 'test' then match = true + testMatch = true end - -- for `dotnet [test|run]`, we should not append `-p:UseSharedCompilation=false` to the command line - -- if a library or executable is being provided as an argument. - if arg:match('%.exe$') or arg:match('%.dll') then + -- for `dotnet test`, we should not append `-p:UseSharedCompilation=false` to the command line + -- if an `exe` or `dll` is passed as an argument as the call is forwarded to vstest. + if testMatch and (arg:match('%.exe$') or arg:match('%.dll')) then match = false break end