Skip to content
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

Add support for /instrument codecoverage for new language features #14337

Closed
ManishJayaswal opened this issue Oct 6, 2016 · 6 comments
Closed
Assignees
Labels
4 - In Review A fix for the issue is submitted for review. Area-Compilers Feature Request
Milestone

Comments

@ManishJayaswal
Copy link
Contributor

@JohnHamby mentioned that it does not work for all new C# language features.

@ManishJayaswal
Copy link
Contributor Author

FYI - @JohnHamby @jaredpar @VSadov @jcouv @gafter

@gafter
Copy link
Member

gafter commented Oct 6, 2016

We already support instrumentation for

  1. the deconstruction declaration statement (currently Instrumenter.InstrumentLocalDeconstructionDeclaration)
  2. deconstruction in a for-each (currently Instrumenter.InstrumentForEachStatementDeconstructionVariablesDeclaration)
  3. the pattern switch statement (currently Instrumenter.InstrumentPatternSwitchStatement)
  4. the new switch when clause (currently Instrumenter.InstrumentPatternSwitchWhenClauseConditionalGotoBody)

These are already implemented for Instrumenter, CompoundInstrumenter, and DebugInfoInjector, and invoked appropriately from the compilers.

Code coverage support will need to be specified and then implemented. I'll set up a meeting to decide what the spec is.

@gafter
Copy link
Member

gafter commented Oct 6, 2016

See also #14156

@msJohnHamby
Copy link
Contributor

Just to be sure that there's no confusion, the instrumentation requested here is done by DynamicAnalysisInjector, which is absent from the list of already-enhanced instrumenters mentioned above.

@ManishJayaswal
Copy link
Contributor Author

FYI @AlekseyTs

@gafter
Copy link
Member

gafter commented Oct 17, 2016

The desired behavior is as follows

  • For InstrumentLocalDeconstructionDeclaration, it should be instrumented just like any other statement.
  • For InstrumentForEachStatementDeconstructionVariablesDeclaration, it should be instrumented the same way as InstrumentForEachStatementIterationVarDeclaration.
  • For InstrumentPatternSwitchStatement, it should be handled the same way as InstrumentSwitchStatement.
  • For InstrumentPatternSwitchWhenClauseConditionalGotoBody, the ‘when’ clause should be instrumented as if it were a separate statement. There doesn’t appear to be a suitable helper to do that, because the clause isn’t syntactically a Statement, but the instrumentation should do something morally equivalent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4 - In Review A fix for the issue is submitted for review. Area-Compilers Feature Request
Projects
None yet
Development

No branches or pull requests

3 participants