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

Macro-generated code causes plugin to crash during coverageReport task #102

Closed
ryan-williams opened this issue Nov 6, 2017 · 4 comments
Closed

Comments

@ryan-williams
Copy link
Contributor

cf. Travis build

[info] Generating scoverage reports...
[info] Written Cobertura report [/home/travis/build/hammerlab/iterators/core/target/scala-2.11/coverage-report/cobertura.xml]
java.lang.RuntimeException: No source root found for '/home/travis/build/hammerlab/iterators/<macro>' (source roots: '/home/travis/build/hammerlab/iterators/core/src/main/scala/')
	at scoverage.report.BaseReportWriter.relativeSource(BaseReportWriter.scala:28)
	at scoverage.report.BaseReportWriter.relativeSource(BaseReportWriter.scala:16)
	at scoverage.report.CoberturaXmlWriter.klass(CoberturaXmlWriter.scala:42)
	at scoverage.report.CoberturaXmlWriter$$anonfun$pack$1.apply(CoberturaXmlWriter.scala:66)
	at scoverage.report.CoberturaXmlWriter$$anonfun$pack$1.apply(CoberturaXmlWriter.scala:66)
	at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
	at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:244)
…

This repository has a simple scalameta macro-annotation that shuffles some code between a class and its companion object, and injects some implicit conversions.

@gslowikowski
Copy link
Member

I don't understand, how your @IteratorOps annotation works, but shouldn't the generated methods be synthetic? Scoverage checks synthetic flag when instrumenting code.

@gslowikowski
Copy link
Member

@ryan-williams I probably have a fix. I would like you to assist in verifying it, if you have time.

Please start with creating an issue in scalac-scoverage-plugin issues. That is the right place.

@ryan-williams
Copy link
Contributor Author

Thanks @gslowikowski, I was just meaning to put together a proper repro for this; filed scoverage/scalac-scoverage-plugin#210.

Let me know if I can help!

@gslowikowski
Copy link
Member

Closing the issue, this is not a problem with this plugin, but with scalac-scoverage-plugin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants