Skip to content

Commit 4add0ea

Browse files
committed
Always show logs and diffs in partest when running only individual tests
1 parent 93e257a commit 4add0ea

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/partest/scala/tools/partest/nest/AbstractRunner.scala

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ abstract class AbstractRunner {
2828
verbose = config.optVerbose,
2929
debug = config.optDebug || propOrFalse("partest.debug"),
3030
terse = config.optTerse,
31-
diffOnFail = config.optShowDiff,
32-
logOnFail = config.optShowLog,
3331
colorEnabled = colorEnabled
3432
)
3533

@@ -50,6 +48,8 @@ abstract class AbstractRunner {
5048
private[this] var summarizing = false
5149
private[this] var elapsedMillis = 0L
5250
private[this] var expectedFailures = 0
51+
private[this] var onlyIndividualTests = false
52+
5353

5454
import nestUI._
5555
import nestUI.color._
@@ -170,6 +170,7 @@ abstract class AbstractRunner {
170170
val allTests: Array[Path] = distinctBy(miscTests ++ kindsTests)(_.toCanonical) sortBy (_.toString) toArray
171171
val grouped = (allTests groupBy kindOf).toArray sortBy (x => standardKinds indexOf x._1)
172172

173+
onlyIndividualTests = individualTests.nonEmpty && rerunTests.isEmpty && kindsTests.isEmpty && greppedTests.isEmpty
173174
totalTests = allTests.size
174175
expectedFailures = propOrNone("partest.errors") match {
175176
case Some(num) => num.toInt
@@ -243,7 +244,7 @@ abstract class AbstractRunner {
243244
case t: Throwable => throw new RuntimeException(s"Error running $testFile", t)
244245
}
245246
stopwatchDuration = Some(durationMs)
246-
nestUI.reportTest(state, runner, durationMs)
247+
nestUI.reportTest(state, runner, durationMs, diffOnFail = config.optShowDiff || onlyIndividualTests , logOnFail = config.optShowLog || onlyIndividualTests)
247248
runner.cleanup()
248249
state
249250
}

src/partest/scala/tools/partest/nest/NestUI.scala

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ class Colors(enabled: Boolean) {
2424
}
2525

2626
class NestUI(val verbose: Boolean = false, val debug: Boolean = false, val terse: Boolean = false,
27-
val diffOnFail: Boolean = false, val logOnFail: Boolean = false,
2827
val colorEnabled: Boolean = sys.props contains "partest.colors") {
2928
private[this] val testNum = new java.util.concurrent.atomic.AtomicInteger(1)
3029
@volatile private[this] var testNumberFmt = "%3d"
@@ -67,7 +66,7 @@ class NestUI(val verbose: Boolean = false, val debug: Boolean = false, val terse
6766
f"$word $testNumber - $testIdent%-40s$reasonString$durationString"
6867
}
6968

70-
def reportTest(state: TestState, info: TestInfo, durationMs: Long): Unit = {
69+
def reportTest(state: TestState, info: TestInfo, durationMs: Long, diffOnFail: Boolean, logOnFail: Boolean): Unit = {
7170
if (terse && state.isOk) {
7271
if (dotCount >= DotWidth) {
7372
outline("\n.")

0 commit comments

Comments
 (0)