aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelix Mulder <felix.mulder@gmail.com>2017-04-20 14:03:56 +0200
committerGitHub <noreply@github.com>2017-04-20 14:03:56 +0200
commitd5146387bfd7b3922983290a3c7d560c70045c06 (patch)
treed75219533920e9d830b2e333fcd159b394d71e2e
parent2ccd284da902cd49e013f5237a28c717e50d81e1 (diff)
parent5d8a57b0fec1b1ab53361d36beb3be01b78b1d08 (diff)
downloaddotty-master.zip
dotty-master.tar.gz
dotty-master.tar.bz2
Merge pull request #2280 from dotty-staging/fix-tests-logs-overwrittenHEADmaster
Add seconds to log timestamps to avoid log name clashes.
-rw-r--r--compiler/test/dotty/tools/dotc/reporting/TestReporter.scala10
1 files changed, 6 insertions, 4 deletions
diff --git a/compiler/test/dotty/tools/dotc/reporting/TestReporter.scala b/compiler/test/dotty/tools/dotc/reporting/TestReporter.scala
index d07d31c..664526c 100644
--- a/compiler/test/dotty/tools/dotc/reporting/TestReporter.scala
+++ b/compiler/test/dotty/tools/dotc/reporting/TestReporter.scala
@@ -84,10 +84,12 @@ object TestReporter {
private[this] var logWriter: PrintWriter = _
private[this] def initLog() = if (logWriter eq null) {
- val df = new SimpleDateFormat("yyyy-MM-dd-HH:mm")
- val timestamp = df.format(new Date)
- new JFile("../testlogs").mkdirs()
- outFile = new JFile(s"../testlogs/tests-$timestamp.log")
+ val date = new Date
+ val df0 = new SimpleDateFormat("yyyy-MM-dd")
+ val df1 = new SimpleDateFormat("yyyy-MM-dd-HH:mm:ss")
+ val folder = s"../testlogs/tests-${df0.format(date)}"
+ new JFile(folder).mkdirs()
+ outFile = new JFile(s"$folder/tests-${df1.format(date)}.log")
logWriter = new PrintWriter(new FileOutputStream(outFile, true))
}