Skip to content

Commit d514638

Browse files
authored
Merge pull request #2280 from dotty-staging/fix-tests-logs-overwritten
Add seconds to log timestamps to avoid log name clashes.
2 parents 2ccd284 + 5d8a57b commit d514638

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

compiler/test/dotty/tools/dotc/reporting/TestReporter.scala

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,12 @@ object TestReporter {
8484
private[this] var logWriter: PrintWriter = _
8585

8686
private[this] def initLog() = if (logWriter eq null) {
87-
val df = new SimpleDateFormat("yyyy-MM-dd-HH:mm")
88-
val timestamp = df.format(new Date)
89-
new JFile("../testlogs").mkdirs()
90-
outFile = new JFile(s"../testlogs/tests-$timestamp.log")
87+
val date = new Date
88+
val df0 = new SimpleDateFormat("yyyy-MM-dd")
89+
val df1 = new SimpleDateFormat("yyyy-MM-dd-HH:mm:ss")
90+
val folder = s"../testlogs/tests-${df0.format(date)}"
91+
new JFile(folder).mkdirs()
92+
outFile = new JFile(s"$folder/tests-${df1.format(date)}.log")
9193
logWriter = new PrintWriter(new FileOutputStream(outFile, true))
9294
}
9395

0 commit comments

Comments
 (0)