C#: Address review comments.

This commit is contained in:
Michael Nebel
2023-06-08 08:51:21 +02:00
parent f9c890be35
commit 65e651506c

View File

@@ -21,6 +21,7 @@ function RegisterExtractorPack(id)
-- if that's `build`, we append `-p:UseSharedCompilation=false` to the command line, -- if that's `build`, we append `-p:UseSharedCompilation=false` to the command line,
-- otherwise we do nothing. -- otherwise we do nothing.
local match = false local match = false
local testMatch = false
local dotnetRunNeedsSeparator = false; local dotnetRunNeedsSeparator = false;
local dotnetRunInjectionIndex = nil; local dotnetRunInjectionIndex = nil;
local argv = compilerArguments.argv local argv = compilerArguments.argv
@@ -50,10 +51,11 @@ function RegisterExtractorPack(id)
end end
if arg == 'test' then if arg == 'test' then
match = true match = true
testMatch = true
end end
-- for `dotnet [test|run]`, we should not append `-p:UseSharedCompilation=false` to the command line -- for `dotnet test`, we should not append `-p:UseSharedCompilation=false` to the command line
-- if a library or executable is being provided as an argument. -- if an `exe` or `dll` is passed as an argument as the call is forwarded to vstest.
if arg:match('%.exe$') or arg:match('%.dll') then if testMatch and (arg:match('%.exe$') or arg:match('%.dll')) then
match = false match = false
break break
end end