Sha256: 741a05444c9e9bd9c050a44495bc0ca247f5ebc936fda015f1c5a7ffd5e94e3a

Contents?: true

Size: 579 Bytes

Versions: 185

Compression:

Stored size: 579 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 {}
      end
    end
  end
end

Version data entries

185 entries across 185 versions & 2 rubygems

Version Path
fastlane-2.25.0.beta.20170331010039 scan/lib/scan/test_result_parser.rb
fastlane-2.25.0.beta.20170330225747 scan/lib/scan/test_result_parser.rb
fastlane-2.24.0 scan/lib/scan/test_result_parser.rb
fastlane-2.24.0.beta.20170330010023 scan/lib/scan/test_result_parser.rb
fastlane-2.24.0.beta.20170329010023 scan/lib/scan/test_result_parser.rb
fastlane-2.24.0.beta.20170328010037 scan/lib/scan/test_result_parser.rb
fastlane-2.24.0.beta.20170327010009 scan/lib/scan/test_result_parser.rb
fastlane-2.24.0.beta.20170326010023 scan/lib/scan/test_result_parser.rb
fastlane-2.24.0.beta.20170325010032 scan/lib/scan/test_result_parser.rb
fastlane-2.23.0 scan/lib/scan/test_result_parser.rb
fastlane-2.23.0.beta.20170322010036 scan/lib/scan/test_result_parser.rb
fastlane-2.22.0 scan/lib/scan/test_result_parser.rb
fastlane-2.22.0.beta.20170321010023 scan/lib/scan/test_result_parser.rb
fastlane-2.21.0 scan/lib/scan/test_result_parser.rb
fastlane-2.21.0.beta.20170320010043 scan/lib/scan/test_result_parser.rb
fastlane-2.21.0.beta.20170319010027 scan/lib/scan/test_result_parser.rb
fastlane-2.21.0.beta.20170318010107 scan/lib/scan/test_result_parser.rb
fastlane-2.21.0.beta.20170317010039 scan/lib/scan/test_result_parser.rb
fastlane-2.21.0.beta.20170316010039 scan/lib/scan/test_result_parser.rb
fastlane-2.20.0 scan/lib/scan/test_result_parser.rb