Skip to content

Commit bf681b0

Browse files
author
Christine Zhou
committed
Fix logs path missing in console output
vv
1 parent a3b2d93 commit bf681b0

File tree

6 files changed

+28
-131
lines changed

6 files changed

+28
-131
lines changed

Src/PChecker/CheckerCore/SystematicTesting/TestReport.cs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -241,12 +241,13 @@ public string GetText(CheckerConfiguration checkerConfiguration, string prefix =
241241
totalExploredSchedules,
242242
totalExploredSchedules == 1 ? string.Empty : "s");
243243

244-
report.AppendLine();
245-
report.AppendFormat(
246-
"{0} Explored {1} timeline{2}",
247-
prefix.Equals("...") ? "....." : prefix,
248-
ExploredTimelines.Count,
249-
ExploredTimelines.Count == 1 ? string.Empty : "s");
244+
// Comment out this part until feedback strategy error is fixed
245+
// report.AppendLine();
246+
// report.AppendFormat(
247+
// "{0} Explored {1} timeline{2}",
248+
// prefix.Equals("...") ? "....." : prefix,
249+
// ExploredTimelines.Count,
250+
// ExploredTimelines.Count == 1 ? string.Empty : "s");
250251

251252
if (totalExploredSchedules > 0 &&
252253
NumOfFoundBugs > 0)

Src/PChecker/CheckerCore/SystematicTesting/TestingEngine.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -629,10 +629,6 @@ private void RunNextIteration(int schedule)
629629
}
630630

631631
ConstructReproducableTrace(runtime);
632-
if (_checkerConfiguration.OutputDirectory != null)
633-
{
634-
TryEmitTraces(_checkerConfiguration.OutputDirectory, "trace_0");
635-
}
636632
}
637633
}
638634
finally

Src/PChecker/CheckerCore/Testing/TestingProcess.cs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,13 @@ private async Task RunAsync()
8787
Console.WriteLine($"Checker found a bug.");
8888
}
8989

90+
// we want the graph generation even if doing full exploration.
91+
if ((!_checkerConfiguration.PerformFullExploration && TestingEngine.TestReport.NumOfFoundBugs > 0) ||
92+
(_checkerConfiguration.IsDgmlGraphEnabled && !_checkerConfiguration.IsDgmlBugGraph))
93+
{
94+
await EmitTraces();
95+
}
96+
9097
// Closes the remote notification listener.
9198
if (_checkerConfiguration.IsVerbose)
9299
{
@@ -115,6 +122,19 @@ private TestingProcess(CheckerConfiguration checkerConfiguration)
115122
IsProcessCanceled = false;
116123
}
117124

125+
/// <summary>
126+
/// Emits the testing traces.
127+
/// </summary>
128+
private Task EmitTraces()
129+
{
130+
var file = Path.GetFileNameWithoutExtension(_checkerConfiguration.AssemblyToBeAnalyzed);
131+
file += "_" + _checkerConfiguration.TestingProcessId;
132+
133+
Console.WriteLine($"... Emitting traces:");
134+
TestingEngine.TryEmitTraces(_checkerConfiguration.OutputDirectory, file);
135+
return Task.CompletedTask;
136+
}
137+
118138
/// <summary>
119139
/// Emits the test report.
120140
/// </summary>

Tst/CorrectLogs/bugs2/trace_0_0.trace.json

Lines changed: 0 additions & 103 deletions
This file was deleted.

Tst/CorrectLogs/bugs2/trace_0_0.txt

Lines changed: 0 additions & 17 deletions
This file was deleted.

Tst/UnitTests/PCheckerLogGeneratorTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ private void AssertLog(string generatedDir, string expectedDir)
4747
string generatedFilePath = Path.Combine(generatedDir, fileName);
4848
string expectedFilePath = Path.Combine(expectedDir, fileName);
4949

50-
if (fileName == "trace_0_0.trace.json")
50+
if (fileName == "Main_0_0.trace.json")
5151
{
5252
// Perform "Is JSON Included" check for this specific file
5353
if (!IsJsonContentIncluded(generatedFilePath, expectedFilePath))

0 commit comments

Comments
 (0)