Class: Xcodeproj::XCScheme::TestAction::TestableReference
- Inherits:
-
XMLElementWrapper
- Object
- XMLElementWrapper
- Xcodeproj::XCScheme::TestAction::TestableReference
- Defined in:
- lib/xcodeproj/scheme/test_action.rb
Overview
————————————————————————-#
Defined Under Namespace
Classes: Test
Constant Summary collapse
- SkippedTest =
TODO:
Remove in Xcodeproj 2
Aliased to`Test` for compatibility
Test
Instance Attribute Summary
Attributes inherited from XMLElementWrapper
Instance Method Summary collapse
- #add_buildable_reference(ref) ⇒ Object
- #add_selected_test(selected_test) ⇒ Object
- #add_skipped_test(skipped_test) ⇒ Object
-
#buildable_references ⇒ Array<BuildableReference>
The list of BuildableReferences this action will build.
-
#initialize(target_or_node = nil, root_project = nil) ⇒ TestableReference
constructor
A new instance of TestableReference.
- #parallelizable=(flag) ⇒ Object
-
#parallelizable? ⇒ Bool
Whether or not this TestableReference (test bundle) should be run in parallel or not.
-
#randomized? ⇒ Bool
Whether or not this TestableReference (test bundle) should be run in randomized order.
- #remove_buildable_reference(ref) ⇒ Object
-
#selected_tests ⇒ Array<Test>
The list of SelectedTest this action will run.
- #selected_tests=(tests) ⇒ Object
- #skipped=(flag) ⇒ Object
-
#skipped? ⇒ Bool
Whether or not this TestableReference (test bundle) should be skipped or not.
-
#skipped_tests ⇒ Array<Test>
The list of SkippedTest this action will skip.
- #skipped_tests=(tests) ⇒ Object
-
#test_execution_ordering ⇒ String
The execution order for this TestableReference (test bundle).
- #test_execution_ordering=(order) ⇒ Object
- #use_test_selection_whitelist=(flag) ⇒ Object
-
#use_test_selection_whitelist? ⇒ Bool
Whether or not this TestableReference (test bundle) should use a whitelist or not.
Methods inherited from XMLElementWrapper
Constructor Details
#initialize(target_or_node = nil, root_project = nil) ⇒ TestableReference
Returns a new instance of TestableReference.
165 166 167 168 169 170 |
# File 'lib/xcodeproj/scheme/test_action.rb', line 165 def initialize(target_or_node = nil, root_project = nil) create_xml_element_with_fallback(target_or_node, 'TestableReference') do self.skipped = false add_buildable_reference BuildableReference.new(target_or_node, root_project) unless target_or_node.nil? end end |
Instance Method Details
#add_buildable_reference(ref) ⇒ Object
234 235 236 |
# File 'lib/xcodeproj/scheme/test_action.rb', line 234 def add_buildable_reference(ref) @xml_element.add_element(ref.xml_element) end |
#add_selected_test(selected_test) ⇒ Object
316 317 318 319 |
# File 'lib/xcodeproj/scheme/test_action.rb', line 316 def add_selected_test(selected_test) entries = @xml_element.elements['SelectedTests'] || @xml_element.add_element('SelectedTests') entries.add_element(selected_test.xml_element) end |
#add_skipped_test(skipped_test) ⇒ Object
272 273 274 275 |
# File 'lib/xcodeproj/scheme/test_action.rb', line 272 def add_skipped_test(skipped_test) entries = @xml_element.elements['SkippedTests'] || @xml_element.add_element('SkippedTests') entries.add_element(skipped_test.xml_element) end |
#buildable_references ⇒ Array<BuildableReference>
Returns The list of BuildableReferences this action will build. (The list usually contains only one element).
225 226 227 228 229 |
# File 'lib/xcodeproj/scheme/test_action.rb', line 225 def buildable_references @xml_element.get_elements('BuildableReference').map do |node| BuildableReference.new(node) end end |
#parallelizable=(flag) ⇒ Object
196 197 198 |
# File 'lib/xcodeproj/scheme/test_action.rb', line 196 def parallelizable=(flag) @xml_element.attributes['parallelizable'] = bool_to_string(flag) end |
#parallelizable? ⇒ Bool
Returns Whether or not this TestableReference (test bundle) should be run in parallel or not.
189 190 191 |
# File 'lib/xcodeproj/scheme/test_action.rb', line 189 def parallelizable? string_to_bool(@xml_element.attributes['parallelizable']) end |
#randomized? ⇒ Bool
Returns Whether or not this TestableReference (test bundle) should be run in randomized order.
217 218 219 |
# File 'lib/xcodeproj/scheme/test_action.rb', line 217 def randomized? test_execution_ordering == 'random' end |
#remove_buildable_reference(ref) ⇒ Object
241 242 243 |
# File 'lib/xcodeproj/scheme/test_action.rb', line 241 def remove_buildable_reference(ref) @xml_element.delete_element(ref.xml_element) end |
#selected_tests ⇒ Array<Test>
Returns The list of SelectedTest this action will run.
294 295 296 297 298 299 |
# File 'lib/xcodeproj/scheme/test_action.rb', line 294 def selected_tests return [] if @xml_element.elements['SelectedTests'].nil? @xml_element.elements['SelectedTests'].get_elements('Test').map do |node| Test.new(node) end end |
#selected_tests=(tests) ⇒ Object
304 305 306 307 308 309 310 311 |
# File 'lib/xcodeproj/scheme/test_action.rb', line 304 def selected_tests=(tests) @xml_element.delete_element('SelectedTests') return if tests.nil? entries = @xml_element.add_element('SelectedTests') tests.each do |selected| entries.add_element(selected.xml_element) end end |
#skipped=(flag) ⇒ Object
182 183 184 |
# File 'lib/xcodeproj/scheme/test_action.rb', line 182 def skipped=(flag) @xml_element.attributes['skipped'] = bool_to_string(flag) end |
#skipped? ⇒ Bool
Returns Whether or not this TestableReference (test bundle) should be skipped or not.
175 176 177 |
# File 'lib/xcodeproj/scheme/test_action.rb', line 175 def skipped? string_to_bool(@xml_element.attributes['skipped']) end |
#skipped_tests ⇒ Array<Test>
Returns The list of SkippedTest this action will skip.
248 249 250 251 252 253 |
# File 'lib/xcodeproj/scheme/test_action.rb', line 248 def skipped_tests return [] if @xml_element.elements['SkippedTests'].nil? @xml_element.elements['SkippedTests'].get_elements('Test').map do |node| Test.new(node) end end |
#skipped_tests=(tests) ⇒ Object
258 259 260 261 262 263 264 265 266 267 |
# File 'lib/xcodeproj/scheme/test_action.rb', line 258 def skipped_tests=(tests) @xml_element.delete_element('SkippedTests') if tests.nil? return end entries = @xml_element.add_element('SkippedTests') tests.each do |skipped| entries.add_element(skipped.xml_element) end end |
#test_execution_ordering ⇒ String
Returns The execution order for this TestableReference (test bundle).
203 204 205 |
# File 'lib/xcodeproj/scheme/test_action.rb', line 203 def test_execution_ordering @xml_element.attributes['testExecutionOrdering'] end |
#test_execution_ordering=(order) ⇒ Object
210 211 212 |
# File 'lib/xcodeproj/scheme/test_action.rb', line 210 def test_execution_ordering=(order) @xml_element.attributes['testExecutionOrdering'] = order end |
#use_test_selection_whitelist=(flag) ⇒ Object
287 288 289 |
# File 'lib/xcodeproj/scheme/test_action.rb', line 287 def use_test_selection_whitelist=(flag) @xml_element.attributes['useTestSelectionWhitelist'] = bool_to_string(flag) end |
#use_test_selection_whitelist? ⇒ Bool
Returns Whether or not this TestableReference (test bundle) should use a whitelist or not.
280 281 282 |
# File 'lib/xcodeproj/scheme/test_action.rb', line 280 def use_test_selection_whitelist? string_to_bool(@xml_element.attributes['useTestSelectionWhitelist']) end |