Sha256: 9d7f06ac3d8611be92bc45595dcd2c53fc23291a8f1c5c50e5fec04d24242b2c

Contents?: true

Size: 630 Bytes

Versions: 288

Compression:

Stored size: 630 Bytes

Contents

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

288 entries across 288 versions & 1 rubygems

Version Path
fastlane-2.60.0.beta.20171003010003 scan/lib/scan/test_result_parser.rb
fastlane-2.60.0.beta.20171002010004 scan/lib/scan/test_result_parser.rb
fastlane-2.60.0.beta.20171001010003 scan/lib/scan/test_result_parser.rb
fastlane-2.60.0.beta.20170930010003 scan/lib/scan/test_result_parser.rb
fastlane-2.60.0.beta.20170929010003 scan/lib/scan/test_result_parser.rb
fastlane-2.60.0.beta.20170928010003 scan/lib/scan/test_result_parser.rb
fastlane-2.60.0.beta.20170927010003 scan/lib/scan/test_result_parser.rb
fastlane-2.60.0.beta.20170926010004 scan/lib/scan/test_result_parser.rb
fastlane-2.59.0 scan/lib/scan/test_result_parser.rb
fastlane-2.59.0.beta.20170925010002 scan/lib/scan/test_result_parser.rb
fastlane-2.59.0.beta.20170924010003 scan/lib/scan/test_result_parser.rb
fastlane-2.59.0.beta.20170923010003 scan/lib/scan/test_result_parser.rb
fastlane-2.59.0.beta.20170922010003 scan/lib/scan/test_result_parser.rb
fastlane-2.59.0.beta.20170921010003 scan/lib/scan/test_result_parser.rb
fastlane-2.58.0 scan/lib/scan/test_result_parser.rb
fastlane-2.58.0.beta.20170920010003 scan/lib/scan/test_result_parser.rb
fastlane-2.57.2 scan/lib/scan/test_result_parser.rb
fastlane-2.57.1 scan/lib/scan/test_result_parser.rb
fastlane-2.58.0.beta.20170919010003 scan/lib/scan/test_result_parser.rb
fastlane-2.57.0 scan/lib/scan/test_result_parser.rb