From e77902663f545c13efe88130926f67b7651c9066 Mon Sep 17 00:00:00 2001 From: Oliver Drobnik Date: Tue, 1 Oct 2013 15:43:29 +0200 Subject: [PATCH] improved coveralls to only look for .m files --- .travis.yml | 2 +- Externals/DTFoundation | 2 +- coveralls.rb | 21 +++++++++++++++++++-- 3 files changed, 21 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4dc70f22d..ef7a47f48 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,4 +9,4 @@ script: - xctool project DTCoreText.xcodeproj -scheme "Mac Framework" test -arch x86_64 ONLY_ACTIVE_ARCH=NO after_success: - - ./coveralls.rb --exclude-folder Demo --exclude-folder Test --exclude-folder Externals --exclude-headers + - ./coveralls.rb --extension m --exclude-folder Demo --exclude-folder Test --exclude-folder Externals diff --git a/Externals/DTFoundation b/Externals/DTFoundation index 688254582..8febeab5c 160000 --- a/Externals/DTFoundation +++ b/Externals/DTFoundation @@ -1 +1 @@ -Subproject commit 6882545821d7071f1663ff8ea3170932745384e8 +Subproject commit 8febeab5cf18e1fb81689290ac80ef2951842be1 diff --git a/coveralls.rb b/coveralls.rb index 775673309..e182aabd6 100755 --- a/coveralls.rb +++ b/coveralls.rb @@ -7,6 +7,7 @@ # arraw of source subfolders to exclude excludedFolders = [] +extensionsToProcess = [] coveralls_cmd = "coveralls" excludeHeaders = false @@ -24,6 +25,11 @@ excludeHeaders = true end +opts.on('-x', '--extension EXT', 'Source file extension to process') do |v| + extensionsToProcess << v + coveralls_cmd.concat(" -x #{v}") +end + opts.on_tail("-?", "--help", "Show this message") do puts opts exit @@ -71,14 +77,20 @@ match = GCOV_SOURCE_PATTERN.match(firstLine) if (match) + source_path = match[1] + puts "source: #{source_path} - #{workingDir}" + if (source_path.start_with? workingDir) # cut off absolute working dir to get relative source path relative_path = source_path.slice(workingDir.length+1, source_path.length) extension = File.extname(relative_path) + extension = extension.slice(1, extension.length-1) + + puts "#{extension}" # get the path components path_comps = relative_path.split(File::SEPARATOR) @@ -89,10 +101,15 @@ if (excludedFolders.include?(path_comps[0])) exclusionMsg = "excluded via option" else - if (excludeHeaders && extension == '.h') + if (excludeHeaders == true && extension == 'h') exclusionMsg = "excluded header" else - shouldProcess = true + if (extensionsToProcess.count == 0 || extensionsToProcess.include?(extension)) + shouldProcess = true + else + exclusionMsg = "excluded extension" + shouldProcess = false + end end end