Class: Fastlane::Actions::XctestAction

Inherits:
Fastlane::Action show all
Defined in:
fastlane/lib/fastlane/actions/xcodebuild.rb

Constant Summary

Constants inherited from Fastlane::Action

Fastlane::Action::AVAILABLE_CATEGORIES, Fastlane::Action::RETURN_TYPES

Class Method Summary collapse

Methods inherited from Fastlane::Action

action_name, authors, deprecated_notes, details, lane_context, method_missing, other_action, output, return_type, return_value, sample_return_value, shell_out_should_use_bundle_exec?, step_text

Class Method Details

.authorObject



641
642
643
# File 'fastlane/lib/fastlane/actions/xcodebuild.rb', line 641

def self.author
  "dtrenz"
end

.available_optionsObject



617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
# File 'fastlane/lib/fastlane/actions/xcodebuild.rb', line 617

def self.available_options
  [
    ['archive', 'Set to true to build archive'],
    ['archive_path', 'The path to archive the to. Must contain `.xcarchive`'],
    ['workspace', 'The workspace to use'],
    ['scheme', 'The scheme to build'],
    ['build_settings', 'Hash of additional build information'],
    ['xcargs', 'Pass additional xcodebuild options'],
    ['destination', 'The simulator to use, e.g. "name=iPhone 5s,OS=8.1"'],
    ['destination_timeout', 'The timeout for connecting to the simulator, in seconds'],
    ['enable_code_coverage', 'Turn code coverage on or off when testing. eg. true|false. Requires Xcode 7+'],
    ['output_style', 'Set the output format to one of: :standard (Colored UTF8 output, default), :basic (black & white ASCII output)'],
    ['xcodebuild_architecture', 'Allows to set the architecture that `xcodebuild` is run with, for example to force it to run under Rosetta on an Apple Silicon mac'],
    ['buildlog_path', 'The path where the xcodebuild.log will be created, by default it is created in ~/Library/Logs/fastlane/xcbuild'],
    ['raw_buildlog', 'Set to true to see xcodebuild raw output. Default value is false'],
    ['xcpretty_output', 'specifies the output type for xcpretty. eg. \'test\', or \'simple\''],
    ['xcpretty_utf', 'Specifies xcpretty should use utf8 when reporting builds. This has no effect when raw_buildlog is specified.']
  ]
end

.categoryObject



609
610
611
# File 'fastlane/lib/fastlane/actions/xcodebuild.rb', line 609

def self.category
  :building
end

.descriptionObject



613
614
615
# File 'fastlane/lib/fastlane/actions/xcodebuild.rb', line 613

def self.description
  "Runs tests on the given simulator"
end

.example_codeObject



601
602
603
604
605
606
607
# File 'fastlane/lib/fastlane/actions/xcodebuild.rb', line 601

def self.example_code
  [
    'xctest(
      destination: "name=iPhone 7s,OS=10.0"
    )'
  ]
end

.is_supported?(platform) ⇒ Boolean

Returns:



637
638
639
# File 'fastlane/lib/fastlane/actions/xcodebuild.rb', line 637

def self.is_supported?(platform)
  [:ios, :mac].include? platform
end

.run(params) ⇒ Object



592
593
594
595
596
597
598
599
# File 'fastlane/lib/fastlane/actions/xcodebuild.rb', line 592

def self.run(params)
  UI.important("Have you seen the new 'scan' tool to run tests? https://docs.fastlane.tools/actions/scan/")
  params_hash = params || {}
  params_hash[:build] = true
  params_hash[:test] = true

  XcodebuildAction.run(params_hash)
end