fix #442 - coverage file not found after unit testing a module

This commit is contained in:
Basile Burg 2019-02-05 17:52:34 +01:00
parent ae7d8050b0
commit 9001ff9857
1 changed files with 7 additions and 1 deletions

View File

@ -3252,6 +3252,7 @@ var
fname, covname: string;
lst: TStringList;
i: integer;
r: string = '';
const
ic : array[boolean] of TAppMessageKind = (amkWarn, amkInf);
begin
@ -3264,6 +3265,11 @@ begin
{$IFDEF WINDOWS}
covname := ReplaceStr(covname, DriveSeparator, '-');
{$ENDIF}
if not covname.fileExists then
begin
r := fRunProc.Executable.extractFilePath;
covname := r + covname;
end;
if covname.fileExists then
begin
lst := TStringList.Create;
@ -3277,7 +3283,7 @@ begin
fullcov := false;
end;
sysutils.DeleteFile(covname);
sysutils.DeleteFile('__main.lst');
sysutils.DeleteFile(r + '__main.lst');
fMsgs.message(lst[lst.Count-1], fDoc, amcEdit, ic[fullcov]);
finally
lst.free;