grntest 1.3.2 → 1.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0dde3b6cf798791dc6aeafd6b352238f07c7380203fee2e8972593fec9bfc6f7
4
- data.tar.gz: 6b12f9e76f353417c5ad8c195db96a17029fd52ee8322c4d683215db17245758
3
+ metadata.gz: 2e1250a739ad90db6969395e873269deeb2a19b08c99c8dfc121a8ff803282bc
4
+ data.tar.gz: d42dde8e1cfd602b07b3d6a86569c66609dbc9ea5d769f0d6c7dc9148c69ea3f
5
5
  SHA512:
6
- metadata.gz: 314b08a7d51b374159b9dc0e325b17c3c2b12e981e2508e7266132bb9e91c6ec4c2d7694d6d23435412595caf703a62a3980a7193842fc967f4f20a60c7650a1
7
- data.tar.gz: 5d628089f0b428905fce39011c1acb827fca80932bcb139f632f891665a3bad0d3a74f7c1b403bab791c67c518f69e7c3065ee3f285dbab6d955cf02693f72f9
6
+ metadata.gz: c8210a78653d3aa6067e0c9577931b1398f61b120a42570be03aee42ea8b56a458e807dd92f381312fdced2773d53a82d20cb0f331322c1f88d1eb104c1d82d0
7
+ data.tar.gz: d6eefca78c861859116fe65f9a87d17b2d573a8a9e22611b5290247be77223d2abffadb3faa3e74eff46b7ad27b46bab32a6f701afb2fc4ddba6be0fe45c4fdb
data/doc/text/news.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # News
2
2
 
3
+ ## 1.3.3: 2019-05-12
4
+
5
+ ### Improvements
6
+
7
+ * Added `eval` directive.
8
+
9
+ * Added `plugins_directory` expandable variable.
10
+
11
+ * Added `libtool_directory` expandable variable.
12
+
13
+ * Added `plugin_extension` expandable variable.
14
+
3
15
  ## 1.3.2: 2019-05-09
4
16
 
5
17
  ### Improvements
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2012-2018 Kouhei Sutou <kou@clear-code.com>
1
+ # Copyright (C) 2012-2019 Kouhei Sutou <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
@@ -17,6 +17,8 @@ module Grntest
17
17
  class ExecutionContext
18
18
  attr_writer :logging
19
19
  attr_accessor :base_directory, :temporary_directory_path, :db_path
20
+ attr_accessor :plugins_directory
21
+ attr_accessor :plugin_extension
20
22
  attr_accessor :groonga_suggest_create_dataset
21
23
  attr_accessor :result
22
24
  attr_accessor :output_type
@@ -35,6 +37,8 @@ module Grntest
35
37
  @base_directory = Pathname(".")
36
38
  @temporary_directory_path = Pathname("tmp")
37
39
  @db_path = Pathname("db")
40
+ @plugins_directory = nil
41
+ @plugin_extension = guess_plugin_extension
38
42
  @groonga_suggest_create_dataset = "groonga-suggest-create-dataset"
39
43
  @n_nested = 0
40
44
  @result = []
@@ -101,6 +105,15 @@ module Grntest
101
105
  @db_path.relative_path_from(@temporary_directory_path)
102
106
  end
103
107
 
108
+ def libtool_directory
109
+ @plugins_directory.find do |sub_path|
110
+ if sub_path.directory? and sub_path.basename.to_s == ".libs"
111
+ return ".libs/"
112
+ end
113
+ end
114
+ ""
115
+ end
116
+
104
117
  def omitted?
105
118
  @omitted
106
119
  end
@@ -132,5 +145,15 @@ module Grntest
132
145
  @query_log = nil
133
146
  end
134
147
  end
148
+
149
+ private
150
+ def guess_plugin_extension
151
+ case RUBY_PLATFORM
152
+ when /mingw|mswin/
153
+ "dll"
154
+ else
155
+ "so"
156
+ end
157
+ end
135
158
  end
