crude-mutant 0.4.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/exe/cm +12 -2
- data/exe/crude-mutant +16 -9
- data/lib/crude_mutant/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e1d22dde8953db74b48cd4c0bca71e803d4c5fbf490638a7e13b8c5a84d4d03f
|
4
|
+
data.tar.gz: b0e0d539020fd0cc2cd76d84ebf1e09b7cdb2533fd546b3a528efbdc2544f16e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7d396763825de1a0dd548365d3bb3baa26a35832f777de6553b2dab1d89fe1ecd11fc6d527e1d23253242c7540f5dad0278f62cf4484f8953946738509dca68d
|
7
|
+
data.tar.gz: 6e113726b3e9dcd783e01ec188012fca59316d8b6ae5d644d2f4de01867876ec5e2b71f27dcd432609edd73e535e7dd99f7eda4710f50824f47970de66e46336
|
data/Gemfile.lock
CHANGED
data/exe/cm
CHANGED
@@ -11,6 +11,8 @@ Options = Struct.new(
|
|
11
11
|
:use_json_printer,
|
12
12
|
:section,
|
13
13
|
:section_total,
|
14
|
+
:test_command,
|
15
|
+
:file_to_mutate,
|
14
16
|
)
|
15
17
|
|
16
18
|
args = Options.new(false, 1, 1)
|
@@ -28,6 +30,14 @@ OptionParser.new do |opts|
|
|
28
30
|
opts.on("-sSECTION_TOTAL", "--name=SECTION_TOTAL", "Number of total sectionswhen parallelizing") do |s|
|
29
31
|
args.section_total = s
|
30
32
|
end
|
33
|
+
|
34
|
+
opts.on("-cTEST_COMMAND", "--name=TEST_COMMAND", "Test command to run") do |t|
|
35
|
+
args.test_command = t
|
36
|
+
end
|
37
|
+
|
38
|
+
opts.on("-fFILE_TO_MUTATE", "--file=FILE_TO_MUTATE", "File to mutate for each run") do |t|
|
39
|
+
args.file_to_mutate = t
|
40
|
+
end
|
31
41
|
end.parse!
|
32
42
|
|
33
43
|
if !file_to_mutate || !test_command
|
@@ -41,9 +51,9 @@ end
|
|
41
51
|
printer = args.use_json_printer ? :json : :standard
|
42
52
|
|
43
53
|
if printer == :json
|
44
|
-
CrudeMutant.start(file_to_mutate, test_command, result_printer: printer, section: args.section, total_sections: args.section_total)
|
54
|
+
CrudeMutant.start(args.file_to_mutate, args.test_command, result_printer: printer, section: args.section, total_sections: args.section_total)
|
45
55
|
else
|
46
|
-
CrudeMutant.start(file_to_mutate, test_command, result_printer: printer, section: args.section, total_sections: args.section_total) do |progress|
|
56
|
+
CrudeMutant.start(args.file_to_mutate, args.test_command, result_printer: printer, section: args.section, total_sections: args.section_total) do |progress|
|
47
57
|
clear_string = ' ' * CrudeMutant::TerminalCalculator.new.calculate_length
|
48
58
|
$stdout.print clear_string
|
49
59
|
$stdout.print "\r"
|
data/exe/crude-mutant
CHANGED
@@ -4,18 +4,17 @@
|
|
4
4
|
require "crude-mutant"
|
5
5
|
require "optparse"
|
6
6
|
|
7
|
-
file_to_mutate = ARGV.pop
|
8
|
-
test_command = ARGV.pop
|
9
|
-
|
10
7
|
Options = Struct.new(
|
11
8
|
:use_json_printer,
|
12
9
|
:section,
|
13
10
|
:section_total,
|
11
|
+
:test_command,
|
12
|
+
:file_to_mutate,
|
14
13
|
)
|
15
14
|
|
16
15
|
args = Options.new(false, 1, 1)
|
17
16
|
OptionParser.new do |opts|
|
18
|
-
opts.banner = "Usage: crude-mutant [options]
|
17
|
+
opts.banner = "Usage: crude-mutant [options]"
|
19
18
|
|
20
19
|
opts.on("-j", "--json", "Print JSON out to STDOUT") do |v|
|
21
20
|
args.use_json_printer = v
|
@@ -28,22 +27,30 @@ OptionParser.new do |opts|
|
|
28
27
|
opts.on("-sSECTION_TOTAL", "--name=SECTION_TOTAL", "Number of total sectionswhen parallelizing") do |s|
|
29
28
|
args.section_total = s
|
30
29
|
end
|
30
|
+
|
31
|
+
opts.on("-cTEST_COMMAND", "--test_command=TEST_COMMAND", "Test command to run") do |t|
|
32
|
+
args.test_command = t
|
33
|
+
end
|
34
|
+
|
35
|
+
opts.on("-fFILE_TO_MUTATE", "--file=FILE_TO_MUTATE", "File to mutate for each run") do |t|
|
36
|
+
args.file_to_mutate = t
|
37
|
+
end
|
31
38
|
end.parse!
|
32
39
|
|
33
|
-
if !file_to_mutate || !test_command
|
34
|
-
puts "Usage: crude-mutant [
|
40
|
+
if !args.file_to_mutate || !args.test_command
|
41
|
+
puts "Usage: crude-mutant [options]"
|
35
42
|
puts ""
|
36
43
|
puts "Example:"
|
37
|
-
puts " crude-mutant
|
44
|
+
puts " crude-mutant --test_command=\"bundle exec rspec\" --file=app/models/post.rb"
|
38
45
|
exit(1)
|
39
46
|
end
|
40
47
|
|
41
48
|
printer = args.use_json_printer ? :json : :standard
|
42
49
|
|
43
50
|
if printer == :json
|
44
|
-
CrudeMutant.start(file_to_mutate, test_command, result_printer: printer, section: args.section, total_sections: args.section_total)
|
51
|
+
CrudeMutant.start(args.file_to_mutate, args.test_command, result_printer: printer, section: args.section, total_sections: args.section_total)
|
45
52
|
else
|
46
|
-
CrudeMutant.start(file_to_mutate, test_command, result_printer: printer, section: args.section, total_sections: args.section_total) do |progress|
|
53
|
+
CrudeMutant.start(args.file_to_mutate, args.test_command, result_printer: printer, section: args.section, total_sections: args.section_total) do |progress|
|
47
54
|
clear_string = ' ' * CrudeMutant::TerminalCalculator.new.calculate_length
|
48
55
|
$stdout.print clear_string
|
49
56
|
$stdout.print "\r"
|
data/lib/crude_mutant/version.rb
CHANGED