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.28.0.beta.20170416010028 scan/lib/scan/test_result_parser.rb
fastlane-2.28.0.beta.20170415010110 scan/lib/scan/test_result_parser.rb
fastlane-2.27.0 scan/lib/scan/test_result_parser.rb
fastlane-2.27.0.beta.20170414010035 scan/lib/scan/test_result_parser.rb
fastlane-2.27.0.beta.20170413010117 scan/lib/scan/test_result_parser.rb
fastlane-2.27.0.beta.20170412010036 scan/lib/scan/test_result_parser.rb
fastlane-2.27.0.beta.20170411010118 scan/lib/scan/test_result_parser.rb
fastlane-2.27.0.beta.20170410010020 scan/lib/scan/test_result_parser.rb
fastlane-2.27.0.beta.20170409010031 scan/lib/scan/test_result_parser.rb
fastlane-2.26.1 scan/lib/scan/test_result_parser.rb
fastlane-2.27.0.beta.20170408010009 scan/lib/scan/test_result_parser.rb
fastlane-2.27.0.beta.20170407010056 scan/lib/scan/test_result_parser.rb
fastlane-2.26.0 scan/lib/scan/test_result_parser.rb
fastlane-2.26.0.beta.20170406010019 scan/lib/scan/test_result_parser.rb
fastlane-2.26.0.beta.20170405010026 scan/lib/scan/test_result_parser.rb
fastlane-2.26.0.beta.20170404010022 scan/lib/scan/test_result_parser.rb
fastlane-2.25.0 scan/lib/scan/test_result_parser.rb
fastlane-2.25.0.beta.20170403010018 scan/lib/scan/test_result_parser.rb
fastlane-2.25.0.beta.20170402010035 scan/lib/scan/test_result_parser.rb
fastlane-2.25.0.beta.20170401010021 scan/lib/scan/test_result_parser.rb