136
159
  end
@@ -315,6 +315,11 @@ module Grntest
315
315
  end
316
316
  end
317
317
 
318
+ def execute_directive_eval(parser, line, content, options)
319
+ groonga_command = content.split(" ", 2)[1]
320
+ parser << "#{expand_variables(groonga_command)}\n"
321
+ end
322
+
318
323
  def execute_directive(parser, line, content)
319
324
  command, *options = Shellwords.split(content)
320
325
  case command
@@ -348,6 +353,8 @@ module Grntest
348
353
  execute_directive_collect_query_log(line, content, options)
349
354
  when "generate-series"
350
355
  execute_directive_generate_series(parser, line, content, options)
356
+ when "eval"
357
+ execute_directive_eval(parser, line, content, options)
351
358
  else
352
359
  log_input(line)
353
360
  log_error("#|e| unknown directive: <#{command}>")
@@ -134,6 +134,7 @@ module Grntest
134
134
  context.temporary_directory_path = directory_path
135
135
  context.db_path = db_path
136
136
  context.base_directory = @tester.base_directory.expand_path
137
+ context.plugins_directory = @tester.plugins_directory.expand_path
137
138
  context.groonga_suggest_create_dataset =
138
139
  @tester.groonga_suggest_create_dataset
139
140
  context.output_type = @tester.output_type
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2012-2018 Kouhei Sutou <kou@clear-code.com>
1
+ # Copyright (C) 2012-2019 Kouhei Sutou <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
@@ -415,6 +415,14 @@ module Grntest
415
415
  end
416
416
  end
417
417
 
418
+ def plugins_directory
419
+ groonga_path = Pathname(@groonga)
420
+ unless groonga_path.absolute?
421
+ groonga_path = Pathname(resolve_command_path(@groonga)).expand_path
422
+ end
423
+ groonga_path.parent.parent + "plugins"
424
+ end
425
+
418
426
  private
419
427
  def load_tests(*targets)
420
428
  default_group_name = "."
@@ -471,7 +479,7 @@ module Grntest
471
479
  @vagrind_gen_suppressions = false
472
480
  end
473
481
 
474
- def command_exist?(name)
482
+ def resolve_command_path(name)
475
483
  exeext = RbConfig::CONFIG["EXEEXT"]
476
484
  ENV["PATH"].split(File::PATH_SEPARATOR).each do |path|
477
485
  raw_candidate = File.join(path, name)
@@ -480,10 +488,14 @@ module Grntest
480
488
  "#{raw_candidate}#{exeext}",
481
489
  ]
482
490
  candidates.each do |candidate|
483
- return true if File.executable?(candidate)
491
+ return candidate if File.executable?(candidate)
484
492
  end
485
493
  end
486
- false
494
+ nil
495
+ end
496
+
497
+ def command_exist?(name)
498
+ not resolve_command_path(name).nil?
487
499
  end
488
500
 
489
501
  def guess_color_availability
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2016 Kouhei Sutou <kou@clear-code.com>
1
+ # Copyright (C) 2016-2019 Kouhei Sutou <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
@@ -28,6 +28,12 @@ module Grntest
28
28
  @context.db_path.parent.to_s
29
29
  when "base_directory"
30
30
  @context.base_directory.to_s
31
+ when "plugins_directory"
32
+ @context.plugins_directory.to_s
33
+ when "libtool_directory"
34
+ @context.libtool_directory
35
+ when "plugin_extension"
36
+ @context.plugin_extension
31
37
  else
32
38
  matched
33
39
  end
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2012-2018 Kouhei Sutou <kou@clear-code.com>
1
+ # Copyright (C) 2012-2019 Kouhei Sutou <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
@@ -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.3.2"
17
+ VERSION = "1.3.3"
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.3.2
4
+ version: 1.3.3
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: 2019-05-09 00:00:00.000000000 Z
12
+ date: 2019-05-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: diff-lcs