Class: Fastlane::Actions::XctestAction

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

Constant Summary

Constants inherited from Fastlane::Action

Fastlane::Action::AVAILABLE_CATEGORIES

Class Method Summary collapse

Methods inherited from Fastlane::Action

action_name, authors, details, lane_context, method_missing, other_action, output, return_value, sample_return_value, sh, step_text

Class Method Details

.authorObject



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

def self.author
  "dtrenz"
end

.available_optionsObject



586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
# File 'lib/fastlane/actions/xcodebuild.rb', line 586

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)'],
    ['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\'']
  ]
end

.categoryObject



578
579
580
# File 'lib/fastlane/actions/xcodebuild.rb', line 578

def self.category
  :building
end

.descriptionObject



582
583
584
# File 'lib/fastlane/actions/xcodebuild.rb', line 582

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

.example_codeObject



570
571
572
573
574
575
576
# File 'lib/fastlane/actions/xcodebuild.rb', line 570

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

.is_supported?(platform) ⇒ Boolean

Returns:

  • (Boolean)


604
605
606
# File 'lib/fastlane/actions/xcodebuild.rb', line 604

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

.run(params) ⇒ Object



561
562
563
564
565
566
567
568
# File 'lib/fastlane/actions/xcodebuild.rb', line 561

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

  XcodebuildAction.run(params_hash)
end