diff options
author | Leonid Logvinov <logvinov.leon@gmail.com> | 2019-01-21 23:32:12 +0800 |
---|---|---|
committer | Leonid Logvinov <logvinov.leon@gmail.com> | 2019-01-21 23:32:12 +0800 |
commit | e5c4390489b02f87a4d497095ea83d0737047afc (patch) | |
tree | 7dc58aed853a38a99a42d589802fba13b183ddea /packages/sol-coverage | |
parent | 61910f264c4671f057f774a415c673f10c09ddb1 (diff) | |
download | dexon-0x-contracts-e5c4390489b02f87a4d497095ea83d0737047afc.tar dexon-0x-contracts-e5c4390489b02f87a4d497095ea83d0737047afc.tar.gz dexon-0x-contracts-e5c4390489b02f87a4d497095ea83d0737047afc.tar.bz2 dexon-0x-contracts-e5c4390489b02f87a4d497095ea83d0737047afc.tar.lz dexon-0x-contracts-e5c4390489b02f87a4d497095ea83d0737047afc.tar.xz dexon-0x-contracts-e5c4390489b02f87a4d497095ea83d0737047afc.tar.zst dexon-0x-contracts-e5c4390489b02f87a4d497095ea83d0737047afc.zip |
Fix a bug when some parts of the profiling report were missing because of the coverage ignore lines
Diffstat (limited to 'packages/sol-coverage')
-rw-r--r-- | packages/sol-coverage/src/coverage_subprovider.ts | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/packages/sol-coverage/src/coverage_subprovider.ts b/packages/sol-coverage/src/coverage_subprovider.ts index d03963ed6..2d92b25ca 100644 --- a/packages/sol-coverage/src/coverage_subprovider.ts +++ b/packages/sol-coverage/src/coverage_subprovider.ts @@ -50,6 +50,8 @@ export class CoverageSubprovider extends TraceInfoSubprovider { } } +const IGNORE_REGEXP = /\/\*\s*solcov\s+ignore\s+next\s*\*\/\s*/gm; + /** * Computed partial coverage for a single file & subtrace. * @param contractData Contract metadata (source, srcMap, bytecode) @@ -65,7 +67,7 @@ export const coverageHandler: SingleFileSubtraceHandler = ( fileIndex: number, ): Coverage => { const absoluteFileName = contractData.sources[fileIndex]; - const coverageEntriesDescription = collectCoverageEntries(contractData.sourceCodes[fileIndex]); + const coverageEntriesDescription = collectCoverageEntries(contractData.sourceCodes[fileIndex], IGNORE_REGEXP); // if the source wasn't provided for the fileIndex, we can't cover the file if (_.isUndefined(coverageEntriesDescription)) { |