@@ -224,14 +224,18 @@ def validate_defines(_config)
224224 # - FOO
225225 # - BAR
226226
227+ # These contexts support filename matchers optionally. Others can only contain simple lists
228+ contexts_supporting_matchers = [ :test , :preprocess ]
229+ contexts_supporting_matchers << :gcov if ( _config && _config [ :plugins ] && _config [ :plugins ] [ :enabled ] && _config [ :plugins ] [ :enabled ] . include? ( 'gcov' ) )
230+
227231 defines . each_pair do |context , config |
228232 walk = @reportinator . generate_config_walk ( [ :defines , context ] )
229233
230234 # Special handling for configuration setting, not a hash context container
231235 next if context == :use_test_definition
232236
233237 # Matcher contexts (only contexts that support matcher hashes)
234- if context == :test or context == :preprocess
238+ if contexts_supporting_matchers . include? context
235239 if config . class != Array and config . class != Hash
236240 msg = "#{ walk } entry '#{ config } ' must be a list or matcher, not #{ config . class . to_s . downcase } (see docs for examples)"
237241 @loginator . log ( msg , Verbosity ::ERRORS )
@@ -414,6 +418,10 @@ def validate_flags(_config)
414418 # :<matcher>:
415419 # - --flag
416420
421+ # These contexts support filename matchers optionally. Others can only contain simple lists
422+ contexts_supporting_matchers = [ :test ]
423+ contexts_supporting_matchers << :gcov if ( _config && _config [ :plugins ] && _config [ :plugins ] [ :enabled ] && _config [ :plugins ] [ :enabled ] . include? ( 'gcov' ) )
424+
417425 flags . each_pair do |context , operations |
418426 operations . each_pair do |operation , config |
419427 walk = @reportinator . generate_config_walk ( [ :flags , context , operation ] )
@@ -427,7 +435,7 @@ def validate_flags(_config)
427435 end
428436
429437 # :test context operations with lists or matchers (hashes)
430- if context == :test
438+ if contexts_supporting_matchers . include? context
431439 if config . class != Array and config . class != Hash
432440 msg = "#{ walk } entry '#{ config } ' must be a list or matcher hash, not #{ config . class . to_s . downcase } (see docs for examples)"
433441 @loginator . log ( msg , Verbosity ::ERRORS )
0 commit comments