/usr/bin/heckle is in libheckle-ruby1.8 1.4.3-2.1ubuntu1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
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 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 | #!/usr/bin/ruby1.8
$:.unshift File.join(File.dirname(__FILE__), *%w[.. lib])
require 'test_unit_heckler'
require 'optparse'
force = false
nodes = Heckle::MUTATABLE_NODES
opts = OptionParser.new do |opts|
opts.banner = "Usage: #{File.basename($0)} class_name [method_name]"
opts.on("-v", "--verbose", "Loudly explain heckle run") do |opt|
TestUnitHeckler.debug = true
end
opts.on("-V", "--version", "Prints Heckle's version number") do |opt|
puts "Heckle #{Heckle::VERSION}"
exit 0
end
opts.on("-t", "--tests TEST_PATTERN",
"Location of tests (glob)") do |pattern|
TestUnitHeckler.test_pattern = pattern
end
opts.on("-F", "--force", "Ignore initial test failures",
"Best used with --focus") do |opt|
force = true
end
opts.on( "--assignments", "Only mutate assignments") do |opt|
puts "!"*70
puts "!!! Heckling assignments only"
puts "!"*70
puts
nodes = Heckle::ASGN_NODES
end
opts.on("-b", "--branches", "Only mutate branches") do |opt|
puts "!"*70
puts "!!! Heckling branches only"
puts "!"*70
puts
nodes = Heckle::BRANCH_NODES
end
opts.on("-f", "--focus", "Apply the eye of sauron") do |opt|
puts "!"*70
puts "!!! Running in focused mode. FEEL THE EYE OF SAURON!!!"
puts "!"*70
puts
TestUnitHeckler.focus = true
end
opts.on("-T", "--timeout SECONDS", "The maximum time for a test run in seconds",
"Used to catch infinite loops") do |timeout|
Heckle.timeout = timeout.to_i
puts "Setting timeout at #{timeout} seconds."
end
opts.on("-n", "--nodes NODES", "Nodes to mutate",
"Possible values: #{Heckle::MUTATABLE_NODES.join(',')}") do |opt|
nodes = opt.split(',').collect {|n| n.to_sym }
puts "Mutating nodes: #{nodes.inspect}"
end
opts.on("-x", "--exclude-nodes NODES", "Nodes to exclude") do |opt|
exclusions = opt.split(',').collect {|n| n.to_sym }
nodes = nodes - exclusions
puts "Mutating without nodes: #{exclusions.inspect}"
end
opts.on("-h", "--help", "Show this message") do |opt|
puts opts
exit 0
end
end
looks_like_rails = test ?f, 'config/environment.rb'
TestUnitHeckler.test_pattern = "test/**/*.rb" if looks_like_rails
opts.parse!
impl = ARGV.shift
meth = ARGV.shift
unless impl then
puts opts
exit 1
end
exit TestUnitHeckler.validate(impl, meth, nodes, force)
|