Adjust flay/flog scores

This commit is contained in:
Markus Schirp 2013-08-04 23:03:39 +02:00
parent 75260e509f
commit 5f49582b4b
4 changed files with 30 additions and 34 deletions

View file

@ -1,3 +1,3 @@
--- ---
threshold: 16 threshold: 16
total_score: 758 total_score: 739

View file

@ -1,2 +1,2 @@
--- ---
threshold: 20.5 threshold: 20.0

View file

@ -59,6 +59,7 @@ module Mutant
def config def config
Config.new( Config.new(
:cache => @cache, :cache => @cache,
:zombie => @zombie,
:debug => debug?, :debug => debug?,
:matcher => matcher, :matcher => matcher,
:filter => filter, :filter => filter,
@ -154,26 +155,6 @@ module Mutant
@filters << klass.new(filter) @filters << klass.new(filter)
end end
# Set fail fast
#
# @api private
#
# @return [undefined]
#
def set_fail_fast
@fail_fast = true
end
# Set debug mode
#
# @api private
#
# @return [undefined]
#
def set_debug
@debug = true
end
# Set strategy # Set strategy
# #
# @param [Strategy] strategy # @param [Strategy] strategy
@ -204,8 +185,6 @@ module Mutant
builder.separator '' builder.separator ''
builder.separator 'Strategies:' builder.separator 'Strategies:'
builder.on('--zombie', 'Run mutant zombified')
add_strategies(builder) add_strategies(builder)
add_options(builder) add_options(builder)
end end
@ -237,7 +216,7 @@ module Mutant
# Add strategies # Add strategies
# #
# @param [Object] # @param [Object] opts
# #
# @return [undefined] # @return [undefined]
# #
@ -258,9 +237,27 @@ module Mutant
end end
end end
# Add environmental options
#
# @param [Object] opts
#
# @return [undefined]
#
# @api private
#
def add_environmental_options(opts)
opts.on('--zombie', 'Run mutant zombified') do
@zombie = true
end.on('-I', 'Add directory to $LOAD_PATH') do |directory|
$LOAD_PATH << directory
end.on('-r', '--require NAME', 'Require file with NAME') do |name|
require name
end
end
# Add options # Add options
# #
# @param [Object] # @param [Object] opts
# #
# @return [undefined] # @return [undefined]
# #
@ -271,18 +268,16 @@ module Mutant
opts.separator 'Options:' opts.separator 'Options:'
opts.on('--version', 'Print mutants version') do |name| opts.on('--version', 'Print mutants version') do |name|
puts "mutant-#{Mutant::VERSION}" puts("mutant-#{Mutant::VERSION}")
Kernel.exit(0) Kernel.exit(0)
end.on('-r', '--require NAME', 'Require file with NAME') do |name|
require name
end.on('--code FILTER', 'Adds a code filter') do |filter| end.on('--code FILTER', 'Adds a code filter') do |filter|
add_filter Mutation::Filter::Code, filter add_filter(Mutation::Filter::Code, filter)
end.on('--fail-fast', 'Fail fast') do end.on('--fail-fast', 'Fail fast') do
set_fail_fast @fail_fast = true
end.on('-d', '--debug', 'Enable debugging output') do end.on('-d', '--debug', 'Enable debugging output') do
set_debug @debug = true
end.on_tail('-h', '--help', 'Show this message') do end.on_tail('-h', '--help', 'Show this message') do
puts opts puts(opts)
exit exit
end end
end end

View file

@ -4,7 +4,8 @@ module Mutant
# The configuration of a mutator run # The configuration of a mutator run
class Config class Config
include Adamantium::Flat, Anima.new( include Adamantium::Flat, Anima.new(
:cache, :debug, :strategy, :matcher, :filter, :reporter, :fail_fast :cache, :debug, :strategy, :matcher, :filter,
:reporter, :fail_fast, :zombie
) )
# Enumerate subjects # Enumerate subjects