Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

improved coveralls to only look for .m files

  • Loading branch information...
commit 8febeab5cf18e1fb81689290ac80ef2951842be1 1 parent 5be3e23
@Cocoanetics authored
Showing with 21 additions and 4 deletions.
  1. +1 −1  .travis.yml
  2. +20 −3 coveralls.rb
View
2  .travis.yml
@@ -8,4 +8,4 @@ script:
- xctool -project DTFoundation.xcodeproj -scheme "Static Library" build test -sdk iphonesimulator 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
View
23 coveralls.rb
@@ -7,7 +7,8 @@
# arraw of source subfolders to exclude
excludedFolders = []
-coveralls_cmd = "coveralls -x m"
+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

0 comments on commit 8febeab

Please sign in to comment.
Something went wrong with that request. Please try again.