This repository was archived by the owner on Sep 8, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +33
-13
lines changed
src/main/scala/scala/tools/partest/nest Expand file tree Collapse file tree 2 files changed +33
-13
lines changed Original file line number Diff line number Diff line change @@ -73,35 +73,28 @@ object NestUI {
7373 f " $word $testNumber - $testIdent%-40s $reasonString"
7474 }
7575
76- def reportTest (state : TestState ) = {
76+ def reportTest (state : TestState , info : TestInfo ) = {
7777 if (isTerse && state.isOk) {
7878 if (dotCount >= DotWidth ) {
7979 outline(" \n ." )
8080 dotCount = 1
81- }
82- else {
81+ } else {
8382 outline(" ." )
8483 dotCount += 1
8584 }
86- }
87- else {
85+ } else {
8886 echo(statusLine(state))
8987 if (! state.isOk) {
9088 if (isDiffy) {
9189 val differ = bold(red(" % " )) + " diff "
9290 state.transcript find (_ startsWith differ) foreach (echo(_))
9391 }
9492 if (isLogging) {
95- import scala .util .matching .Regex
9693 def log (f : File ) = {
9794 echo(bold(cyan(s " ##### Log file ' $f' from failed test ##### \n " )))
9895 echo(f.fileContents)
9996 }
100- val prompt = bold(red(" % " ))
101- val differ = raw " (?s) ${Regex .quote(prompt)}diff (\S*).* " .r
102- state.transcript.collect {
103- case differ(f) => f
104- } foreach (log(_))
97+ if (info.logFile.canRead) log(info.logFile)
10598 }
10699 }
107100 }
Original file line number Diff line number Diff line change @@ -42,8 +42,35 @@ class TestTranscript {
4242 }
4343}
4444
45+ trait TestInfo {
46+ /** pos/t1234 */
47+ def testIdent : String
48+
49+ /** pos */
50+ def kind : String
51+
52+ // inputs
53+
54+ /** pos/t1234.scala or pos/t1234 if dir */
55+ def testFile : File
56+
57+ /** pos/t1234.check */
58+ def checkFile : File
59+
60+ /** pos/t1234.flags */
61+ def flagsFile : File
62+
63+ // outputs
64+
65+ /** pos/t1234-pos.obj */
66+ def outFile : File
67+
68+ /** pos/t1234-pos.log */
69+ def logFile : File
70+ }
71+
4572/** Run a single test. Rubber meets road. */
46- class Runner (val testFile : File , val suiteRunner : SuiteRunner ) {
73+ class Runner (val testFile : File , val suiteRunner : SuiteRunner ) extends TestInfo {
4774
4875 import suiteRunner .{fileManager => fm , _ }
4976 val fileManager = fm
@@ -802,7 +829,7 @@ class SuiteRunner(
802829 catch {
803830 case t : Throwable => throw new RuntimeException (s " Error running $testFile" , t)
804831 }
805- NestUI .reportTest(state)
832+ NestUI .reportTest(state, runner )
806833 runner.cleanup()
807834 state
808835 }
You can’t perform that action at this time.
0 commit comments