Added error handling for missing data files

This commit is contained in:
2024-02-21 20:59:21 +01:00
parent 3f4a64b6e0
commit 824ec0e29b
3 changed files with 27 additions and 5 deletions

View File

@@ -72,9 +72,15 @@ end;
{ TEngineBaseTest }
procedure TEngineBaseTest.Setup;
var
fileName: string;
begin
inherited Setup;
FEngine := TSolverEngine.Create(GetDataPath);
fileName := FEngine.GetDataFileName(FSolver);
AssertTrue('Cannot find puzzle input file ''' + ExpandFileName(fileName) + '''. '
+ 'Please download the file from https://adventofcode.com/2023/',
FileExists(fileName));
FEngine.ProcessData(FSolver);
end;