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