Class: TestLauncher::CLI::MultiFrameworkQuery
- Inherits:
-
Struct
- Object
- Struct
- TestLauncher::CLI::MultiFrameworkQuery
- Defined in:
- lib/test_launcher/cli.rb
Constant Summary collapse
- @@mutex =
Mutex.new
Instance Attribute Summary collapse
-
#cli_options ⇒ Object
Returns the value of attribute cli_options.
Instance Method Summary collapse
Instance Attribute Details
#cli_options ⇒ Object
Returns the value of attribute cli_options
9 10 11 |
# File 'lib/test_launcher/cli.rb', line 9 def @cli_options end |
Instance Method Details
#command ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/test_launcher/cli.rb', line 12 def command # do them all at the same time! @count = .frameworks.count @finished = 0 @value = nil @now = Time.now.to_f @generic_default = nil .frameworks.each do |framework| Thread.new do finder = Queries::CommandFinder.new(request_for(framework)) ex = nil begin val = finder.generic_search rescue => e ex = e end @@mutex.synchronize do @finished += 1 if framework == Frameworks::Generic @generic_default = val else if ex && !@exception @exception = ex elsif val && !@value @value = val end end end end end while (@finished < @count && !@value && !@exception) do sleep(0.05) end if @exception raise @exception else @value || @generic_default end end |
#request_for(framework) ⇒ Object
58 59 60 61 62 63 64 65 66 67 68 69 70 |
# File 'lib/test_launcher/cli.rb', line 58 def request_for(framework) Request.new( framework: framework, search_string: .search_string, rerun: .rerun, run_all: .run_all, disable_spring: .disable_spring, force_spring: .force_spring, example_name: .example_name, shell: .shell, searcher: .searcher, ) end |