@@ -82,19 +82,19 @@ class ScoverageInstrumentationComponent(val global: Global)
82
82
override def newPhase (prev : scala.tools.nsc.Phase ): Phase = new Phase (prev) {
83
83
84
84
override def run (): Unit = {
85
- println (s " [info] Cleaning datadir [ ${options.dataDir}] " )
85
+ reporter.echo (s " [info] Cleaning datadir [ ${options.dataDir}] " )
86
86
// we clean the data directory, because if the code has changed, then the number / order of
87
87
// statements has changed by definition. So the old data would reference statements incorrectly
88
88
// and thus skew the results.
89
89
IOUtils .clean(options.dataDir)
90
90
91
- println (" [info] Beginning coverage instrumentation" )
91
+ reporter.echo (" [info] Beginning coverage instrumentation" )
92
92
super .run()
93
- println (s " [info] Instrumentation completed [ ${coverage.statements.size} statements] " )
93
+ reporter.echo (s " [info] Instrumentation completed [ ${coverage.statements.size} statements] " )
94
94
95
95
Serializer .serialize(coverage, Serializer .coverageFile(options.dataDir))
96
- println (s " [info] Wrote instrumentation file [ ${Serializer .coverageFile(options.dataDir)}] " )
97
- println (s " [info] Will write measurement data to [ ${options.dataDir}] " )
96
+ reporter.echo (s " [info] Wrote instrumentation file [ ${Serializer .coverageFile(options.dataDir)}] " )
97
+ reporter.echo (s " [info] Will write measurement data to [ ${options.dataDir}] " )
98
98
}
99
99
}
100
100
@@ -163,7 +163,7 @@ class ScoverageInstrumentationComponent(val global: Global)
163
163
def instrument (tree : Tree , original : Tree , branch : Boolean = false ): Tree = {
164
164
safeSource(tree) match {
165
165
case None =>
166
- println (s " [warn] Could not instrument [ ${tree.getClass.getSimpleName}/ ${tree.symbol}]. No pos. " )
166
+ reporter.echo (s " [warn] Could not instrument [ ${tree.getClass.getSimpleName}/ ${tree.symbol}]. No pos. " )
167
167
tree
168
168
case Some (source) =>
169
169
if (tree.pos.isDefined && ! isStatementIncluded(tree.pos)) {
@@ -198,7 +198,7 @@ class ScoverageInstrumentationComponent(val global: Global)
198
198
def updateLocation (t : Tree ) {
199
199
Location (global)(t) match {
200
200
case Some (loc) => this .location = loc
201
- case _ => println( s " [warn] Cannot update location for $t" )
201
+ case _ => reporter.warning(t.pos, s " [warn] Cannot update location for $t" )
202
202
}
203
203
}
204
204
@@ -218,7 +218,7 @@ class ScoverageInstrumentationComponent(val global: Global)
218
218
)
219
219
)
220
220
case _ =>
221
- println( " Cannot instrument partial function apply. Please file bug report" )
221
+ reporter.error(c.pos , " Cannot instrument partial function apply. Please file bug report" )
222
222
d
223
223
}
224
224
case other => other
@@ -229,7 +229,7 @@ class ScoverageInstrumentationComponent(val global: Global)
229
229
230
230
def debug (t : Tree ) {
231
231
import scala .reflect .runtime .{universe => u }
232
- println (t.getClass.getSimpleName + " : LINE " + safeLine(t) + " : " + u.showRaw(t))
232
+ reporter.echo (t.getClass.getSimpleName + " : LINE " + safeLine(t) + " : " + u.showRaw(t))
233
233
}
234
234
235
235
def traverseApplication (t : Tree ): Tree = {
@@ -593,7 +593,7 @@ class ScoverageInstrumentationComponent(val global: Global)
593
593
treeCopy.ValDef (tree, v.mods, v.name, v.tpt, process(v.rhs))
594
594
595
595
case _ =>
596
- println( " BUG: Unexpected construct: " + tree.getClass + " " + tree.symbol)
596
+ reporter.warning(tree.pos, " BUG: Unexpected construct: " + tree.getClass + " " + tree.symbol)
597
597
super .transform(tree)
598
598
}
599
599
}
0 commit comments