-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathRakefile
56 lines (46 loc) · 1.33 KB
/
Rakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# encoding: utf-8
require 'devtools'
Devtools.init_rake_tasks
# Remove metrics:mutant from devtools
task('metrics:mutant').clear
namespace :metrics do
allowed_versions = %w[mri-1.9.3 mri-2.0.0 mri-2.1.0 rbx-1.9.3]
enabled = begin
require 'mutant'
rescue LoadError, NotImplementedError
false
end
config = Devtools.project.mutant
enabled &&= config.enabled? && allowed_versions.include?(Devtools.rvm)
zombify = %w[
adamantium equalizer ice_nine infecto anima concord abstract_type
descendants_tracker parser rspec unparser mutant
].include?(config.name)
if enabled && !ENV['DEVTOOLS_SELF']
desc 'Measure mutation coverage'
task mutant: :coverage do
namespace = if zombify
Mutant::Zombifier.zombify
Zombie::Mutant
else
Mutant
end
namespaces = Array(config.namespace).map { |n| "::#{n}*" }
arguments = %W[
--include lib
--require #{config.name}
--ignore-subject Axiom::Types*
--use #{config.strategy}
].concat(namespaces)
status = namespace::CLI.run(arguments)
if status.nonzero?
Devtools.notify_metric_violation 'Mutant task is not successful'
end
end
else
desc 'Measure mutation coverage'
task mutant: :coverage do
$stderr.puts 'Mutant is disabled'
end
end
end