Sha256: a5fb44017bf665a1bbd280921432446da01952f0aca6232601f7cfa102f6819e

Contents?: true

Size: 655 Bytes

Versions: 447

Compression:

Stored size: 655 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 && matched.length == 1 && 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

447 entries across 447 versions & 2 rubygems

Version Path
fastlane-2.130.0.beta.20190824200021 scan/lib/scan/test_result_parser.rb
fastlane-2.130.0.beta.20190823200017 scan/lib/scan/test_result_parser.rb
fastlane-2.130.0.beta.20190822200101 scan/lib/scan/test_result_parser.rb
fastlane-2.130.0.beta.20190821200034 scan/lib/scan/test_result_parser.rb
fastlane-2.130.0.beta.20190820200024 scan/lib/scan/test_result_parser.rb
fastlane-2.130.0.beta.20190819200109 scan/lib/scan/test_result_parser.rb
fastlane-2.130.0.beta.20190818200034 scan/lib/scan/test_result_parser.rb
fastlane-2.130.0.beta.20190817200018 scan/lib/scan/test_result_parser.rb
fastlane-2.130.0.beta.20190816200015 scan/lib/scan/test_result_parser.rb
fastlane-2.130.0.beta.20190815200057 scan/lib/scan/test_result_parser.rb
fastlane-2.130.0.beta.20190814200010 scan/lib/scan/test_result_parser.rb
fastlane-2.129.0 scan/lib/scan/test_result_parser.rb
fastlane-2.129.0.beta.20190813200016 scan/lib/scan/test_result_parser.rb
fastlane-2.129.0.beta.20190811200106 scan/lib/scan/test_result_parser.rb
fastlane-2.129.0.beta.20190810200059 scan/lib/scan/test_result_parser.rb
fastlane-2.129.0.beta.20190809200051 scan/lib/scan/test_result_parser.rb
fastlane-2.129.0.beta.20190808200013 scan/lib/scan/test_result_parser.rb
fastlane-2.129.0.beta.20190807200122 scan/lib/scan/test_result_parser.rb
fastlane-2.129.0.beta.20190806200055 scan/lib/scan/test_result_parser.rb
fastlane-2.129.0.beta.20190805200019 scan/lib/scan/test_result_parser.rb