From 43cc30afe0fe887bfbf4e89dfb91c1f43e4b8d4d Mon Sep 17 00:00:00 2001 From: Ao Li Date: Thu, 25 Jul 2024 23:42:10 -0400 Subject: [PATCH] update. --- core/src/main/kotlin/cmu/pasta/fray/core/TestRunner.kt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/core/src/main/kotlin/cmu/pasta/fray/core/TestRunner.kt b/core/src/main/kotlin/cmu/pasta/fray/core/TestRunner.kt index 73a2e1d..bc7d038 100644 --- a/core/src/main/kotlin/cmu/pasta/fray/core/TestRunner.kt +++ b/core/src/main/kotlin/cmu/pasta/fray/core/TestRunner.kt @@ -33,11 +33,12 @@ class TestRunner(val config: Configuration) { config.executionInfo.executor.execute() } else { setup() + val outputFile = Paths.get(config.report, "output.txt").toFile() val timeSource = TimeSource.Monotonic val start = timeSource.markNow() var i = 0 while (i != config.iter) { - println("Starting iteration $i") + outputFile.appendText("Starting iteration $i\n") try { Runtime.DELEGATE = RuntimeDelegate() Runtime.start() @@ -48,8 +49,8 @@ class TestRunner(val config: Configuration) { Runtime.onMainExit() } if (GlobalContext.bugFound) { - println( - "Error found at iter: $i, Elapsed time: ${(timeSource.markNow() - start).inWholeMilliseconds}ms") + outputFile.appendText( + "Error found at iter: $i, Elapsed time: ${(timeSource.markNow() - start).inWholeMilliseconds}ms\n") if (!config.exploreMode) { break }