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