grntest 1.4.5 → 1.4.6

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
  SHA256:
3
- metadata.gz: 3903fe505e64094eb8951ddcca8e346e328da5a71c11eb2b9d30cca76618377a
4
- data.tar.gz: f3dd540ee69267c74c6af70275f5a9630b9454bae75dce1ab6b8bf335efd80eb
3
+ metadata.gz: 88fbad2fdde680dc3110737087f9818240bd130ea4c61c14478d89577dd99420
4
+ data.tar.gz: e98f331062e055f4fd914ef1916dc4859614e1ef0c9f3a16c978d00d73d05a23
5
5
  SHA512:
6
- metadata.gz: bec42dc8095c0f04ad0b3fb9c269e021b9986cf9a9cb606c37e39359a13f3fd0e63c5eaffb75d7881c62adc389be9ab8ff266005407377af604aadf6531fbc7c
7
- data.tar.gz: 30c5648429bf14591dd25ee5eca20228303423db9e925204fdbedc4abafaf1d623237ed0d339f7120a76ab7c5ddd9bb9568d4b943ec4b6586ecc454656b460db
6
+ metadata.gz: 4e51b3927eb61e1232ade4c179a140eddd68d41d5231f4bee0e7b356cce389d8b72c110f5217418d9e214fa071486bd3ffe55e61e2e9def19b90b425e193e2ca
7
+ data.tar.gz: bd7a5ad8f297572b51f797f359ae2c42d9a01a013d6c48c6d3e168d648bf32af405ec0f8af36f1e0fef84a86756ccb2b918988a35696ed3af505e50dd23350bc
@@ -1,5 +1,11 @@
1
1
  # News
2
2
 
3
+ ## 1.4.6: 2020-12-08
4
+
5
+ ### Improvements
6
+
7
+ * Added `require-feature` directive.
8
+
3
9
  ## 1.4.5: 2020-11-11
4
10
 
5
11
  ### Improvements
@@ -45,6 +45,8 @@ module Grntest
45
45
  @custom_important_log_levels = []
46
46
  @ignore_log_patterns = {}
47
47
  @sleep_after_command = nil
48
+ @status_response = nil
49
+ @features = nil
48
50
  end
49
51
 
50
52
  def execute(script_path)
@@ -397,6 +399,33 @@ module Grntest
397
399
  @sleep_after_command = time
398
400
  end
399
401
 
402
+ def features
403
+ return @features if @features
404
+ @features = []
405
+ JSON.parse(@status_response)[1]["features"].each do |name, available|
406
+ @features << name if available
407
+ end
408
+ @features.sort!
409
+ @features
410
+ end
411
+
412
+ def formatted_features
413
+ features.join(", ")
414
+ end
415
+
416
+ def execute_directive_require_feature(line, content, options)
417
+ feature, = options
418
+ if feature.start_with?("!")
419
+ if features.include?(feature[1..-1])
420
+ omit("require feature: #{feature} (#{formatted_features})")
421
+ end
422
+ else
423
+ unless features.include?(feature)
424
+ omit("require feature: #{feature} (#{formatted_features})")
425
+ end
426
+ end
427
+ end
428
+
400
429
  def execute_directive(parser, line, content)
401
430
  command, *options = Shellwords.split(content)
402
431
  case command
@@ -448,6 +477,8 @@ module Grntest
448
477
  execute_directive_require_platform(line, content, options)
449
478
  when "sleep-after-command"
450
479
  execute_directive_sleep_after_command(line, content, options)
480
+ when "require-feature"
481
+ execute_directive_require_feature(line, content, options)
451
482
  else
452
483
  log_input(line)
453
484
  log_error("#|e| unknown directive: <#{command}>")
@@ -61,7 +61,7 @@ module Grntest
61
61
  def ensure_groonga_ready
62
62
  n_retried = 0
63
63
  begin
64
- send_command(command("status"))
64
+ @status_response = send_command(command("status"))
65
65
  rescue Error
66
66
  n_retried += 1
67
67
  sleep(0.1)
@@ -44,7 +44,7 @@ module Grntest
44
44
  def ensure_groonga_ready
45
45
  @input.print("status\n")
46
46
  @input.flush
47
- @output.gets
47
+ @status_response = @output.gets
48
48
  end
49
49
 
50
50
  def create_sub_executor(context)
@@ -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.4.5"
17
+ VERSION = "1.4.6"
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.4.5
4
+ version: 1.4.6
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: 2020-11-11 00:00:00.000000000 Z
12
+ date: 2020-12-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: diff-lcs