Class: Xcodeproj::XCScheme::TestAction
- Inherits:
-
AbstractSchemeAction
- Object
- XMLElementWrapper
- AbstractSchemeAction
- Xcodeproj::XCScheme::TestAction
- Defined in:
- lib/xcodeproj/scheme/test_action.rb
Overview
This class wraps the TestAction node of a .xcscheme XML file
Defined Under Namespace
Classes: TestableReference
Instance Attribute Summary
Attributes inherited from XMLElementWrapper
Instance Method Summary collapse
- #add_macro_expansion(macro_expansion) ⇒ Object
- #add_testable(testable) ⇒ Object
- #code_coverage_enabled=(flag) ⇒ Object
-
#code_coverage_enabled? ⇒ Bool
Whether Clang Code Coverage is enabled (‘Gather coverage data’ turned ON).
-
#initialize(node = nil) ⇒ TestAction
constructor
A new instance of TestAction.
-
#macro_expansions ⇒ Array<MacroExpansion>
The list of MacroExpansion bound with this TestAction.
- #should_use_launch_scheme_args_env=(flag) ⇒ Object
-
#should_use_launch_scheme_args_env? ⇒ Bool
Whether this Test Action should use the same arguments and environment variables as the Launch Action.
-
#testables ⇒ Array<TestableReference>
The list of TestableReference (test bundles) associated with this Test Action.
Methods inherited from AbstractSchemeAction
#build_configuration, #build_configuration=
Methods inherited from XMLElementWrapper
Constructor Details
#initialize(node = nil) ⇒ TestAction
Returns a new instance of TestAction.
12 13 14 15 16 17 18 19 20 |
# File 'lib/xcodeproj/scheme/test_action.rb', line 12 def initialize(node = nil) create_xml_element_with_fallback(node, 'TestAction') do @xml_element.attributes['selectedDebuggerIdentifier'] = 'Xcode.DebuggerFoundation.Debugger.LLDB' @xml_element.attributes['selectedLauncherIdentifier'] = 'Xcode.DebuggerFoundation.Launcher.LLDB' @xml_element.add_element('AdditionalOptions') self.should_use_launch_scheme_args_env = true self.build_configuration = 'Debug' end end |
Instance Method Details
#add_macro_expansion(macro_expansion) ⇒ Object
83 84 85 |
# File 'lib/xcodeproj/scheme/test_action.rb', line 83 def add_macro_expansion(macro_expansion) @xml_element.add_element(macro_expansion.xml_element) end |
#add_testable(testable) ⇒ Object
66 67 68 69 |
# File 'lib/xcodeproj/scheme/test_action.rb', line 66 def add_testable(testable) testables = @xml_element.elements['Testables'] || @xml_element.add_element('Testables') testables.add_element(testable.xml_element) end |
#code_coverage_enabled=(flag) ⇒ Object
48 49 50 |
# File 'lib/xcodeproj/scheme/test_action.rb', line 48 def code_coverage_enabled=(flag) @xml_element.attributes['codeCoverageEnabled'] = bool_to_string(flag) end |
#code_coverage_enabled? ⇒ Bool
Returns Whether Clang Code Coverage is enabled (‘Gather coverage data’ turned ON).
41 42 43 |
# File 'lib/xcodeproj/scheme/test_action.rb', line 41 def code_coverage_enabled? string_to_bool(@xml_element.attributes['codeCoverageEnabled']) end |
#macro_expansions ⇒ Array<MacroExpansion>
Returns The list of MacroExpansion bound with this TestAction.
74 75 76 77 78 |
# File 'lib/xcodeproj/scheme/test_action.rb', line 74 def macro_expansions @xml_element.get_elements('MacroExpansion').map do |node| MacroExpansion.new(node) end end |
#should_use_launch_scheme_args_env=(flag) ⇒ Object
34 35 36 |
# File 'lib/xcodeproj/scheme/test_action.rb', line 34 def should_use_launch_scheme_args_env=(flag) @xml_element.attributes['shouldUseLaunchSchemeArgsEnv'] = bool_to_string(flag) end |
#should_use_launch_scheme_args_env? ⇒ Bool
Returns Whether this Test Action should use the same arguments and environment variables as the Launch Action.
26 27 28 |
# File 'lib/xcodeproj/scheme/test_action.rb', line 26 def should_use_launch_scheme_args_env? string_to_bool(@xml_element.attributes['shouldUseLaunchSchemeArgsEnv']) end |
#testables ⇒ Array<TestableReference>
Returns The list of TestableReference (test bundles) associated with this Test Action.
55 56 57 58 59 60 61 |
# File 'lib/xcodeproj/scheme/test_action.rb', line 55 def testables return [] unless @xml_element.elements['Testables'] @xml_element.elements['Testables'].get_elements('TestableReference').map do |node| TestableReference.new(node) end end |