1004029365 / apparat

Automatically exported from code.google.com/p/apparat
0 stars 1 forks source link

Is there anyway for the Coverage tool to dump all lines it instrument for a swf? #55

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
We do not want to use FlexMojo to run the coverage test, so will directly use 
apparat to instrument a swf ile.
It will be nice if the Coverage tool to dump all lines it instrument for each 
class into a log file.

--Rui

Original issue reported on code.google.com by r...@ooyala.com on 13 Oct 2011 at 7:42

GoogleCodeExporter commented 8 years ago
Please ask a question to the mailing list instead of reporting an issue. In 
fact you can make use of the Coverage tool to dump you all lines by attaching a 
listener to it.

The only question is how you call the Coverage tool, because it makes only 
sense to do this from within a Java/Scala application.

http://code.google.com/p/apparat/source/browse/apparat-core/src/main/scala/appar
at/tools/coverage/CoverageObserver.scala

http://code.google.com/p/apparat/source/browse/apparat-core/src/main/scala/appar
at/tools/coverage/Coverage.scala

val coverage = new Coverage.CoverageTool()
coverage.addObserver(new CoverageObserver { override def instrument(file: 
String, line: Int) { println("instrument file "+file+" line "+line) } })
coverage.configure(...)
coverage.run()

Original comment by joaebert on 14 Oct 2011 at 10:40