@@ -205,12 +205,12 @@ trait ParallelTesting extends RunnerOrchestration { self =>
205
205
private [this ] var _errorCount = 0
206
206
def errorCount : Int = _errorCount
207
207
208
- private [this ] var _testSourcesCompiled = 0
209
- private def testSourcesCompiled : Int = _testSourcesCompiled
208
+ private [this ] var _testSourcesCompleted = 0
209
+ private def testSourcesCompleted : Int = _testSourcesCompleted
210
210
211
211
/** Complete the current compilation with the amount of errors encountered */
212
- protected final def registerCompilation (errors : Int ) = synchronized {
213
- _testSourcesCompiled += 1
212
+ protected final def registerCompletion (errors : Int ) = synchronized {
213
+ _testSourcesCompleted += 1
214
214
_errorCount += errors
215
215
}
216
216
@@ -249,7 +249,7 @@ trait ParallelTesting extends RunnerOrchestration { self =>
249
249
private def createProgressMonitor : Runnable = new Runnable {
250
250
def run (): Unit = {
251
251
val start = System .currentTimeMillis
252
- var tCompiled = testSourcesCompiled
252
+ var tCompiled = testSourcesCompleted
253
253
while (tCompiled < sourceCount) {
254
254
val timestamp = (System .currentTimeMillis - start) / 1000
255
255
val progress = (tCompiled.toDouble / sourceCount * 40 ).toInt
@@ -258,15 +258,15 @@ trait ParallelTesting extends RunnerOrchestration { self =>
258
258
" [" + (" =" * (math.max(progress - 1 , 0 ))) +
259
259
(if (progress > 0 ) " >" else " " ) +
260
260
(" " * (39 - progress)) +
261
- s " ] compiling ( $tCompiled/ $sourceCount, ${timestamp}s) \r "
261
+ s " ] completed ( $tCompiled/ $sourceCount, ${timestamp}s) \r "
262
262
)
263
263
264
264
Thread .sleep(100 )
265
- tCompiled = testSourcesCompiled
265
+ tCompiled = testSourcesCompleted
266
266
}
267
267
// println, otherwise no newline and cursor at start of line
268
268
realStdout.println(
269
- s " [=======================================] compiled ( $sourceCount/ $sourceCount, " +
269
+ s " [=======================================] completed ( $sourceCount/ $sourceCount, " +
270
270
s " ${(System .currentTimeMillis - start) / 1000 }s) "
271
271
)
272
272
}
@@ -285,7 +285,7 @@ trait ParallelTesting extends RunnerOrchestration { self =>
285
285
// run should fail
286
286
failTestSource(testSource)
287
287
e.printStackTrace()
288
- registerCompilation (1 )
288
+ registerCompletion (1 )
289
289
throw e
290
290
}
291
291
}
@@ -350,7 +350,7 @@ trait ParallelTesting extends RunnerOrchestration { self =>
350
350
}
351
351
352
352
private [ParallelTesting ] def executeTestSuite (): this .type = {
353
- assert(_testSourcesCompiled == 0 , " not allowed to re-use a `CompileRun`" )
353
+ assert(_testSourcesCompleted == 0 , " not allowed to re-use a `CompileRun`" )
354
354
355
355
if (filteredSources.nonEmpty) {
356
356
val pool = threadLimit match {
@@ -396,7 +396,7 @@ trait ParallelTesting extends RunnerOrchestration { self =>
396
396
testSource match {
397
397
case testSource @ JointCompilationSource (_, files, flags, outDir) => {
398
398
val reporter = compile(testSource.sourceFiles, flags, false , outDir)
399
- registerCompilation (reporter.errorCount)
399
+ registerCompletion (reporter.errorCount)
400
400
401
401
if (reporter.errorCount > 0 )
402
402
echoBuildInstructions(reporter, testSource, reporter.errorCount, reporter.warningCount)
@@ -413,7 +413,7 @@ trait ParallelTesting extends RunnerOrchestration { self =>
413
413
414
414
def warningCount = reporters.foldLeft(0 )(_ + _.warningCount)
415
415
416
- registerCompilation (errorCount)
416
+ registerCompletion (errorCount)
417
417
418
418
if (errorCount > 0 )
419
419
echoBuildInstructions(reporters.head, testSource, errorCount, warningCount)
@@ -487,7 +487,6 @@ trait ParallelTesting extends RunnerOrchestration { self =>
487
487
if (reporter.errorCount > 0 )
488
488
echoBuildInstructions(reporter, testSource, reporter.errorCount, reporter.warningCount)
489
489
490
- registerCompilation(reporter.errorCount)
491
490
(reporter.errorCount, reporter.warningCount, checkFile.isDefined, () => verifyOutput(checkFile.get, outDir, testSource, reporter.warningCount))
492
491
}
493
492
@@ -506,28 +505,33 @@ trait ParallelTesting extends RunnerOrchestration { self =>
506
505
507
506
if (errorCount > 0 ) fail()
508
507
509
- registerCompilation(errorCount)
510
508
(errorCount, warningCount, checkFile.exists, () => verifyOutput(checkFile, outDir, testSource, warningCount))
511
509
}
512
510
}
513
511
514
512
if (errorCount == 0 && hasCheckFile) verifier()
515
513
else if (errorCount == 0 ) runMain(testSource.classPath) match {
516
- case Success (_) => // success!
517
- case Failure (output) =>
518
- echo(s " failed when running ' ${testSource.title}' " )
519
- echo(output)
520
- failTestSource(testSource)
521
- case Timeout =>
522
- echo(" failed because test " + testSource.title + " timed out" )
523
- failTestSource(testSource, Some (" test timed out" ))
524
- }
514
+ case Success (_) => // success!
515
+ case Failure (output) =>
516
+ echo(s " failed when running ' ${testSource.title}' " )
517
+ echo(output)
518
+ failTestSource(testSource)
519
+ case Timeout =>
520
+ echo(" failed because test " + testSource.title + " timed out" )
521
+ failTestSource(testSource, Some (" test timed out" ))
522
+ }
525
523
else if (errorCount > 0 ) {
526
524
echo(s " \n Compilation failed for: ' $testSource' " )
527
525
val buildInstr = testSource.buildInstructions(errorCount, warningCount)
528
526
addFailureInstruction(buildInstr)
529
527
failTestSource(testSource)
530
528
}
529
+ else {
530
+ realStdout.println(" Got a super weird error that I haven't handled yet" )
531
+ realStdout.println(" errorCount: " + errorCount)
532
+ realStdout.println(" test: " + testSource.title + " " + testSource.name)
533
+ }
534
+ registerCompletion(errorCount)
531
535
}
532
536
}
533
537
}
@@ -626,7 +630,7 @@ trait ParallelTesting extends RunnerOrchestration { self =>
626
630
failTestSource(testSource)
627
631
}
628
632
629
- registerCompilation (actualErrors)
633
+ registerCompletion (actualErrors)
630
634
}
631
635
}
632
636
}
0 commit comments