Sha256: dd01e967c1142394db1397e4d84f7dd182959f6a3b59d560b2d17d4f031734de

Contents?: true

Size: 657 Bytes

Versions: 85

Compression:

Stored size: 657 Bytes

Contents

require_relative 'module'

module Scan
  class TestResultParser
    def parse_result(output)
      # e.g. ...<testsuites tests='2' failures='1'>...
      matched = output.scan(/<testsuites\b(?=[^<>]*\s+tests='(\d+)')(?=[^<>]*\s+failures='(\d+)')[^<>]+>/)

      if matched and matched.length == 1 and matched[0].length == 2
        tests = matched[0][0].to_i
        failures = matched[0][1].to_i

        return {
          tests: tests,
          failures: failures
        }
      else
        UI.error("Couldn't parse the number of tests from the output")
        return {
          tests: 0,
          failures: 0
        }
      end
    end
  end
end

Version data entries

85 entries across 85 versions & 1 rubygems

Version Path
fastlane-2.86.0.beta.20180316050051 scan/lib/scan/test_result_parser.rb
fastlane-2.86.0.beta.20180315050105 scan/lib/scan/test_result_parser.rb
fastlane-2.86.0.beta.20180314050053 scan/lib/scan/test_result_parser.rb
fastlane-2.86.0.beta.20180313050023 scan/lib/scan/test_result_parser.rb
fastlane-2.86.0.beta.20180312050111 scan/lib/scan/test_result_parser.rb
fastlane-2.86.0.beta.20180311050103 scan/lib/scan/test_result_parser.rb
fastlane-2.86.0.beta.20180310050010 scan/lib/scan/test_result_parser.rb
fastlane-2.86.0.beta.20180309050025 scan/lib/scan/test_result_parser.rb
fastlane-2.85.0 scan/lib/scan/test_result_parser.rb
fastlane-2.85.0.beta.20180308050114 scan/lib/scan/test_result_parser.rb
fastlane-2.85.0.beta.20180307050101 scan/lib/scan/test_result_parser.rb
fastlane-2.85.0.beta.20180306050019 scan/lib/scan/test_result_parser.rb
fastlane-2.85.0.beta.20180305050037 scan/lib/scan/test_result_parser.rb
fastlane-2.85.0.beta.20180304050031 scan/lib/scan/test_result_parser.rb
fastlane-2.85.0.beta.20180303050048 scan/lib/scan/test_result_parser.rb
fastlane-2.85.0.beta.20180302050035 scan/lib/scan/test_result_parser.rb
fastlane-2.84.0 scan/lib/scan/test_result_parser.rb
fastlane-2.84.0.beta.20180301050048 scan/lib/scan/test_result_parser.rb
fastlane-2.84.0.beta.20180228050122 scan/lib/scan/test_result_parser.rb
fastlane-2.84.0.beta.20180227050054 scan/lib/scan/test_result_parser.rb