pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/DelphiCodeCoverage/DelphiCodeCoverage/pull/50/files

githubassets.com/assets/code-34e10031edc15af1.css" /> Fix relative path resolution for -sp and -sd and remove redundant exi… by EricGrange · Pull Request #50 · DelphiCodeCoverage/DelphiCodeCoverage · GitHub
Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 19 additions & 12 deletions Source/CoverageConfiguration.pas
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ TCoverageConfiguration = class(TInterfacedObject, ICoverageConfiguration)
FExcludedUnitsStrLst: TStringList;
FExcludedClassPrefixesStrLst: TStringList;
FExeParamsStrLst: TStrings;
FSourcePathLst: TStrings;
FSourcePathLst: TStringList;
FStripFileExtension: Boolean;
FEmmaOutput: Boolean;
FEmmaOutput21: Boolean;
Expand Down Expand Up @@ -211,6 +211,10 @@ constructor TCoverageConfiguration.Create(const AParameterProvider: IParameterPr
FStripFileExtension := True;

FSourcePathLst := TStringList.Create;
FSourcePathLst.Duplicates := dupIgnore;
FSourcePathLst.Sorted := True;
FSourcePathLst.Sorted := False; // Allow Insert(0, ...) while having duplicates ignored during initial population (though mostly for safety if Add is used later)

FEmmaOutput := False;
FEmmaOutput21 := False;
FSeparateMeta := False;
Expand Down Expand Up @@ -857,8 +861,10 @@ procedure TCoverageConfiguration.ParseSourceDirectorySwitch(var AParameter: Inte
if FSourceDir = '' then
raise EConfigurationException.Create('Expected parameter for source directory');

FSourceDir := MakePathAbsolute(FSourceDir, GetCurrentDir);

// Source Directory should be checked first.
FSourcePathLst.Insert(0, ExpandEnvString(FSourceDir));
FSourcePathLst.Insert(0, FSourceDir);
except
on EParameterIndexException do
raise EConfigurationException.Create('Expected parameter for source directory');
Expand All @@ -868,29 +874,30 @@ procedure TCoverageConfiguration.ParseSourceDirectorySwitch(var AParameter: Inte
procedure TCoverageConfiguration.ParseSourcePathsSwitch(var AParameter: Integer);
var
SourcePathString: string;
AddedPaths: Integer;
begin
Inc(AParameter);
AddedPaths := 0;
try
SourcePathString := ParseParameter(AParameter);

while SourcePathString <> '' do
begin
SourcePathString := MakePathAbsolute(SourcePathString, GetCurrentDir);

if DirectoryExists(SourcePathString) then
FSourcePathLst.Add(SourcePathString);
FSourcePathLst.Add(SourcePathString);
Inc(AddedPaths);

Inc(AParameter);
SourcePathString := ParseParameter(AParameter);
end;

if FSourcePathLst.Count = 0 then
raise EConfigurationException.Create('Expected at least one source path');
if AddedPaths = 0 then
raise EConfigurationException.Create('Expected at least one source path after -sp');

Dec(AParameter);
except
on EParameterIndexException do
raise EConfigurationException.Create('Expected at least one source path');
raise EConfigurationException.Create('Expected at least one source path after -sp');
end;
end;

Expand Down Expand Up @@ -949,7 +956,9 @@ function TCoverageConfiguration.MakePathAbsolute(const APath, ASourceFileName: s
Result := ExpandEnvString(APath);
if TPath.IsRelativePath(Result) then
begin
RootPath := TPath.GetDirectoryName(TPath.GetFullPath(ASourceFileName));
RootPath := TPath.GetFullPath(ASourceFileName);
if not DirectoryExists(RootPath) then
RootPath := TPath.GetDirectoryName(RootPath);
Result := TPath.GetFullPath(TPath.Combine(RootPath, Result));
end;
end;
Expand Down Expand Up @@ -1144,11 +1153,9 @@ procedure TCoverageConfiguration.ParseDGroupProj(const DGroupProjFilename: TFile
ItemGroup: IXMLNode;
Node: IXMLNode;
Project: IXMLNode;
ProjectName, Path, SearchPaths: string;
ProjectName: string;
I: Integer;
RootPath: TFileName;
SourcePath: TFileName;
ExeFileName: TFileName;
begin
RootPath := ExtractFilePath(TPath.GetFullPath(DGroupProjFilename));
Document := TXMLDocument.Create(nil);
Expand Down
pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy