grntest 1.4.8 → 1.4.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/doc/text/news.md +6 -0
- data/lib/grntest/execution-context.rb +3 -1
- data/lib/grntest/executors/base-executor.rb +28 -1
- data/lib/grntest/test-runner.rb +3 -1
- data/lib/grntest/tester.rb +15 -2
- data/lib/grntest/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e027a36e3f3e1206e89cf0cc617a5e892074bd207ee46f29ebccf9b68bf25bc0
|
4
|
+
data.tar.gz: 4393ff236546341e6abba56083164ed4bdd51564a3acc0b3087ac2bf1cc6fec1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 14748646fa504319011a9cd649c732ae644ef2b7ec73a402f9740dda5a0f125e38dba7b227a4873766cc31777daf5d9407e9ab7ea5dd328f20eb858474c9a028
|
7
|
+
data.tar.gz: f34f315596201dec45cc177bfd0edba7f40f3dede8c6d8a046a28cf85fabf47ef1703340bc6008c60c751eda5712e38ea3bb0e52447118556536a93804a6a817
|
data/doc/text/news.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (C) 2012-
|
1
|
+
# Copyright (C) 2012-2021 Sutou Kouhei <kou@clear-code.com>
|
2
2
|
#
|
3
3
|
# This program is free software: you can redistribute it and/or modify
|
4
4
|
# it under the terms of the GNU General Public License as published by
|
@@ -20,6 +20,7 @@ module Grntest
|
|
20
20
|
attr_accessor :plugins_directory
|
21
21
|
attr_accessor :plugin_extension
|
22
22
|
attr_accessor :groonga_suggest_create_dataset
|
23
|
+
attr_accessor :groonga_synonym_generate
|
23
24
|
attr_accessor :testee
|
24
25
|
attr_accessor :interface
|
25
26
|
attr_accessor :result
|
@@ -46,6 +47,7 @@ module Grntest
|
|
46
47
|
@plugins_directory = nil
|
47
48
|
@plugin_extension = guess_plugin_extension
|
48
49
|
@groonga_suggest_create_dataset = "groonga-suggest-create-dataset"
|
50
|
+
@groonga_synonym_generate = "groonga-synonym-generate"
|
49
51
|
@testee = "groonga"
|
50
52
|
@interface = "stdio"
|
51
53
|
@n_nested = 0
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (C) 2012-
|
1
|
+
# Copyright (C) 2012-2021 Sutou Kouhei <kou@clear-code.com>
|
2
2
|
#
|
3
3
|
# This program is free software: you can redistribute it and/or modify
|
4
4
|
# it under the terms of the GNU General Public License as published by
|
@@ -444,6 +444,31 @@ module Grntest
|
|
444
444
|
end
|
445
445
|
end
|
446
446
|
|
447
|
+
def execute_directive_synonym_generate(parser, line, content, options)
|
448
|
+
if @context.groonga_synonym_generate.nil?
|
449
|
+
omit("groonga-synonym-generate isn't specified")
|
450
|
+
end
|
451
|
+
|
452
|
+
table, *args = options
|
453
|
+
command_line = [
|
454
|
+
@context.groonga_synonym_generate,
|
455
|
+
*args,
|
456
|
+
]
|
457
|
+
packed_command_line = command_line.join(" ")
|
458
|
+
log_input("#{packed_command_line}\n")
|
459
|
+
begin
|
460
|
+
IO.popen(command_line, "r:ascii-8bit") do |io|
|
461
|
+
parser << "load --table #{table}\n"
|
462
|
+
io.each_line do |line|
|
463
|
+
parser << line
|
464
|
+
end
|
465
|
+
end
|
466
|
+
rescue SystemCallError
|
467
|
+
raise Error.new("failed to run groonga-synonym-generate: " +
|
468
|
+
"<#{packed_command_line}>: #{$!}")
|
469
|
+
end
|
470
|
+
end
|
471
|
+
|
447
472
|
def execute_directive(parser, line, content)
|
448
473
|
command, *options = Shellwords.split(content)
|
449
474
|
case command
|
@@ -497,6 +522,8 @@ module Grntest
|
|
497
522
|
execute_directive_sleep_after_command(line, content, options)
|
498
523
|
when "require-feature"
|
499
524
|
execute_directive_require_feature(line, content, options)
|
525
|
+
when "synonym-generate"
|
526
|
+
execute_directive_synonym_generate(parser, line, content, options)
|
500
527
|
else
|
501
528
|
log_input(line)
|
502
529
|
log_error("#|e| unknown directive: <#{command}>")
|
data/lib/grntest/test-runner.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (C) 2012-
|
1
|
+
# Copyright (C) 2012-2021 Sutou Kouhei <kou@clear-code.com>
|
2
2
|
#
|
3
3
|
# This program is free software: you can redistribute it and/or modify
|
4
4
|
# it under the terms of the GNU General Public License as published by
|
@@ -137,6 +137,8 @@ module Grntest
|
|
137
137
|
context.plugins_directory = @tester.plugins_directory.expand_path
|
138
138
|
context.groonga_suggest_create_dataset =
|
139
139
|
@tester.groonga_suggest_create_dataset
|
140
|
+
context.groonga_synonym_generate =
|
141
|
+
@tester.groonga_synonym_generate
|
140
142
|
context.testee = @tester.testee
|
141
143
|
context.interface = @tester.interface
|
142
144
|
context.use_http_post = @tester.use_http_post?
|
data/lib/grntest/tester.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (C) 2012-
|
1
|
+
# Copyright (C) 2012-2021 Sutou Kouhei <kou@clear-code.com>
|
2
2
|
#
|
3
3
|
# This program is free software: you can redistribute it and/or modify
|
4
4
|
# it under the terms of the GNU General Public License as published by
|
@@ -56,6 +56,12 @@ module Grntest
|
|
56
56
|
tester.groonga_suggest_create_dataset = normalize_command(command)
|
57
57
|
end
|
58
58
|
|
59
|
+
parser.on("--groonga-synonym-generate=COMMAND",
|
60
|
+
"Use COMMAND as groonga_synonym_generate command",
|
61
|
+
"(#{tester.groonga_synonym_generate})") do |command|
|
62
|
+
tester.groonga_synonym_generate = normalize_command(command)
|
63
|
+
end
|
64
|
+
|
59
65
|
available_interfaces = ["stdio", "http"]
|
60
66
|
available_interface_labels = available_interfaces.join(", ")
|
61
67
|
parser.on("--interface=INTERFACE", available_interfaces,
|
@@ -303,7 +309,10 @@ module Grntest
|
|
303
309
|
end
|
304
310
|
end
|
305
311
|
|
306
|
-
attr_accessor :groonga
|
312
|
+
attr_accessor :groonga
|
313
|
+
attr_accessor :groonga_httpd
|
314
|
+
attr_accessor :groonga_suggest_create_dataset
|
315
|
+
attr_accessor :groonga_synonym_generate
|
307
316
|
attr_accessor :interface
|
308
317
|
attr_writer :use_http_post
|
309
318
|
attr_writer :use_http_chunked
|
@@ -334,6 +343,10 @@ module Grntest
|
|
334
343
|
unless command_exist?(@groonga_suggest_create_dataset)
|
335
344
|
@groonga_suggest_create_dataset = nil
|
336
345
|
end
|
346
|
+
@groonga_synonym_generate = "groonga-synonym-generate"
|
347
|
+
unless command_exist?(@groonga_synonym_generate)
|
348
|
+
@groonga_synonym_generate = nil
|
349
|
+
end
|
337
350
|
@interface = "stdio"
|
338
351
|
@use_http_post = false
|
339
352
|
@use_http_chunked = false
|
data/lib/grntest/version.rb
CHANGED
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.4.
|
4
|
+
version: 1.4.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kouhei Sutou
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2021-07-12 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: diff-lcs
|
@@ -270,7 +270,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
270
270
|
- !ruby/object:Gem::Version
|
271
271
|
version: '0'
|
272
272
|
requirements: []
|
273
|
-
rubygems_version: 3.
|
273
|
+
rubygems_version: 3.3.0.dev
|
274
274
|
signing_key:
|
275
275
|
specification_version: 4
|
276
276
|
summary: Grntest is a testing framework for Groonga. You can write a test for Groonga
|