2018-09-12 10:21:24 -04:00
|
|
|
# frozen_string_literal: true
|
2018-09-12 09:15:43 -04:00
|
|
|
|
2012-11-26 06:16:22 -05:00
|
|
|
require 'abstract_type'
|
2015-02-18 21:31:11 -05:00
|
|
|
require 'adamantium'
|
|
|
|
require 'anima'
|
|
|
|
require 'concord'
|
2012-08-16 12:02:03 -04:00
|
|
|
require 'diff/lcs'
|
|
|
|
require 'diff/lcs/hunk'
|
2018-11-11 16:17:08 -05:00
|
|
|
require 'digest/sha1'
|
2018-11-11 16:17:09 -05:00
|
|
|
require 'etc'
|
2015-02-18 21:31:11 -05:00
|
|
|
require 'equalizer'
|
|
|
|
require 'ice_nine'
|
2014-02-02 16:48:08 -05:00
|
|
|
require 'morpher'
|
2014-08-10 18:09:29 -04:00
|
|
|
require 'open3'
|
2015-04-07 18:57:02 -04:00
|
|
|
require 'optparse'
|
2015-02-18 21:31:11 -05:00
|
|
|
require 'parser'
|
|
|
|
require 'parser/current'
|
|
|
|
require 'pathname'
|
2016-07-24 17:39:59 -04:00
|
|
|
require 'regexp_parser'
|
2015-02-18 21:31:11 -05:00
|
|
|
require 'set'
|
|
|
|
require 'stringio'
|
|
|
|
require 'unparser'
|
2012-07-27 16:39:31 -04:00
|
|
|
|
2014-10-08 11:00:46 -04:00
|
|
|
# This setting is done to make errors within the parallel
|
|
|
|
# reporter / execution visible in the main thread.
|
|
|
|
Thread.abort_on_exception = true
|
|
|
|
|
2012-07-23 16:54:35 -04:00
|
|
|
# Library namespace
|
2015-11-15 18:13:43 -05:00
|
|
|
#
|
|
|
|
# @api private
|
2012-07-23 16:54:35 -04:00
|
|
|
module Mutant
|
2015-06-06 18:29:47 -04:00
|
|
|
EMPTY_STRING = ''.freeze
|
|
|
|
EMPTY_ARRAY = [].freeze
|
2015-10-09 00:35:23 -04:00
|
|
|
EMPTY_HASH = {}.freeze
|
2014-06-09 21:51:33 -04:00
|
|
|
SCOPE_OPERATOR = '::'.freeze
|
2014-06-08 14:03:11 -04:00
|
|
|
|
2014-08-11 13:52:51 -04:00
|
|
|
# Test if CI is detected via environment
|
|
|
|
#
|
|
|
|
# @return [Boolean]
|
|
|
|
def self.ci?
|
|
|
|
ENV.key?('CI')
|
|
|
|
end
|
2013-07-21 16:19:41 -04:00
|
|
|
end # Mutant
|
2012-07-23 16:54:35 -04:00
|
|
|
|
2013-08-02 19:44:58 -04:00
|
|
|
require 'mutant/version'
|
2014-06-30 09:06:57 -04:00
|
|
|
require 'mutant/env'
|
2014-12-22 09:42:20 -05:00
|
|
|
require 'mutant/env/bootstrap'
|
2016-07-24 19:07:15 -04:00
|
|
|
require 'mutant/util'
|
2016-07-24 17:39:59 -04:00
|
|
|
require 'mutant/registry'
|
2014-06-29 17:25:17 -04:00
|
|
|
require 'mutant/ast'
|
|
|
|
require 'mutant/ast/sexp'
|
|
|
|
require 'mutant/ast/types'
|
|
|
|
require 'mutant/ast/nodes'
|
|
|
|
require 'mutant/ast/named_children'
|
|
|
|
require 'mutant/ast/node_predicates'
|
2016-07-24 17:39:59 -04:00
|
|
|
require 'mutant/ast/regexp'
|
|
|
|
require 'mutant/ast/regexp/transformer'
|
|
|
|
require 'mutant/ast/regexp/transformer/direct'
|
2018-09-28 04:23:09 -04:00
|
|
|
require 'mutant/ast/regexp/transformer/named_group'
|
2016-07-24 17:39:59 -04:00
|
|
|
require 'mutant/ast/regexp/transformer/options_group'
|
2018-09-28 04:23:09 -04:00
|
|
|
require 'mutant/ast/regexp/transformer/quantifier'
|
|
|
|
require 'mutant/ast/regexp/transformer/recursive'
|
2016-07-24 17:39:59 -04:00
|
|
|
require 'mutant/ast/regexp/transformer/root'
|
2018-09-28 04:23:09 -04:00
|
|
|
require 'mutant/ast/regexp/transformer/text'
|
2014-06-29 17:25:17 -04:00
|
|
|
require 'mutant/ast/meta'
|
2015-08-19 20:26:42 -04:00
|
|
|
require 'mutant/ast/meta/send'
|
2015-10-09 00:58:59 -04:00
|
|
|
require 'mutant/ast/meta/const'
|
2015-08-19 19:30:35 -04:00
|
|
|
require 'mutant/ast/meta/symbol'
|
2015-08-19 20:26:42 -04:00
|
|
|
require 'mutant/ast/meta/optarg'
|
|
|
|
require 'mutant/ast/meta/resbody'
|
2015-08-19 03:50:33 -04:00
|
|
|
require 'mutant/ast/meta/restarg'
|
2014-10-23 07:37:53 -04:00
|
|
|
require 'mutant/actor'
|
|
|
|
require 'mutant/actor/receiver'
|
|
|
|
require 'mutant/actor/sender'
|
|
|
|
require 'mutant/actor/mailbox'
|
|
|
|
require 'mutant/actor/env'
|
2015-11-12 23:47:47 -05:00
|
|
|
require 'mutant/parser'
|
2015-05-31 18:13:07 -04:00
|
|
|
require 'mutant/isolation'
|
2016-02-14 16:11:32 -05:00
|
|
|
require 'mutant/isolation/none'
|
|
|
|
require 'mutant/isolation/fork'
|
2014-12-08 19:10:31 -05:00
|
|
|
require 'mutant/parallel'
|
|
|
|
require 'mutant/parallel/master'
|
|
|
|
require 'mutant/parallel/worker'
|
|
|
|
require 'mutant/parallel/source'
|
2014-03-29 16:18:23 -04:00
|
|
|
require 'mutant/warning_filter'
|
2014-04-04 08:38:06 -04:00
|
|
|
require 'mutant/require_highjack'
|
2012-08-15 22:09:14 -04:00
|
|
|
require 'mutant/mutation'
|
2015-11-21 17:02:51 -05:00
|
|
|
require 'mutant/mutator'
|
2012-12-06 14:44:26 -05:00
|
|
|
require 'mutant/mutator/util'
|
2012-12-29 14:12:48 -05:00
|
|
|
require 'mutant/mutator/util/array'
|
|
|
|
require 'mutant/mutator/util/symbol'
|
2012-12-06 15:30:28 -05:00
|
|
|
require 'mutant/mutator/node'
|
2013-07-04 19:21:07 -04:00
|
|
|
require 'mutant/mutator/node/generic'
|
2016-07-24 17:39:59 -04:00
|
|
|
require 'mutant/mutator/node/regexp'
|
2016-08-14 18:58:08 -04:00
|
|
|
require 'mutant/mutator/node/regexp/alternation_meta'
|
2016-10-09 21:45:42 -04:00
|
|
|
require 'mutant/mutator/node/regexp/capture_group'
|
2016-05-24 01:16:00 -04:00
|
|
|
require 'mutant/mutator/node/regexp/character_type'
|
2016-10-09 18:48:00 -04:00
|
|
|
require 'mutant/mutator/node/regexp/end_of_line_anchor'
|
2016-10-09 19:36:46 -04:00
|
|
|
require 'mutant/mutator/node/regexp/end_of_string_or_before_end_of_line_anchor'
|
2016-10-09 23:23:28 -04:00
|
|
|
require 'mutant/mutator/node/regexp/greedy_zero_or_more'
|
2012-12-06 15:30:28 -05:00
|
|
|
require 'mutant/mutator/node/literal'
|
|
|
|
require 'mutant/mutator/node/literal/boolean'
|
|
|
|
require 'mutant/mutator/node/literal/range'
|
|
|
|
require 'mutant/mutator/node/literal/symbol'
|
|
|
|
require 'mutant/mutator/node/literal/string'
|
2017-07-06 03:45:17 -04:00
|
|
|
require 'mutant/mutator/node/literal/integer'
|
2012-12-06 15:30:28 -05:00
|
|
|
require 'mutant/mutator/node/literal/float'
|
|
|
|
require 'mutant/mutator/node/literal/array'
|
|
|
|
require 'mutant/mutator/node/literal/hash'
|
|
|
|
require 'mutant/mutator/node/literal/regex'
|
|
|
|
require 'mutant/mutator/node/literal/nil'
|
2013-06-04 17:44:17 -04:00
|
|
|
require 'mutant/mutator/node/argument'
|
|
|
|
require 'mutant/mutator/node/arguments'
|
2013-06-04 16:16:04 -04:00
|
|
|
require 'mutant/mutator/node/begin'
|
2013-12-29 17:04:28 -05:00
|
|
|
require 'mutant/mutator/node/binary'
|
2013-07-24 00:57:39 -04:00
|
|
|
require 'mutant/mutator/node/const'
|
2013-09-08 00:28:37 -04:00
|
|
|
require 'mutant/mutator/node/dstr'
|
2013-09-08 11:17:47 -04:00
|
|
|
require 'mutant/mutator/node/dsym'
|
2013-11-03 23:51:55 -05:00
|
|
|
require 'mutant/mutator/node/kwbegin'
|
2013-07-23 02:54:54 -04:00
|
|
|
require 'mutant/mutator/node/named_value/access'
|
2013-07-23 03:23:21 -04:00
|
|
|
require 'mutant/mutator/node/named_value/constant_assignment'
|
2013-07-23 03:03:57 -04:00
|
|
|
require 'mutant/mutator/node/named_value/variable_assignment'
|
2014-06-06 09:06:50 -04:00
|
|
|
require 'mutant/mutator/node/next'
|
|
|
|
require 'mutant/mutator/node/break'
|
2013-07-28 16:25:43 -04:00
|
|
|
require 'mutant/mutator/node/noop'
|
2014-06-04 12:09:24 -04:00
|
|
|
require 'mutant/mutator/node/or_asgn'
|
2014-06-05 12:37:31 -04:00
|
|
|
require 'mutant/mutator/node/and_asgn'
|
|
|
|
require 'mutant/mutator/node/defined'
|
2013-09-08 02:03:25 -04:00
|
|
|
require 'mutant/mutator/node/op_asgn'
|
2013-12-29 16:32:26 -05:00
|
|
|
require 'mutant/mutator/node/conditional_loop'
|
2013-11-03 15:37:47 -05:00
|
|
|
require 'mutant/mutator/node/yield'
|
2013-01-01 17:28:21 -05:00
|
|
|
require 'mutant/mutator/node/super'
|
2013-07-23 04:02:29 -04:00
|
|
|
require 'mutant/mutator/node/zsuper'
|
2012-12-06 15:30:28 -05:00
|
|
|
require 'mutant/mutator/node/send'
|
2013-06-14 13:53:55 -04:00
|
|
|
require 'mutant/mutator/node/send/binary'
|
2016-01-23 22:49:49 -05:00
|
|
|
require 'mutant/mutator/node/send/conditional'
|
2014-04-22 13:01:46 -04:00
|
|
|
require 'mutant/mutator/node/send/attribute_assignment'
|
2013-01-04 16:16:03 -05:00
|
|
|
require 'mutant/mutator/node/when'
|
2016-07-24 20:19:26 -04:00
|
|
|
require 'mutant/mutator/node/class'
|
2012-12-06 15:30:28 -05:00
|
|
|
require 'mutant/mutator/node/define'
|
2013-06-14 14:19:53 -04:00
|
|
|
require 'mutant/mutator/node/mlhs'
|
2013-08-02 19:36:13 -04:00
|
|
|
require 'mutant/mutator/node/nthref'
|
2013-07-05 07:44:13 -04:00
|
|
|
require 'mutant/mutator/node/masgn'
|
2012-12-06 15:30:28 -05:00
|
|
|
require 'mutant/mutator/node/return'
|
2013-06-14 14:19:53 -04:00
|
|
|
require 'mutant/mutator/node/block'
|
2013-01-04 16:16:03 -05:00
|
|
|
require 'mutant/mutator/node/if'
|
2013-06-14 12:22:34 -04:00
|
|
|
require 'mutant/mutator/node/case'
|
2013-07-15 16:25:09 -04:00
|
|
|
require 'mutant/mutator/node/splat'
|
2016-04-15 04:03:58 -04:00
|
|
|
require 'mutant/mutator/node/regopt'
|
2013-12-01 16:42:52 -05:00
|
|
|
require 'mutant/mutator/node/resbody'
|
2014-03-22 20:33:45 -04:00
|
|
|
require 'mutant/mutator/node/rescue'
|
2014-04-22 13:24:31 -04:00
|
|
|
require 'mutant/mutator/node/match_current_line'
|
2018-11-29 17:07:24 -05:00
|
|
|
require 'mutant/mutator/node/index'
|
|
|
|
require 'mutant/mutator/node/procarg_zero'
|
2013-04-17 23:31:21 -04:00
|
|
|
require 'mutant/loader'
|
2012-07-26 13:25:23 -04:00
|
|
|
require 'mutant/context'
|
2015-10-28 16:13:00 -04:00
|
|
|
require 'mutant/scope'
|
2012-08-01 12:34:03 -04:00
|
|
|
require 'mutant/subject'
|
2013-01-13 16:25:49 -05:00
|
|
|
require 'mutant/subject/method'
|
2013-07-04 18:54:50 -04:00
|
|
|
require 'mutant/subject/method/instance'
|
|
|
|
require 'mutant/subject/method/singleton'
|
2012-07-23 16:54:35 -04:00
|
|
|
require 'mutant/matcher'
|
2014-07-03 17:16:12 -04:00
|
|
|
require 'mutant/matcher/config'
|
|
|
|
require 'mutant/matcher/compiler'
|
2012-08-28 13:15:10 -04:00
|
|
|
require 'mutant/matcher/chain'
|
2012-07-23 16:54:35 -04:00
|
|
|
require 'mutant/matcher/method'
|
|
|
|
require 'mutant/matcher/method/singleton'
|
|
|
|
require 'mutant/matcher/method/instance'
|
2013-01-21 14:08:30 -05:00
|
|
|
require 'mutant/matcher/methods'
|
|
|
|
require 'mutant/matcher/namespace'
|
2013-04-20 15:16:48 -04:00
|
|
|
require 'mutant/matcher/scope'
|
2013-09-08 15:58:39 -04:00
|
|
|
require 'mutant/matcher/filter'
|
2014-02-13 10:47:29 -05:00
|
|
|
require 'mutant/matcher/null'
|
2015-10-28 16:13:00 -04:00
|
|
|
require 'mutant/matcher/static'
|
2014-05-30 21:02:15 -04:00
|
|
|
require 'mutant/expression'
|
2015-06-21 10:44:33 -04:00
|
|
|
require 'mutant/expression/parser'
|
2014-05-30 21:02:15 -04:00
|
|
|
require 'mutant/expression/method'
|
2014-06-28 18:35:19 -04:00
|
|
|
require 'mutant/expression/methods'
|
2014-05-30 21:02:15 -04:00
|
|
|
require 'mutant/expression/namespace'
|
2014-04-28 15:17:25 -04:00
|
|
|
require 'mutant/test'
|
2018-11-25 16:43:35 -05:00
|
|
|
require 'mutant/timer'
|
2014-06-28 19:04:18 -04:00
|
|
|
require 'mutant/integration'
|
2014-12-22 10:42:21 -05:00
|
|
|
require 'mutant/selector'
|
|
|
|
require 'mutant/selector/expression'
|
2014-08-17 12:22:20 -04:00
|
|
|
require 'mutant/config'
|
2012-08-28 13:15:10 -04:00
|
|
|
require 'mutant/cli'
|
2012-08-16 12:02:03 -04:00
|
|
|
require 'mutant/color'
|
2014-05-11 11:04:11 -04:00
|
|
|
require 'mutant/diff'
|
2014-07-17 09:59:25 -04:00
|
|
|
require 'mutant/runner'
|
2014-12-08 19:10:31 -05:00
|
|
|
require 'mutant/runner/sink'
|
2014-07-03 17:16:12 -04:00
|
|
|
require 'mutant/result'
|
2012-08-15 22:10:54 -04:00
|
|
|
require 'mutant/reporter'
|
|
|
|
require 'mutant/reporter/null'
|
2015-11-22 12:13:47 -05:00
|
|
|
require 'mutant/reporter/sequence'
|
2012-08-15 22:10:54 -04:00
|
|
|
require 'mutant/reporter/cli'
|
2013-06-21 11:52:53 -04:00
|
|
|
require 'mutant/reporter/cli/printer'
|
2015-05-02 20:21:30 -04:00
|
|
|
require 'mutant/reporter/cli/printer/config'
|
|
|
|
require 'mutant/reporter/cli/printer/env_progress'
|
2018-12-04 11:58:38 -05:00
|
|
|
require 'mutant/reporter/cli/printer/env_result'
|
2018-12-04 09:26:23 -05:00
|
|
|
require 'mutant/reporter/cli/printer/isolation_result'
|
2015-05-02 20:21:30 -04:00
|
|
|
require 'mutant/reporter/cli/printer/mutation_progress_result'
|
2018-12-04 11:58:38 -05:00
|
|
|
require 'mutant/reporter/cli/printer/mutation_result'
|
2015-05-02 20:21:30 -04:00
|
|
|
require 'mutant/reporter/cli/printer/status'
|
|
|
|
require 'mutant/reporter/cli/printer/status_progressive'
|
2018-12-04 11:58:38 -05:00
|
|
|
require 'mutant/reporter/cli/printer/subject_progress'
|
|
|
|
require 'mutant/reporter/cli/printer/subject_result'
|
2015-05-02 20:21:30 -04:00
|
|
|
require 'mutant/reporter/cli/printer/test_result'
|
2014-08-10 18:09:29 -04:00
|
|
|
require 'mutant/reporter/cli/tput'
|
|
|
|
require 'mutant/reporter/cli/format'
|
2015-07-12 21:06:39 -04:00
|
|
|
require 'mutant/repository'
|
2013-06-28 17:23:05 -04:00
|
|
|
require 'mutant/zombifier'
|
2014-07-03 17:16:12 -04:00
|
|
|
|
|
|
|
module Mutant
|
2014-08-07 12:00:31 -04:00
|
|
|
# Reopen class to initialize constant to avoid dep circle
|
2014-07-03 17:16:12 -04:00
|
|
|
class Config
|
|
|
|
DEFAULT = new(
|
2015-06-21 10:44:33 -04:00
|
|
|
expression_parser: Expression::Parser.new([
|
|
|
|
Expression::Method,
|
|
|
|
Expression::Methods,
|
|
|
|
Expression::Namespace::Exact,
|
|
|
|
Expression::Namespace::Recursive
|
2015-11-15 15:13:48 -05:00
|
|
|
]),
|
|
|
|
fail_fast: false,
|
|
|
|
includes: EMPTY_ARRAY,
|
|
|
|
integration: Integration::Null,
|
2016-02-14 16:11:32 -05:00
|
|
|
isolation: Mutant::Isolation::Fork.new(
|
|
|
|
devnull: ->(&block) { File.open(File::NULL, File::WRONLY, &block) },
|
|
|
|
stdout: $stdout,
|
|
|
|
stderr: $stderr,
|
|
|
|
io: IO,
|
|
|
|
marshal: Marshal,
|
|
|
|
process: Process
|
|
|
|
),
|
2018-11-11 16:17:09 -05:00
|
|
|
jobs: Etc.nprocessors,
|
2015-11-21 17:02:51 -05:00
|
|
|
kernel: Kernel,
|
|
|
|
load_path: $LOAD_PATH,
|
2015-11-15 15:13:48 -05:00
|
|
|
matcher: Matcher::Config::DEFAULT,
|
2015-11-21 17:02:51 -05:00
|
|
|
open3: Open3,
|
|
|
|
pathname: Pathname,
|
2015-11-15 15:13:48 -05:00
|
|
|
requires: EMPTY_ARRAY,
|
|
|
|
reporter: Reporter::CLI.build($stdout),
|
|
|
|
zombie: false
|
2014-07-03 17:16:12 -04:00
|
|
|
)
|
|
|
|
end # Config
|
|
|
|
end # Mutant
|