Skip to content

Commit 5c9b0b9

Browse files
committed
C#: Address review comments.
1 parent 4dae7ad commit 5c9b0b9

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

csharp/ql/integration-tests/posix-only/dotnet_test/test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@
77

88
# Explicitly build and then run tests.
99
run_codeql_database_create(['dotnet clean', 'rm -rf test-db', 'dotnet build -o myout', 'dotnet test myout/dotnet_test.dll'], test_db="test2-db", lang="csharp")
10-
check_diagnostics(test_db="test2-db")
10+
check_diagnostics(test_db="test2-db")

csharp/tools/tracing-config.lua

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ function RegisterExtractorPack(id)
2121
-- if that's `build`, we append `-p:UseSharedCompilation=false` to the command line,
2222
-- otherwise we do nothing.
2323
local match = false
24+
local testMatch = false;
2425
local dotnetRunNeedsSeparator = false;
2526
local dotnetRunInjectionIndex = nil;
26-
local libOrExe = false;
2727
local argv = compilerArguments.argv
2828
if OperatingSystem == 'windows' then
2929
-- let's hope that this split matches the escaping rules `dotnet` applies to command line arguments
@@ -35,7 +35,7 @@ function RegisterExtractorPack(id)
3535
-- dotnet options start with either - or / (both are legal)
3636
local firstCharacter = string.sub(arg, 1, 1)
3737
if not (firstCharacter == '-') and not (firstCharacter == '/') then
38-
if (not match) then
38+
if (not match and not testMatch) then
3939
Log(1, 'Dotnet subcommand detected: %s', arg)
4040
end
4141
if arg == 'build' or arg == 'msbuild' or arg == 'publish' or arg == 'pack' then
@@ -50,12 +50,12 @@ function RegisterExtractorPack(id)
5050
dotnetRunInjectionIndex = i + 1
5151
end
5252
if arg == 'test' then
53-
match = true
53+
testMatch = true
5454
end
5555
-- for `dotnet test`, we should not append `-p:UseSharedCompilation=false` to the command line
5656
-- if a library or executable is being provided as an argument.
57-
if arg:match('%.exe$') or arg:match('%.dll') then
58-
libOrExe = true
57+
if testMatch and (arg:match('%.exe$') or arg:match('%.dll')) then
58+
testMatch = false
5959
end
6060
end
6161
-- if we see a separator to `dotnet run`, inject just prior to the existing separator
@@ -71,7 +71,7 @@ function RegisterExtractorPack(id)
7171
dotnetRunInjectionIndex = i
7272
end
7373
end
74-
if match and not libOrExe then
74+
if match or testMatch then
7575
local injections = { '-p:UseSharedCompilation=false', '-p:EmitCompilerGeneratedFiles=true' }
7676
if dotnetRunNeedsSeparator then
7777
table.insert(injections, '--')

0 commit comments

Comments
 (0)