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.44.0.beta.20170630010021 scan/lib/scan/test_result_parser.rb
fastlane-2.43.0 scan/lib/scan/test_result_parser.rb
fastlane-2.43.0.beta.20170629010015 scan/lib/scan/test_result_parser.rb
fastlane-2.42.0 scan/lib/scan/test_result_parser.rb
fastlane-2.42.0.beta.20170628010031 scan/lib/scan/test_result_parser.rb
fastlane-2.42.0.beta.20170627010007 scan/lib/scan/test_result_parser.rb
fastlane-2.42.0.beta.20170626010017 scan/lib/scan/test_result_parser.rb
fastlane-2.42.0.beta.20170625010032 scan/lib/scan/test_result_parser.rb
fastlane-2.42.0.beta.20170624010047 scan/lib/scan/test_result_parser.rb
fastlane-2.41.0 scan/lib/scan/test_result_parser.rb
fastlane-2.41.0.beta.20170623010027 scan/lib/scan/test_result_parser.rb
fastlane-2.40.0 scan/lib/scan/test_result_parser.rb
fastlane-2.40.0.beta.20170622010014 scan/lib/scan/test_result_parser.rb
fastlane-2.40.0.beta.20170621010038 scan/lib/scan/test_result_parser.rb
fastlane-2.40.0.beta.20170620010029 scan/lib/scan/test_result_parser.rb
fastlane-2.39.2 scan/lib/scan/test_result_parser.rb
fastlane-2.40.0.beta.20170619010029 scan/lib/scan/test_result_parser.rb
fastlane-2.40.0.beta.20170618010039 scan/lib/scan/test_result_parser.rb
fastlane-2.40.0.beta.20170617010037 scan/lib/scan/test_result_parser.rb
fastlane-2.39.1 scan/lib/scan/test_result_parser.rb