in Sources/SolToBoogieTest/RegressionExecutor.cs [52:130]
public int BatchExecute()
{
string[] filePaths = Directory.GetFiles(testDirectory);
int passedCount = 0;
int failedCount = 0;
ReadRecord();
foreach (string filePath in filePaths)
{
string filename = Path.GetFileName(filePath);
if (!filename.StartsWith(testPrefix))
continue;
//silently ignore non .sol files
if (!filename.EndsWith(".sol"))
continue;
if (!filesToRun.ContainsKey(filename))
{
logger.LogWarning($"{filename} not found in {Path.Combine(recordsDir, "records.txt")}");
continue;
}
if (!filesToRun[filename])
{
continue;
}
logger.LogInformation($"Running {filename}");
BatchExeResult batchExeResult = BatchExeResult.SolcError;
string expectedCorralOutput = "", currentCorralOutput = "";
try
{
batchExeResult = Execute(filename, out expectedCorralOutput, out currentCorralOutput);
}
catch (Exception exception)
{
logger.LogCritical(exception, $"Exception occurred in {filename}");
batchExeResult = BatchExeResult.OtherException;
}
if (batchExeResult == BatchExeResult.Success)
{
++passedCount;
logger.LogInformation($"Passed - {filename}");
}
else if (batchExeResult == BatchExeResult.SolcError)
{
++failedCount;
logger.LogError($"Failed (Solc failed) - {filename}");
}
else if (batchExeResult == BatchExeResult.OtherException)
{
++failedCount;
logger.LogError($"Failed (Other exception) - {filename}");
}
else if (batchExeResult == BatchExeResult.SolToBoogieError)
{
++failedCount;
logger.LogError($"Failed (VeriSol translation error) - {filename}");
}
else if (batchExeResult == BatchExeResult.CorralError)
{
++failedCount;
logger.LogError($"Failed (Corral regression failed) - {filename}");
logger.LogError($"\t Expected - {expectedCorralOutput}");
logger.LogError($"\t Corral detailed Output - {currentCorralOutput}");
}
else
{
++failedCount;
logger.LogError($"Failed (Tool error: unexpected failure code) - {filename}");
}
}
logger.LogInformation($"{passedCount} passed {failedCount} failed");
// To allow time for logging the last summary line:
System.Threading.Thread.Sleep(100);
DeleteTemporaryFiles();
return (failedCount == 0)? 0 : 1;
}