grntest 1.1.7 → 1.1.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 47043c20a22bc0d82dc943e99ea96448e9716666
4
- data.tar.gz: dd45a3f47b2019028e5293277d7fa20fb3c2a793
3
+ metadata.gz: 2ca500bff8db5b5d6ced1134c9ffebdd4a5bfa30
4
+ data.tar.gz: 4f44310da7edac112cad7a4f0bd4f41d954f0a75
5
5
  SHA512:
6
- metadata.gz: 96837152fe115554dfc492c3594b52ed78f11cf0c567b188586563c7fe7cacd52ac0802573d4fdbb278eb55bcbdc88eba4c16936bff34a894b0571290db6d55e
7
- data.tar.gz: 4bed50348dddc4d2d1bd264a65424a8b306d3ed1026b9a334fe0891a8e1322022d1f7f0e583807c50ede9a05bf9c8f514f8f4c35988d1239cf85d022c4284491
6
+ metadata.gz: 1b0ac506e42326ccf496c46b840936bc6ab03b898706b0c0aa13f7c9c77a0851750601870591a32745cff1a868d8f1eccec773c81c4efe6ff2f5b37954f96979
7
+ data.tar.gz: 7eb826ce2087e090c7652443ffc1f9a907571b4b137c18e03d21e5039e1adf5cced7e61a2a8f481636058c30e4f724553efc9e0a33e5966826dfa152b26c5b00
data/doc/text/news.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # News
2
2
 
3
+ ## 1.1.8: 2016-05-16
4
+
5
+ ### Improvements
6
+
7
+ * Added `--debug` option.
8
+
3
9
  ## 1.1.7: 2016-05-16
4
10
 
5
11
  ### Improvements
@@ -1,6 +1,4 @@
1
- # -*- coding: utf-8 -*-
2
- #
3
- # Copyright (C) 2012-2015 Kouhei Sutou <kou@clear-code.com>
1
+ # Copyright (C) 2012-2016 Kouhei Sutou <kou@clear-code.com>
4
2
  #
5
3
  # This program is free software: you can redistribute it and/or modify
6
4
  # it under the terms of the GNU General Public License as published by
@@ -25,6 +23,7 @@ module Grntest
25
23
  attr_accessor :on_error
26
24
  attr_accessor :abort_tag
27
25
  attr_writer :collect_query_log
26
+ attr_writer :debug
28
27
  def initialize
29
28
  @logging = true
30
29
  @base_directory = Pathname(".")
@@ -40,6 +39,7 @@ module Grntest
40
39
  @abort_tag = nil
41
40
  @omitted = false
42
41
  @collect_query_log = false
42
+ @debug = false
43
43
  end
44
44
 
45
45
  def logging?
@@ -50,6 +50,10 @@ module Grntest
50
50
  @collect_query_log
51
51
  end
52
52
 
53
+ def debug?
54
+ @debug
55
+ end
56
+
53
57
  def execute
54
58
  @n_nested += 1
55
59
  yield
@@ -408,6 +408,7 @@ module Grntest
408
408
  content << read_content
409
409
  timeout = 0 if read_content.bytesize < request_bytes
410
410
  end
411
+ debug_output(content)
411
412
  content
412
413
  end
413
414
 
@@ -484,6 +485,20 @@ module Grntest
484
485
  end
485
486
  end
486
487
 
488
+ def debug_input(input)
489
+ return unless @context.debug?
490
+ $stderr.puts("> #{input}")
491
+ end
492
+
493
+ def debug_output(output)
494
+ if @context.debug?
495
+ output.each_line do |line|
496
+ $stderr.puts("< #{line}")
497
+ end
498
+ end
499
+ output
500
+ end
501
+
487
502
  def default_timeout
488
503
  3
489
504
  end
@@ -32,6 +32,7 @@ module Grntest
32
32
  command_line = command_line.sub(/$/, " --output_type #{@output_type}")
33
33
  end
34
34
  begin
35
+ debug_input(command_line)
35
36
  @input.print(command_line)
36
37
  @input.print("\n")
37
38
  @input.flush
@@ -135,6 +135,7 @@ module Grntest
135
135
  context.groonga_suggest_create_dataset =
136
136
  @tester.groonga_suggest_create_dataset
137
137
  context.output_type = @tester.output_type
138
+ context.debug = @tester.debug?
138
139
  run_groonga(context) do |executor|
139
140
  begin
140
141
  Timeout.timeout(@tester.timeout) do
@@ -212,6 +212,12 @@ module Grntest
212
212
  tester.timeout = timeout
213
213
  end
214
214
 
215
+ parser.on("--[no-]debug",
216
+ "Enable debug information",
217
+ "(#{tester.debug?})") do |debug|
218
+ tester.debug = debug
219
+ end
220
+
215
221
  parser.on("--version",
216
222
  "Show version and exit") do
217
223
  puts(VERSION)
@@ -258,6 +264,7 @@ module Grntest
258
264
  attr_writer :reporter, :keep_database, :use_color
259
265
  attr_writer :stop_on_failure
260
266
  attr_writer :suppress_omit_log
267
+ attr_writer :debug
261
268
  attr_reader :test_patterns, :test_suite_patterns
262
269
  attr_reader :exclude_test_patterns, :exclude_test_suite_patterns
263
270
  def initialize
@@ -279,6 +286,7 @@ module Grntest
279
286
  @use_color = nil
280
287
  @stop_on_failure = false
281
288
  @suppress_omit_log = true
289
+ @debug = false
282
290
  @test_patterns = []
283
291
  @test_suite_patterns = []
284
292
  @exclude_test_patterns = []
@@ -328,6 +336,10 @@ module Grntest
328
336
  @suppress_omit_log
329
337
  end
330
338
 
339
+ def debug?
340
+ @debug
341
+ end
342
+
331
343
  def valgrind_gen_suppressions?
332
344
  @valgrind_gen_suppressions
333
345
  end
@@ -14,5 +14,5 @@
14
14
  # along with this program. If not, see <http://www.gnu.org/licenses/>.
15
15
 
16
16
  module Grntest
17
- VERSION = "1.1.7"
17
+ VERSION = "1.1.8"
18
18
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: grntest
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.7
4
+ version: 1.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kouhei Sutou
@@ -223,8 +223,8 @@ specification_version: 4
223
223
  summary: Grntest is a testing framework for Groonga. You can write a test for Groonga
224
224
  by writing Groonga commands and expected result.
225
225
  test_files:
226
- - test/test-log-parser.rb
226
+ - test/run-test.rb
227
227
  - test/executors/test-base-executor.rb
228
228
  - test/executors/test-standard-io-executor.rb
229
- - test/run-test.rb
229
+ - test/test-log-parser.rb
230
230
  has_rdoc: