@@ -49,15 +49,16 @@ def self.tests_count(test_file)
4949
5050 def self . run ( test_file , total_tests , opts )
5151 # First line TAP output
52- if opts . verbose
52+ if opts . verbose > 0
5353 puts
5454 puts
5555 STDERR . puts "------- STARTED(tests=#{ total_tests } , file=\" #{ test_file } \" )"
5656 end
5757
5858 return [ 0 , 0 , 0 , [ ] ] if total_tests <= 0
5959
60- cmd = "ruby #{ __FILE__ } #{ test_file } --runner"
60+ cmd_verbose_opts = ( ( 0 ...opts . verbose ) . map { |o | "-v" } ) . join ( " " )
61+ cmd = "ruby #{ __FILE__ } #{ test_file } --runner #{ cmd_verbose_opts } "
6162
6263 passed = 0
6364 skipped = 0
@@ -90,7 +91,7 @@ def self.run(test_file, total_tests, opts)
9091 end
9192
9293 # Print output/error only in verbose mode
93- puts ( line . start_with? ( "#" ) ? line : "# #{ line } " ) if opts . verbose
94+ puts ( line . start_with? ( "#" ) ? line : "# #{ line } " ) if opts . verbose > 0
9495 end
9596
9697 # Print the last Test status
@@ -101,7 +102,7 @@ def self.run(test_file, total_tests, opts)
101102 if status . success?
102103 skipped = total_tests - ( passed + failed )
103104 else
104- STDERR . puts "# Failed to execute" if opts . verbose
105+ STDERR . puts "# Failed to execute" if opts . verbose > 0
105106 end
106107 end
107108
@@ -210,7 +211,7 @@ def self.run_all(options)
210211 metrics = Metrics . new
211212
212213 # Indexing: Collect number of tests from each test file
213- STDERR . print "Indexing test files... " if options . verbose
214+ STDERR . print "Indexing test files... " if options . verbose > 0
214215
215216 index_errors = [ ]
216217 tfiles . each do |test_file |
@@ -225,7 +226,7 @@ def self.run_all(options)
225226 end
226227 end
227228
228- if options . verbose
229+ if options . verbose > 0
229230 STDERR . puts "done. tests=#{ metrics . total } " +
230231 "test_files=#{ metrics . total_files } " +
231232 "duration_seconds=#{ metrics . index_duration_seconds } "
@@ -240,7 +241,7 @@ def self.run_all(options)
240241 metrics . file_completed ( test_file , passed , failed , skipped , dur , failed_tests )
241242
242243 # Test file summary if -vv is provided
243- testfile_summary ( metrics . file ( test_file ) ) if options . verbose
244+ testfile_summary ( metrics . file ( test_file ) ) if options . verbose > 0
244245 end
245246
246247 puts
@@ -249,7 +250,7 @@ def self.run_all(options)
249250 puts "============================================================================================"
250251
251252 # Show full summary if -v
252- verbose_summary ( metrics ) if options . verbose
253+ verbose_summary ( metrics ) if options . verbose > 0
253254
254255 # Final Table Summary
255256 summary ( metrics )
@@ -279,15 +280,15 @@ def self.run_all(options)
279280
280281 def self . args
281282 args = Options . new ( "binnacle - Simple Test Framework" )
282- args . verbose = false
283+ args . verbose = 0
283284 args . runner = false
284285 args . result_json = ""
285286
286287 opt_parser = OptionParser . new do |opts |
287288 opts . banner = "Usage: binnacle [options] <testfile>"
288289
289290 opts . on ( "-v" , "--verbose" , "Verbose output" ) do
290- args . verbose = true
291+ args . verbose += 1
291292 end
292293
293294 opts . on ( "-r" , "--runner" , "Run the tests" ) do
@@ -330,6 +331,7 @@ def self.args
330331 if options . runner
331332 include BinnacleTestPlugins
332333 BinnacleTestsRunner . dry_run = options . dry_run
334+ BinnacleTestsRunner . emit_stdout = true if options . verbose > 1
333335
334336 begin
335337 load File . expand_path ( options . test_file )
0 commit comments