diff --git a/.gitignore b/.gitignore index a35a794b2..6c0a22ef7 100644 --- a/.gitignore +++ b/.gitignore @@ -32,7 +32,6 @@ measurements ## BUNDLER .bundle -Gemfile.lock Gemfile.*.lock ## PROJECT::SPECIFIC diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 000000000..8980f2a47 --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,167 @@ +PATH + remote: . + specs: + mutant (0.8.12) + abstract_type (~> 0.0.7) + adamantium (~> 0.2.0) + anima (~> 0.3.0) + ast (~> 2.2) + concord (~> 0.1.5) + diff-lcs (~> 1.2) + equalizer (~> 0.0.9) + ice_nine (~> 0.11.1) + memoizable (~> 0.4.2) + morpher (~> 0.2.6) + parallel (~> 1.3) + parser (~> 2.3.1, >= 2.3.1.4) + procto (~> 0.0.2) + regexp_parser (~> 0.4.1) + unparser (~> 0.2.5) + mutant-rspec (0.8.12) + mutant (~> 0.8.12) + rspec-core (>= 3.4.0, < 3.6.0) + +GEM + remote: https://rubygems.org/ + specs: + abstract_type (0.0.7) + adamantium (0.2.0) + ice_nine (~> 0.11.0) + memoizable (~> 0.4.0) + anima (0.3.0) + abstract_type (~> 0.0.7) + adamantium (~> 0.2) + equalizer (~> 0.0.11) + ast (2.3.0) + axiom-types (0.1.1) + descendants_tracker (~> 0.0.4) + ice_nine (~> 0.11.0) + thread_safe (~> 0.3, >= 0.3.1) + codeclimate-engine-rb (0.4.0) + virtus (~> 1.0) + coercible (1.0.0) + descendants_tracker (~> 0.0.1) + concord (0.1.5) + adamantium (~> 0.2.0) + equalizer (~> 0.0.9) + descendants_tracker (0.0.4) + thread_safe (~> 0.3, >= 0.3.1) + devtools (0.1.15) + adamantium (~> 0.2.0) + anima (~> 0.3.0) + concord (~> 0.1.5) + flay (~> 2.8.1) + flog (~> 4.4.0) + mutant (~> 0.8.11) + mutant-rspec (~> 0.8.11) + procto (~> 0.0.3) + rake (~> 11.3.0) + reek (~> 4.5.0) + rspec (~> 3.5.0) + rspec-core (~> 3.5.4) + rspec-its (~> 1.2.0) + rubocop (~> 0.46.0) + simplecov (~> 0.12.0) + yard (~> 0.9.1) + yardstick (~> 0.9.9) + diff-lcs (1.2.5) + docile (1.1.5) + equalizer (0.0.11) + erubis (2.7.0) + ffi (1.9.14) + flay (2.8.1) + erubis (~> 2.7.0) + path_expander (~> 1.0) + ruby_parser (~> 3.0) + sexp_processor (~> 4.0) + flog (4.4.0) + path_expander (~> 1.0) + ruby_parser (~> 3.1, > 3.1.0) + sexp_processor (~> 4.4) + ice_nine (0.11.2) + json (2.0.2) + memoizable (0.4.2) + thread_safe (~> 0.3, >= 0.3.1) + morpher (0.2.6) + abstract_type (~> 0.0.7) + adamantium (~> 0.2.0) + anima (~> 0.3.0) + ast (~> 2.2) + concord (~> 0.1.5) + equalizer (~> 0.0.9) + ice_nine (~> 0.11.0) + procto (~> 0.0.2) + parallel (1.10.0) + parser (2.3.3.1) + ast (~> 2.2) + path_expander (1.0.1) + powerpack (0.1.1) + procto (0.0.3) + rainbow (2.1.0) + rake (11.3.0) + reek (4.5.2) + codeclimate-engine-rb (~> 0.4.0) + parser (~> 2.3.1, >= 2.3.1.2) + rainbow (~> 2.0) + regexp_parser (0.4.1) + rspec (3.5.0) + rspec-core (~> 3.5.0) + rspec-expectations (~> 3.5.0) + rspec-mocks (~> 3.5.0) + rspec-core (3.5.4) + rspec-support (~> 3.5.0) + rspec-expectations (3.5.0) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.5.0) + rspec-its (1.2.0) + rspec-core (>= 3.0.0) + rspec-expectations (>= 3.0.0) + rspec-mocks (3.5.0) + diff-lcs (>= 1.2.0, < 2.0) + rspec-support (~> 3.5.0) + rspec-support (3.5.0) + rubocop (0.46.0) + parser (>= 2.3.1.1, < 3.0) + powerpack (~> 0.1) + rainbow (>= 1.99.1, < 3.0) + ruby-progressbar (~> 1.7) + unicode-display_width (~> 1.0, >= 1.0.1) + ruby-progressbar (1.8.1) + ruby_parser (3.8.3) + sexp_processor (~> 4.1) + sexp_processor (4.7.0) + simplecov (0.12.0) + docile (~> 1.1.0) + json (>= 1.8, < 3) + simplecov-html (~> 0.10.0) + simplecov-html (0.10.0) + thread_safe (0.3.5) + unicode-display_width (1.1.1) + unparser (0.2.5) + abstract_type (~> 0.0.7) + adamantium (~> 0.2.0) + concord (~> 0.1.5) + diff-lcs (~> 1.2.5) + equalizer (~> 0.0.9) + parser (~> 2.3.0) + procto (~> 0.0.2) + virtus (1.0.5) + axiom-types (~> 0.1) + coercible (~> 1.0) + descendants_tracker (~> 0.0, >= 0.0.3) + equalizer (~> 0.0, >= 0.0.9) + yard (0.9.5) + yardstick (0.9.9) + yard (~> 0.8, >= 0.8.7.2) + +PLATFORMS + ruby + +DEPENDENCIES + bundler (~> 1.10) + devtools (~> 0.1.12) + ffi (~> 1.9.6) + mutant! + +BUNDLED WITH + 1.13.6 diff --git a/circle.yml b/circle.yml index 24ef33c8a..8267a2936 100644 --- a/circle.yml +++ b/circle.yml @@ -1,10 +1,7 @@ --- machine: ruby: - version: '2.3.0' -dependencies: - pre: - - bundle -v | grep -Fx "Bundler version 1.10.6" || gem install bundler --version 1.10.6 + version: '2.3.3' test: override: - bundle exec rake ci diff --git a/config/flay.yml b/config/flay.yml index 860f29761..cb7eb82bf 100644 --- a/config/flay.yml +++ b/config/flay.yml @@ -1,3 +1,3 @@ --- threshold: 16 -total_score: 1317 +total_score: 1321 diff --git a/lib/mutant/ast/regexp.rb b/lib/mutant/ast/regexp.rb index 0d44bca44..545e80817 100644 --- a/lib/mutant/ast/regexp.rb +++ b/lib/mutant/ast/regexp.rb @@ -12,10 +12,7 @@ module Regexp # # @return [Regexp::Expression] def self.parse(regexp) - ::Regexp::Parser.parse( - regexp, - "ruby/#{RUBY_VERSION.split('.').first(2).join('.')}" - ) + ::Regexp::Parser.parse(regexp) end # Check if expression is supported by mapper diff --git a/mutant.gemspec b/mutant.gemspec index 5a069f635..b33fce51f 100644 --- a/mutant.gemspec +++ b/mutant.gemspec @@ -36,7 +36,7 @@ Gem::Specification.new do |gem| gem.add_runtime_dependency('equalizer', '~> 0.0.9') gem.add_runtime_dependency('anima', '~> 0.3.0') gem.add_runtime_dependency('concord', '~> 0.1.5') - gem.add_runtime_dependency('regexp_parser', '~> 0.3.6') + gem.add_runtime_dependency('regexp_parser', '~> 0.4.1') gem.add_development_dependency('devtools', '~> 0.1.12') gem.add_development_dependency('bundler', '~> 1.10') diff --git a/spec/integrations.yml b/spec/integrations.yml index a1525bd83..45e6e6ea0 100644 --- a/spec/integrations.yml +++ b/spec/integrations.yml @@ -2,6 +2,7 @@ - name: rubyspec namespace: Rubyspec repo_uri: 'https://github.com/ruby/rubyspec.git' + repo_ref: 'origin/master' mutation_coverage: false mutation_generation: true expected_errors: @@ -16,18 +17,23 @@ - name: regexp_parser namespace: Regexp repo_uri: 'https://github.com/ammar/regexp_parser.git' + repo_ref: 'v0.4.1' mutation_coverage: false mutation_generation: true - expected_errors: {} + expected_errors: + "Regexp::Syntax::Ruby::V233 does not implement: [escape:codepoint]": + - regexp_parser/test/parser/test_escapes.rb - name: auom namespace: AUOM repo_uri: 'https://github.com/mbj/auom.git' + repo_ref: 'origin/master' mutation_coverage: true mutation_generation: true expected_errors: {} - name: axiom namespace: Axiom repo_uri: 'https://github.com/dkubb/axiom.git' + repo_ref: 'origin/master' mutation_coverage: false mutation_generation: true expected_errors: {} diff --git a/spec/support/corpus.rb b/spec/support/corpus.rb index a9e9c6bd4..b129045b6 100644 --- a/spec/support/corpus.rb +++ b/spec/support/corpus.rb @@ -37,7 +37,8 @@ class Project :mutation_generation, :name, :namespace, - :repo_uri + :repo_uri, + :repo_ref ) # Verify mutation coverage @@ -95,18 +96,23 @@ def verify_mutation_generation def checkout return self if noinstall? TMP.mkdir unless TMP.directory? + if repo_path.exist? Dir.chdir(repo_path) do system(%w[git fetch origin]) system(%w[git reset --hard]) system(%w[git clean -f -d -x]) - system(%w[git checkout origin/master]) - system(%w[git reset --hard]) - system(%w[git clean -f -d -x]) end else system(%W[git clone #{repo_uri} #{repo_path}]) end + + Dir.chdir(repo_path) do + system(%W[git checkout #{repo_ref}]) + system(%w[git reset --hard]) + system(%w[git clean -f -d -x]) + end + self end memoize :checkout @@ -300,6 +306,7 @@ def to_h s(:guard, s(:primitive, Hash)), s(:hash_transform, s(:key_symbolize, :repo_uri, s(:guard, s(:primitive, String))), + s(:key_symbolize, :repo_ref, s(:guard, s(:primitive, String))), s(:key_symbolize, :name, s(:guard, s(:primitive, String))), s(:key_symbolize, :namespace, s(:guard, s(:primitive, String))), s(:key_symbolize, :mutation_coverage, diff --git a/spec/unit/mutant/ast/regexp/parse_spec.rb b/spec/unit/mutant/ast/regexp/parse_spec.rb index 624c6e3e8..2e22f456a 100644 --- a/spec/unit/mutant/ast/regexp/parse_spec.rb +++ b/spec/unit/mutant/ast/regexp/parse_spec.rb @@ -1,6 +1,4 @@ RSpec.describe Mutant::AST::Regexp, '.parse' do - before { stub_const('RUBY_VERSION', '2.3.9') } - it 'parses using minor ruby version' do expect(described_class.parse(/foo/).to_re).to eql(/foo/) end