-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
C#: Dotnet test tracer improvements. #13387
Changes from 7 commits
0f010af
4dae7ad
5c9b0b9
3eb3178
d4d571e
f9c890b
65e6515
2fece9d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,10 @@ | ||
from create_database_utils import * | ||
from diagnostics_test_utils import * | ||
|
||
run_codeql_database_create(['dotnet test'], db=None, lang="csharp") | ||
# Implicitly build and then run tests. | ||
run_codeql_database_create(['dotnet test'], test_db="test-db", lang="csharp") | ||
check_diagnostics() | ||
|
||
# Explicitly build and then run tests. | ||
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") | ||
check_diagnostics(test_db="test2-db") |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
--- | ||
category: minorAnalysis | ||
--- | ||
* C#: Analysis of the `dotnet test` command supplied with a `dll` or `exe` file as argument no longer fails due to the addition of an erroneous `-p:SharedCompilation=false` argument. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should be There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, thank you!!! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The release process has already been started, so we can't update the change note (since it is only a minor inaccuracy we don't want to stop the release to incorporate the change note modification). |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
@@ -37,7 +38,7 @@ function RegisterExtractorPack(id) | |
if (not match) then | ||
Log(1, 'Dotnet subcommand detected: %s', arg) | ||
end | ||
if arg == 'build' or arg == 'msbuild' or arg == 'publish' or arg == 'pack' or arg == 'test' then | ||
if arg == 'build' or arg == 'msbuild' or arg == 'publish' or arg == 'pack' then | ||
match = true | ||
break | ||
end | ||
|
@@ -48,6 +49,16 @@ function RegisterExtractorPack(id) | |
dotnetRunNeedsSeparator = true | ||
dotnetRunInjectionIndex = i + 1 | ||
end | ||
if arg == 'test' then | ||
match = true | ||
testMatch = true | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How about
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, we can also do that if we accept that the change also applies to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry, I was maybe not clear: I intended to keep the testMatch = true
match = true and then keep the check There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
By closer inspection, that part is actually unclear as it is not documented as a part of |
||
end | ||
-- 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 | ||
end | ||
-- if we see a separator to `dotnet run`, inject just prior to the existing separator | ||
if arg == '--' then | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it feasible to have a similar test with
.exe
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I will make another test.