From 9001ff985730f5714c2992a43f66e90c9be4a6f6 Mon Sep 17 00:00:00 2001 From: Basile Burg Date: Tue, 5 Feb 2019 17:52:34 +0100 Subject: [PATCH] fix #442 - coverage file not found after unit testing a module --- src/u_main.pas | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/u_main.pas b/src/u_main.pas index e9be26b2..1a7a431a 100644 --- a/src/u_main.pas +++ b/src/u_main.pas @@ -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;