mutant 0.9.12 → 0.9.13

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: 71f2d39499ffdc3adced885c60b9b22220e409f360fce5ab8ac0aaeb36bdbda3
4
- data.tar.gz: dee6aa26ddce9e06949566dfc75d4daf295ec76ea46903af80b0ac4027f338ac
3
+ metadata.gz: 8a634036241e157b66b8778d1645bca99d67cd81fa26042c42e43f868bafa260
4
+ data.tar.gz: ee46dcacd412e10634454dbdd5ec52d5a803c71fa8e9db9cc3fcdc35e35a8e5c
5
5
  SHA512:
6
- metadata.gz: e6a44765e6fec377e0f4d9e3047832468af386b34f5d7a231fb940802a97977bba6000b016ca6739f402314bf03027dd8852776ff1ee687d6e67fb6168d5416a
7
- data.tar.gz: 9d696a03e4a86c8838fa73ab147a75dac9f8f14b1f20eef653b30a3758c4044f016f4444f94827738d6bd39d05fdd9cddafdcfbd2a6475c2ebbc8674f005738d
6
+ metadata.gz: b0d20d48dc5443ba2347c176425ec372ed2d4e2f11e0bea33c59895b9b52d00b4efcdd07e8f9b47eefbd2ebd8f20d610f3ed3a726d9d59bbed1378b2be2fea1f
7
+ data.tar.gz: e4ad2f3d626eaae68f390447ad94cdf1338525f010f684f524873cfab6560d25ffb67062f6f2567750c9468670241d5180ba1a8bcc32fe7e42fc16cd3ff2c4ef
@@ -36,7 +36,7 @@ module Mutant
36
36
  .tap(&method(:infect))
37
37
  .with(matchable_scopes: matchable_scopes(world, config))
38
38
 
39
- subjects = Matcher.from_config(env.config.matcher).call(env)
39
+ subjects = start_subject(env, Matcher.from_config(env.config.matcher).call(env))
40
40
 
41
41
  Integration.setup(env).fmap do |integration|
42
42
  env.with(
@@ -49,6 +49,19 @@ module Mutant
49
49
  end
50
50
  # rubocop:enable Metrics/MethodLength
51
51
 
52
+ def self.start_subject(env, subjects)
53
+ start_expressions = env.config.matcher.start_expressions
54
+
55
+ return subjects if start_expressions.empty?
56
+
57
+ subjects.drop_while do |subject|
58
+ start_expressions.none? do |expression|
59
+ expression.prefix?(subject.expression)
60
+ end
61
+ end
62
+ end
63
+ private_class_method :start_subject
64
+
52
65
  def self.infect(env)
53
66
  config, world = env.config, env.world
54
67
 
@@ -2,6 +2,8 @@
2
2
 
3
3
  module Mutant
4
4
  # Commandline parser / runner
5
+ #
6
+ # rubocop:disable Metrics/ClassLength
5
7
  class CLI
6
8
  include Concord.new(:world, :config)
7
9
 
@@ -126,6 +128,9 @@ module Mutant
126
128
  opts.on('--ignore-subject EXPRESSION', 'Ignore subjects that match EXPRESSION as prefix') do |pattern|
127
129
  add_matcher(:ignore_expressions, config.expression_parser.apply(pattern).from_right)
128
130
  end
131
+ opts.on('--start-subject EXPRESSION', 'Start mutation testing at a specific subject') do |pattern|
132
+ add_matcher(:start_expressions, config.expression_parser.apply(pattern).from_right)
133
+ end
129
134
  opts.on('--since REVISION', 'Only select subjects touched since REVISION') do |revision|
130
135
  add_matcher(
131
136
  :subject_filters,
@@ -165,4 +170,5 @@ module Mutant
165
170
  with(matcher: config.matcher.add(attribute, value))
166
171
  end
167
172
  end # CLI
173
+ # rubocop:enable Metrics/ClassLength
168
174
  end # Mutant
@@ -7,6 +7,7 @@ module Mutant
7
7
  include Adamantium, Anima.new(
8
8
  :ignore_expressions,
9
9
  :match_expressions,
10
+ :start_expressions,
10
11
  :subject_filters
11
12
  )
12
13
 
@@ -18,6 +19,7 @@ module Mutant
18
19
  PRESENTATIONS = IceNine.deep_freeze(
19
20
  ignore_expressions: :syntax,
20
21
  match_expressions: :syntax,
22
+ start_expressions: :syntax,
21
23
  subject_filters: :inspect
22
24
  )
23
25
  private_constant(*constants(false))
@@ -28,7 +28,7 @@ module Mutant
28
28
  * Bug in your test suite
29
29
  * Bug in your test suite under concurrency
30
30
 
31
- The following exception was raised:
31
+ The following exception was raised while reading the killfork result:
32
32
 
33
33
  ```
34
34
  %s
@@ -60,8 +60,8 @@ module Mutant
60
60
  #
61
61
  # @return [undefined]
62
62
  def run
63
- __send__(MAP.fetch(object.class))
64
63
  print_log_messages
64
+ __send__(MAP.fetch(object.class))
65
65
  end
66
66
 
67
67
  private
@@ -73,7 +73,13 @@ module Mutant
73
73
  def print_log_messages
74
74
  log = object.log
75
75
 
76
- puts(LOG_MESSAGES % log) unless log.empty?
76
+ return if log.empty?
77
+
78
+ puts('Log messages (combined stderr and stdout):')
79
+
80
+ log.each_line do |line|
81
+ puts('[killfork] %<line>s' % { line: line })
82
+ end
77
83
  end
78
84
 
79
85
  def visit_child_error
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Mutant
4
4
  # Current mutant version
5
- VERSION = '0.9.12'
5
+ VERSION = '0.9.13'
6
6
  end # Mutant
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mutant
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.12
4
+ version: 0.9.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Markus Schirp
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-09-10 00:00:00.000000000 Z
11
+ date: 2020-10-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: abstract_type
@@ -468,7 +468,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
468
468
  - !ruby/object:Gem::Version
469
469
  version: '0'
470
470
  requirements: []
471
- rubygems_version: 3.0.3
471
+ rubygems_version: 3.1.2
472
472
  signing_key:
473
473
  specification_version: 4
474
474
  summary: ''