aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/convertLcovToCoveralls.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/convertLcovToCoveralls.js b/lib/convertLcovToCoveralls.js
index e925343..68687bd 100644
--- a/lib/convertLcovToCoveralls.js
+++ b/lib/convertLcovToCoveralls.js
@@ -23,6 +23,16 @@ var convertLcovFileObject = function(file, filepath){
coverage : coverage };
};
+var cleanFilePath = function(file) {
+ if (file.indexOf('!') > -1) {
+ var regex = /^(.*!)(.*)$/g;
+ var matches = regex.exec(file);
+ return matches[matches.length-1];
+ }
+
+ return file;
+};
+
var convertLcovToCoveralls = function(input, options, cb){
var filepath = options.filepath || '';
logger.debug("in: ", filepath);
@@ -61,6 +71,7 @@ var convertLcovToCoveralls = function(input, options, cb){
postJson.service_pull_request = options.service_pull_request;
}
parsed.forEach(function(file){
+ file.file = cleanFilePath(file.file);
var currentFilePath = path.resolve(filepath, file.file);
if (fs.existsSync(currentFilePath)) {
postJson.source_files.push(convertLcovFileObject(file, filepath));