Skip to content

Commit 1c96001

Browse files
committed
no debug
1 parent 185b650 commit 1c96001

File tree

3 files changed

+5
-38
lines changed

3 files changed

+5
-38
lines changed

src/coverlet.core/Abstractions/ISourceRootTranslator.cs

-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,5 @@ internal interface ISourceRootTranslator
1212
string ResolveFilePath(string originalFileName);
1313
string ResolveDeterministicPath(string originalFileName);
1414
IReadOnlyList<SourceRootMapping> ResolvePathRoot(string pathRoot);
15-
16-
Dictionary<string, List<SourceRootMapping>> SourceRootMapping { get; }
1715
}
1816
}

src/coverlet.core/Helpers/InstrumentationHelper.cs

+5-31
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ private bool MatchDocumentsWithSources(string module, AssemblySearchType exclude
187187
{
188188
if (excludeAssembliesWithoutSources.Equals(AssemblySearchType.MissingAll))
189189
{
190-
bool anyDocumentMatches = MatchDocumentsWithSourcesMissingAll(metadataReader, module);
190+
bool anyDocumentMatches = MatchDocumentsWithSourcesMissingAll(metadataReader);
191191

192192
if (!anyDocumentMatches)
193193
{
@@ -211,45 +211,19 @@ private bool MatchDocumentsWithSources(string module, AssemblySearchType exclude
211211
return true;
212212
}
213213

214-
private IEnumerable<(string documentName, bool documentExists)> DocumentSourceMap(MetadataReader metadataReader, string module = "")
214+
private IEnumerable<(string documentName, bool documentExists)> DocumentSourceMap(MetadataReader metadataReader)
215215
{
216-
var foo = metadataReader.Documents.Select(docHandle =>
216+
return metadataReader.Documents.Select(docHandle =>
217217
{
218218
Document document = metadataReader.GetDocument(docHandle);
219219
string docName = _sourceRootTranslator.ResolveFilePath(metadataReader.GetString(document.Name));
220220
return (docName, _fileSystem.Exists(docName));
221221
});
222-
223-
var baa = metadataReader.Documents.Select(docHandle =>
224-
{
225-
Document document = metadataReader.GetDocument(docHandle);
226-
string docName = _sourceRootTranslator.ResolveFilePath(metadataReader.GetString(document.Name));
227-
return (docName, metadataReader.GetString(document.Name));
228-
});
229-
230-
if (module.Contains("coverlet.tests.projectsample.empty"))
231-
{
232-
//throw new Exception(string.Join(Environment.NewLine,
233-
// baa.Select(x =>
234-
// $"Translator.Name: {x.docName}{Environment.NewLine}MetaData.Name: {x.Item2}{Environment.NewLine}Exists: {_fileSystem.Exists(x.docName)}{Environment.NewLine}SourceRoot: {_sourceRootTranslator.SourceRootMapping.Count}")));
235-
236-
throw new Exception(string.Join(Environment.NewLine,
237-
new string[]
238-
{
239-
$"Translator.Name: {baa.First().docName}",
240-
$"MetaData.Name: {baa.First().Item2}",
241-
$"Exists: {_fileSystem.Exists(baa.First().docName)}"
242-
}.Concat(_sourceRootTranslator.SourceRootMapping.Values.SelectMany(x => x.Select(y => $"ProjectPath: {y.ProjectPath}{Environment.NewLine}OrigPath: {y.OriginalPath}")))));
243-
244-
}
245-
246-
247-
return foo;
248222
}
249223

250-
private bool MatchDocumentsWithSourcesMissingAll(MetadataReader metadataReader, string module = "")
224+
private bool MatchDocumentsWithSourcesMissingAll(MetadataReader metadataReader)
251225
{
252-
return DocumentSourceMap(metadataReader, module).Any(x => x.documentExists);
226+
return DocumentSourceMap(metadataReader).Any(x => x.documentExists);
253227
}
254228

255229
private (bool allDocumentsMatch, string notFoundDocument) MatchDocumentsWithSourcesMissingAny(

src/coverlet.core/Instrumentation/Instrumenter.cs

-5
Original file line numberDiff line numberDiff line change
@@ -127,11 +127,6 @@ public bool CanInstrument()
127127
}
128128
catch (Exception ex)
129129
{
130-
if (_module.Contains("coverlet.tests.projectsample.empty"))
131-
{
132-
throw new Exception("EXCEPTION", ex);
133-
}
134-
135130
_logger.LogWarning($"Unable to instrument module: '{_module}'\n{ex}");
136131
return false;
137132
}

0 commit comments

Comments
 (0)