grntest 1.4.1 → 1.4.2

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: 8e90468027680b461a1633c49db9f3feb7babd1a0c2e81a4aad381ade35b4fb3
4
- data.tar.gz: 31b1cc050ea4b70ed08082a0b5443586676aa5d77c0512287736ee1837b4c371
3
+ metadata.gz: 72bf123c2803dad061e343733c748d2c66ce4fb649e146cf089707b28bc24eb7
4
+ data.tar.gz: 808f8b5ede307bab1f5e3e933944e487113b8f22272fe6226d3411986e9a2eac
5
5
  SHA512:
6
- metadata.gz: f8067b106d13ebd121cd96d43eb82b807adb81fe89ea26df1ea4eeb8dfdd6be096e14fdbeeb6ca00528d5704d0d53d6123e28d45973fb5bb283990c59101e090
7
- data.tar.gz: b8eb794be911a7dc8b7eb74172b4cb109cafe74a945cfc3ca3e626d90a54a36ca61058c91883238b579d4c0a92578a58d46b2aff4a7dbb1c4086059a0109245e
6
+ metadata.gz: e39d5e003dd5ad5d48aa71b64b306c882413a27d873fb95c130cc00b5c4538271363f3a04cb44cfdd535a591c1c98479cc41a2558d5a0c7854bbb3793b6ce9b0
7
+ data.tar.gz: c39924d196aa19cbdf0db12a7660ac6ed7b545e78b6c6852261b9f178b4acc899ba3c8f9ee875042f2700849a2ef3b3db915d72805f5a47552d6c8d358e593c7
@@ -1,5 +1,16 @@
1
1
  # News
2
2
 
3
+ ## 1.4.2: 2020-05-30
4
+
5
+ ### Improvements
6
+
7
+ * Removed log level normalization.
8
+
9
+ * Added `require-platform` directive.
10
+
11
+ * Added support for normalizing IO open/close log message with
12
+ additional message.
13
+
3
14
  ## 1.4.1: 2020-05-30
4
15
 
5
16
  ### Improvements
@@ -37,6 +37,7 @@ module Grntest
37
37
  attr_writer :suppress_backtrace
38
38
  attr_writer :collect_query_log
39
39
  attr_writer :debug
40
+ attr_accessor :platform
40
41
  def initialize
41
42
  @logging = true
42
43
  @base_directory = Pathname(".")
@@ -66,6 +67,7 @@ module Grntest
66
67
  @suppress_backtrace = true
67
68
  @collect_query_log = false
68
69
  @debug = false
70
+ @platform = guess_platform
69
71
  end
70
72
 
71
73
  def logging?
@@ -173,5 +175,18 @@ module Grntest
173
175
  "so"
174
176
  end
175
177
  end
178
+
179
+ def guess_platform
180
+ case RUBY_PLATFORM
181
+ when /mingw|mswin/
182
+ "windows"
183
+ when /darwin/
184
+ "macos"
185
+ when /linux/
186
+ "linux"
187
+ else
188
+ "unknown"
189
+ end
190
+ end
176
191
  end
177
192
  end
@@ -374,6 +374,19 @@ module Grntest
374
374
  @ignore_log_patterns.delete(pattern)
375
375
  end
376
376
 
377
+ def execute_directive_require_platform(parser, line, content, options)
378
+ platform, = options
379
+ if platform.start_with?("!")
380
+ if @context.platform == platform[1..-1]
381
+ omit("require platform: #{platform} (#{@context.platform})")
382
+ end
383
+ else
384
+ if @context.platform != platform
385
+ omit("require platform: #{platform} (#{@context.platform})")
386
+ end
387
+ end
388
+ end
389
+
377
390
  def execute_directive(parser, line, content)
378
391
  command, *options = Shellwords.split(content)
379
392
  case command
@@ -421,6 +434,8 @@ module Grntest
421
434
  execute_directive_add_ignore_log_pattern(parser, line, content, options)
422
435
  when "remove-ignore-log-pattern"
423
436
  execute_directive_remove_ignore_log_pattern(parser, line, content, options)
437
+ when "require-platform"
438
+ execute_directive_require_platform(parser, line, content, options)
424
439
  else
425
440
  log_input(line)
426
441
  log_error("#|e| unknown directive: <#{command}>")
@@ -544,14 +559,15 @@ module Grntest
544
559
 
545
560
  def normalize_log(entry)
546
561
  case entry.message
547
- when /\A(\[io\]\[(?:open|close)\]) <(.*?)>\z/
562
+ when /\A(\[io\]\[(?:open|close)\]) (.*?)<(.*?)>\z/
548
563
  tag = $1
549
- path = $2
564
+ io_message = $2
565
+ path = $3
550
566
  normalized_path = File.basename(path)
551
- normalized_message = "#{tag} <#{normalized_path}>"
567
+ normalized_message = "#{tag} #{io_message}<#{normalized_path}>"
552
568
  case entry.log_level
553
- when :info, :debug
554
- normalized_log_level = :debug
569
+ when :information, :debug
570
+ normalized_log_level = :dump
555
571
  else
556
572
  normalized_log_level = entry.log_level
557
573
  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.4.1"
17
+ VERSION = "1.4.2"
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.1
4
+ version: 1.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kouhei Sutou