m 1.3.4 → 1.4.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/.travis.yml +2 -0
- data/Appraisals +4 -0
- data/Gemfile +4 -0
- data/Rakefile +20 -8
- data/benchmarks/20150505-benchmark.log +28 -0
- data/benchmarks/20150927-benchmark.log +36 -0
- data/gemfiles/minitest4.gemfile +2 -2
- data/gemfiles/minitest4.gemfile.lock +13 -4
- data/gemfiles/minitest5.gemfile +2 -2
- data/gemfiles/minitest5.gemfile.lock +10 -4
- data/gemfiles/test_unit_gem.gemfile +8 -0
- data/gemfiles/test_unit_gem.gemfile.lock +85 -0
- data/lib/m/executor.rb +14 -15
- data/lib/m/frameworks.rb +4 -4
- data/lib/m/runners/minitest_5.rb +3 -1
- data/lib/m/runners/test_unit.rb +13 -1
- data/lib/version.rb +1 -1
- data/m.gemspec +3 -3
- data/test/allocations.rb +23 -0
- data/test/bench.rb +10 -2
- data/test/everything_test.rb +5 -1
- data/test/examples/minitest_5_example_test.rb +2 -0
- data/test/examples/test_unit_example_test.rb +3 -0
- data/test/minitest_5_test.rb +6 -0
- data/test/test_helper.rb +24 -5
- data/test/test_unit_test.rb +8 -8
- metadata +33 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9436a8da214c3991f21610d54d7f9a97e14835f7
|
4
|
+
data.tar.gz: 0d67da2b4de31c4cc41b8796e9e0c41482f36cc8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 21a7165beb196aec53eff14edff1334d9c065324825c69643a41ce1e71e22e1dd9f82fbbd27ad7c6c1a0c70c33ef5443e39b0a86fe0ae33edd8a116ad2659692
|
7
|
+
data.tar.gz: 8ed90bc2beaa7b33002243af5938db5c25f3809962eb228a2d8e43c52e13ac1c43698d32986b5b34c2438b651d73c32eb5b0d9b9a14a09c94672c3205f5251e4
|
data/.travis.yml
CHANGED
@@ -2,9 +2,11 @@ rvm:
|
|
2
2
|
- 2.0.0
|
3
3
|
- 2.1.0
|
4
4
|
- 2.2.0
|
5
|
+
- jruby-1.7.21
|
5
6
|
install:
|
6
7
|
- bundle install
|
7
8
|
- bundle --gemfile=gemfiles/minitest5.gemfile
|
8
9
|
- bundle --gemfile=gemfiles/minitest4.gemfile
|
10
|
+
- bundle --gemfile=gemfiles/test_unit_gem.gemfile
|
9
11
|
script:
|
10
12
|
- bundle exec rake tests
|
data/Appraisals
CHANGED
data/Gemfile
CHANGED
data/Rakefile
CHANGED
@@ -3,9 +3,9 @@ require 'rubygems'
|
|
3
3
|
require 'bundler/setup'
|
4
4
|
require 'appraisal'
|
5
5
|
require 'coveralls'
|
6
|
-
require
|
6
|
+
require 'bundler/gem_tasks'
|
7
7
|
require 'rake/clean'
|
8
|
-
require
|
8
|
+
require 'rake/testtask'
|
9
9
|
|
10
10
|
task :default => [:test]
|
11
11
|
|
@@ -17,21 +17,33 @@ end
|
|
17
17
|
|
18
18
|
desc 'Run all tests and get merged test coverage'
|
19
19
|
task :tests do
|
20
|
-
system "
|
21
|
-
system "appraisal
|
20
|
+
system "rake test" or exit!(1)
|
21
|
+
system "appraisal minitest4 rake test" or exit!(1)
|
22
|
+
system "appraisal minitest5 rake test TEST=test/minitest_5_test.rb" or exit!(1)
|
23
|
+
system "appraisal test_unit_gem rake test TEST=test/test_unit_test.rb" or exit!(1)
|
22
24
|
Coveralls.push!
|
23
25
|
end
|
24
26
|
|
25
27
|
desc 'Run simple benchmarks'
|
26
28
|
task :bench do
|
27
|
-
|
29
|
+
current_commit = `git rev-parse HEAD`
|
30
|
+
file_name = "benchmarks/#{Time.now.strftime('%Y%m%d')}-benchmark.log"
|
31
|
+
exec "echo -e 'Data for commit: #{current_commit}' > #{file_name} && ruby test/bench.rb >> #{file_name}"
|
28
32
|
end
|
29
33
|
|
30
34
|
# ROCCO ===============================================================
|
31
35
|
|
32
|
-
|
33
|
-
require '
|
34
|
-
|
36
|
+
begin
|
37
|
+
require 'rdiscount'
|
38
|
+
rescue LoadError => e
|
39
|
+
warn e.inspect
|
40
|
+
end
|
41
|
+
begin
|
42
|
+
require 'rocco/tasks'
|
43
|
+
Rocco::make 'docs/'
|
44
|
+
rescue LoadError => e
|
45
|
+
warn e.inspect
|
46
|
+
end
|
35
47
|
|
36
48
|
desc 'Build rocco docs'
|
37
49
|
task :docs => :rocco
|
@@ -0,0 +1,28 @@
|
|
1
|
+
653927eae75f5ca814e2760a64849658a8d99a1f
|
2
|
+
|
3
|
+
Calculating -------------------------------------
|
4
|
+
running m on a file that doesn't exist
|
5
|
+
1.000 i/100ms
|
6
|
+
running m on an empty file
|
7
|
+
1.000 i/100ms
|
8
|
+
running m on an entire file with minitest5
|
9
|
+
1.000 i/100ms
|
10
|
+
running m on an entire file with minitest4
|
11
|
+
1.000 i/100ms
|
12
|
+
running m on a specific test with minitest4
|
13
|
+
1.000 i/100ms
|
14
|
+
running m on a specific test with minitest5
|
15
|
+
1.000 i/100ms
|
16
|
+
-------------------------------------------------
|
17
|
+
running m on a file that doesn't exist
|
18
|
+
3.171 (± 0.0%) i/s - 16.000
|
19
|
+
running m on an empty file
|
20
|
+
1.911 (± 0.0%) i/s - 10.000
|
21
|
+
running m on an entire file with minitest5
|
22
|
+
0.737 (± 0.0%) i/s - 4.000 in 5.429737s
|
23
|
+
running m on an entire file with minitest4
|
24
|
+
0.757 (± 0.0%) i/s - 4.000 in 5.284200s
|
25
|
+
running m on a specific test with minitest4
|
26
|
+
0.741 (± 0.0%) i/s - 4.000 in 5.397341s
|
27
|
+
running m on a specific test with minitest5
|
28
|
+
0.741 (± 0.0%) i/s - 4.000 in 5.398335s
|
@@ -0,0 +1,36 @@
|
|
1
|
+
-e Data for commit: 6978a0778228cf1a96de0e41de0457969ddf4720
|
2
|
+
|
3
|
+
Calculating -------------------------------------
|
4
|
+
running m on a file that doesn't exist
|
5
|
+
1.000 i/100ms
|
6
|
+
running m on an empty file
|
7
|
+
1.000 i/100ms
|
8
|
+
running m on an entire file with minitest4
|
9
|
+
1.000 i/100ms
|
10
|
+
running m on an entire file with minitest5
|
11
|
+
1.000 i/100ms
|
12
|
+
running m on an entire file with test-unit gem
|
13
|
+
1.000 i/100ms
|
14
|
+
running m on a specific test with minitest4
|
15
|
+
1.000 i/100ms
|
16
|
+
running m on a specific test with minitest5
|
17
|
+
1.000 i/100ms
|
18
|
+
running m on a specific test with test-unit gem
|
19
|
+
1.000 i/100ms
|
20
|
+
-------------------------------------------------
|
21
|
+
running m on a file that doesn't exist
|
22
|
+
2.400 (± 0.0%) i/s - 13.000 in 5.417140s
|
23
|
+
running m on an empty file
|
24
|
+
1.579 (± 0.0%) i/s - 8.000
|
25
|
+
running m on an entire file with minitest4
|
26
|
+
0.554 (± 0.0%) i/s - 3.000 in 5.419503s
|
27
|
+
running m on an entire file with minitest5
|
28
|
+
0.557 (± 0.0%) i/s - 3.000 in 5.387670s
|
29
|
+
running m on an entire file with test-unit gem
|
30
|
+
0.536 (± 0.0%) i/s - 3.000 in 5.596156s
|
31
|
+
running m on a specific test with minitest4
|
32
|
+
0.559 (± 0.0%) i/s - 3.000 in 5.367341s
|
33
|
+
running m on a specific test with minitest5
|
34
|
+
0.555 (± 0.0%) i/s - 3.000 in 5.410256s
|
35
|
+
running m on a specific test with test-unit gem
|
36
|
+
0.537 (± 0.0%) i/s - 3.000 in 5.583095s
|
data/gemfiles/minitest4.gemfile
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: ../
|
3
3
|
specs:
|
4
|
-
m (1.3.
|
4
|
+
m (1.3.4)
|
5
5
|
method_source (>= 0.6.7)
|
6
6
|
rake (>= 0.9.2.2)
|
7
7
|
|
@@ -18,6 +18,7 @@ GEM
|
|
18
18
|
bundler
|
19
19
|
rake
|
20
20
|
atomic (1.1.14)
|
21
|
+
atomic (1.1.14-java)
|
21
22
|
coveralls (0.8.1)
|
22
23
|
json (~> 1.8)
|
23
24
|
rest-client (>= 1.6.8, < 2)
|
@@ -31,15 +32,16 @@ GEM
|
|
31
32
|
domain_name (~> 0.5)
|
32
33
|
i18n (0.6.9)
|
33
34
|
json (1.8.2)
|
35
|
+
json (1.8.2-java)
|
34
36
|
method_source (0.8.2)
|
35
37
|
mime-types (2.5)
|
36
38
|
minitest (4.7.5)
|
37
39
|
multi_json (1.8.4)
|
38
|
-
mustache (0.
|
40
|
+
mustache (1.0.2)
|
39
41
|
netrc (0.10.3)
|
40
42
|
rake (10.1.1)
|
41
|
-
rdiscount (1.
|
42
|
-
redcarpet (3.
|
43
|
+
rdiscount (2.1.8)
|
44
|
+
redcarpet (3.3.2)
|
43
45
|
rest-client (1.8.0)
|
44
46
|
http-cookie (>= 1.0.2, < 2.0)
|
45
47
|
mime-types (>= 1.16, < 3.0)
|
@@ -57,13 +59,17 @@ GEM
|
|
57
59
|
thor (0.19.1)
|
58
60
|
thread_safe (0.1.3)
|
59
61
|
atomic
|
62
|
+
thread_safe (0.1.3-java)
|
63
|
+
atomic
|
60
64
|
tins (1.5.1)
|
61
65
|
tzinfo (0.3.38)
|
62
66
|
unf (0.1.4)
|
63
67
|
unf_ext
|
68
|
+
unf (0.1.4-java)
|
64
69
|
unf_ext (0.0.7.1)
|
65
70
|
|
66
71
|
PLATFORMS
|
72
|
+
java
|
67
73
|
ruby
|
68
74
|
|
69
75
|
DEPENDENCIES
|
@@ -74,3 +80,6 @@ DEPENDENCIES
|
|
74
80
|
minitest (= 4.7.5)
|
75
81
|
rdiscount
|
76
82
|
rocco
|
83
|
+
|
84
|
+
BUNDLED WITH
|
85
|
+
1.10.6
|
data/gemfiles/minitest5.gemfile
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: ../
|
3
3
|
specs:
|
4
|
-
m (1.3.
|
4
|
+
m (1.3.4)
|
5
5
|
method_source (>= 0.6.7)
|
6
6
|
rake (>= 0.9.2.2)
|
7
7
|
|
@@ -27,15 +27,16 @@ GEM
|
|
27
27
|
domain_name (~> 0.5)
|
28
28
|
i18n (0.6.9)
|
29
29
|
json (1.8.2)
|
30
|
+
json (1.8.2-java)
|
30
31
|
method_source (0.8.2)
|
31
32
|
mime-types (2.5)
|
32
33
|
minitest (5.3.1)
|
33
34
|
multi_json (1.8.4)
|
34
|
-
mustache (0.
|
35
|
+
mustache (1.0.2)
|
35
36
|
netrc (0.10.3)
|
36
37
|
rake (10.1.1)
|
37
|
-
rdiscount (1.
|
38
|
-
redcarpet (3.
|
38
|
+
rdiscount (2.1.8)
|
39
|
+
redcarpet (3.3.2)
|
39
40
|
rest-client (1.8.0)
|
40
41
|
http-cookie (>= 1.0.2, < 2.0)
|
41
42
|
mime-types (>= 1.16, < 3.0)
|
@@ -54,9 +55,11 @@ GEM
|
|
54
55
|
tins (1.5.1)
|
55
56
|
unf (0.1.4)
|
56
57
|
unf_ext
|
58
|
+
unf (0.1.4-java)
|
57
59
|
unf_ext (0.0.7.1)
|
58
60
|
|
59
61
|
PLATFORMS
|
62
|
+
java
|
60
63
|
ruby
|
61
64
|
|
62
65
|
DEPENDENCIES
|
@@ -67,3 +70,6 @@ DEPENDENCIES
|
|
67
70
|
minitest
|
68
71
|
rdiscount
|
69
72
|
rocco
|
73
|
+
|
74
|
+
BUNDLED WITH
|
75
|
+
1.10.6
|
@@ -0,0 +1,85 @@
|
|
1
|
+
PATH
|
2
|
+
remote: ../
|
3
|
+
specs:
|
4
|
+
m (1.3.4)
|
5
|
+
method_source (>= 0.6.7)
|
6
|
+
rake (>= 0.9.2.2)
|
7
|
+
|
8
|
+
GEM
|
9
|
+
remote: https://rubygems.org/
|
10
|
+
specs:
|
11
|
+
activesupport (4.2.3)
|
12
|
+
i18n (~> 0.7)
|
13
|
+
json (~> 1.7, >= 1.7.7)
|
14
|
+
minitest (~> 5.1)
|
15
|
+
thread_safe (~> 0.3, >= 0.3.4)
|
16
|
+
tzinfo (~> 1.1)
|
17
|
+
appraisal (2.0.2)
|
18
|
+
bundler
|
19
|
+
rake
|
20
|
+
thor (>= 0.14.0)
|
21
|
+
coveralls (0.8.2)
|
22
|
+
json (~> 1.8)
|
23
|
+
rest-client (>= 1.6.8, < 2)
|
24
|
+
simplecov (~> 0.10.0)
|
25
|
+
term-ansicolor (~> 1.3)
|
26
|
+
thor (~> 0.19.1)
|
27
|
+
docile (1.1.5)
|
28
|
+
domain_name (0.5.24)
|
29
|
+
unf (>= 0.0.5, < 1.0.0)
|
30
|
+
http-cookie (1.0.2)
|
31
|
+
domain_name (~> 0.5)
|
32
|
+
i18n (0.7.0)
|
33
|
+
json (1.8.3)
|
34
|
+
json (1.8.3-java)
|
35
|
+
method_source (0.8.2)
|
36
|
+
mime-types (2.6.1)
|
37
|
+
minitest (5.7.0)
|
38
|
+
mustache (1.0.2)
|
39
|
+
netrc (0.10.3)
|
40
|
+
power_assert (0.2.4)
|
41
|
+
rake (10.4.2)
|
42
|
+
rdiscount (2.1.8)
|
43
|
+
redcarpet (3.3.2)
|
44
|
+
rest-client (1.8.0)
|
45
|
+
http-cookie (>= 1.0.2, < 2.0)
|
46
|
+
mime-types (>= 1.16, < 3.0)
|
47
|
+
netrc (~> 0.7)
|
48
|
+
rocco (0.8.2)
|
49
|
+
mustache
|
50
|
+
redcarpet
|
51
|
+
simplecov (0.10.0)
|
52
|
+
docile (~> 1.1.0)
|
53
|
+
json (~> 1.8)
|
54
|
+
simplecov-html (~> 0.10.0)
|
55
|
+
simplecov-html (0.10.0)
|
56
|
+
term-ansicolor (1.3.2)
|
57
|
+
tins (~> 1.0)
|
58
|
+
test-unit (3.1.2)
|
59
|
+
power_assert
|
60
|
+
thor (0.19.1)
|
61
|
+
thread_safe (0.3.5)
|
62
|
+
thread_safe (0.3.5-java)
|
63
|
+
tins (1.5.4)
|
64
|
+
tzinfo (1.2.2)
|
65
|
+
thread_safe (~> 0.1)
|
66
|
+
unf (0.1.4)
|
67
|
+
unf_ext
|
68
|
+
unf (0.1.4-java)
|
69
|
+
unf_ext (0.0.7.1)
|
70
|
+
|
71
|
+
PLATFORMS
|
72
|
+
java
|
73
|
+
ruby
|
74
|
+
|
75
|
+
DEPENDENCIES
|
76
|
+
activesupport
|
77
|
+
appraisal
|
78
|
+
coveralls
|
79
|
+
m!
|
80
|
+
rdiscount
|
81
|
+
rocco
|
82
|
+
test-unit
|
83
|
+
|
84
|
+
BUNDLED WITH
|
85
|
+
1.10.6
|
data/lib/m/executor.rb
CHANGED
@@ -53,18 +53,18 @@ module M
|
|
53
53
|
# Memoize it since it's unnecessary to do this more than one for a given file.
|
54
54
|
def tests
|
55
55
|
@tests ||= begin
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
56
|
+
require "m/test_collection"
|
57
|
+
require "m/test_method"
|
58
|
+
# With each suite and array of tests,
|
59
|
+
# and with each test method present in this test file,
|
60
|
+
# shove a new test method into this collection.
|
61
|
+
suites.inject(TestCollection.new) do |collection, (suite_class, test_methods)|
|
62
|
+
test_methods.each do |test_method|
|
63
|
+
collection << TestMethod.create(suite_class, test_method)
|
64
|
+
end
|
65
|
+
collection
|
66
|
+
end
|
67
|
+
end
|
68
68
|
end
|
69
69
|
|
70
70
|
|
@@ -75,7 +75,7 @@ module M
|
|
75
75
|
|
76
76
|
begin
|
77
77
|
# Fire up this Ruby file. Let's hope it actually has tests.
|
78
|
-
|
78
|
+
require "./#{testable.file}"
|
79
79
|
rescue LoadError => e
|
80
80
|
# Fail with a happier error message instead of spitting out a backtrace from this gem
|
81
81
|
STDERR.puts "Failed loading test file:\n#{e.message}"
|
@@ -85,12 +85,11 @@ module M
|
|
85
85
|
suites = runner.suites
|
86
86
|
|
87
87
|
# Use some janky internal APIs to group test methods by test suite.
|
88
|
-
suites.
|
88
|
+
suites.each_with_object({}) do |suite_class, test_suites|
|
89
89
|
# End up with a hash of suite class name to an array of test methods, so we can later find them and ignore empty test suites
|
90
90
|
if runner.test_methods(suite_class).any?
|
91
91
|
test_suites[suite_class] = runner.test_methods(suite_class)
|
92
92
|
end
|
93
|
-
test_suites
|
94
93
|
end
|
95
94
|
end
|
96
95
|
|
data/lib/m/frameworks.rb
CHANGED
@@ -19,15 +19,15 @@ module M
|
|
19
19
|
private
|
20
20
|
|
21
21
|
def minitest5?
|
22
|
-
|
22
|
+
self.class.minitest5?
|
23
23
|
end
|
24
24
|
|
25
25
|
def minitest4?
|
26
|
-
|
26
|
+
self.class.minitest4?
|
27
27
|
end
|
28
28
|
|
29
29
|
def test_unit?
|
30
|
-
|
30
|
+
self.class.test_unit?
|
31
31
|
end
|
32
32
|
|
33
33
|
def self.minitest5?
|
@@ -39,7 +39,7 @@ module M
|
|
39
39
|
end
|
40
40
|
|
41
41
|
def self.test_unit?
|
42
|
-
defined?(Test)
|
42
|
+
defined?(Test::Unit)
|
43
43
|
end
|
44
44
|
end
|
45
45
|
end
|
data/lib/m/runners/minitest_5.rb
CHANGED
data/lib/m/runners/test_unit.rb
CHANGED
@@ -2,12 +2,24 @@ module M
|
|
2
2
|
module Runners
|
3
3
|
class TestUnit < Base
|
4
4
|
def suites
|
5
|
-
Test::Unit::TestCase.test_suites
|
5
|
+
if Test::Unit::TestCase.respond_to?(:test_suites)
|
6
|
+
Test::Unit::TestCase.test_suites
|
7
|
+
else
|
8
|
+
Test::Unit::TestCase::DESCENDANTS
|
9
|
+
end
|
6
10
|
end
|
7
11
|
|
8
12
|
def run(test_arguments)
|
9
13
|
Test::Unit::AutoRunner.run(false, nil, test_arguments)
|
10
14
|
end
|
15
|
+
|
16
|
+
def test_methods(suite_class)
|
17
|
+
if suite_class.respond_to?(:test_methods)
|
18
|
+
suite_class.test_methods
|
19
|
+
else
|
20
|
+
suite_class.public_instance_methods(true).grep(/^test/).map { |m| m.to_s }
|
21
|
+
end
|
22
|
+
end
|
11
23
|
end
|
12
24
|
end
|
13
25
|
end
|
data/lib/version.rb
CHANGED
data/m.gemspec
CHANGED
@@ -16,11 +16,11 @@ Gem::Specification.new do |gem|
|
|
16
16
|
gem.add_runtime_dependency "rake", ">= 0.9.2.2"
|
17
17
|
|
18
18
|
gem.add_development_dependency "activesupport"
|
19
|
-
gem.add_development_dependency "rdiscount"
|
20
|
-
gem.add_development_dependency "rocco"
|
19
|
+
gem.add_development_dependency "rdiscount" unless defined? JRUBY_VERSION
|
20
|
+
gem.add_development_dependency "rocco" unless defined? JRUBY_VERSION
|
21
21
|
gem.add_development_dependency "appraisal"
|
22
22
|
|
23
23
|
gem.required_ruby_version = ">= 1.9"
|
24
24
|
|
25
|
-
gem.summary = description = %q{Run test/unit tests by line number. Metal!}
|
25
|
+
gem.summary = gem.description = %q{Run test/unit tests by line number. Metal!}
|
26
26
|
end
|
data/test/allocations.rb
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
$LOAD_PATH.unshift 'lib'
|
2
|
+
require 'm'
|
3
|
+
require 'allocation_stats'
|
4
|
+
|
5
|
+
def benchmark_allocations(burn: 1)
|
6
|
+
stats = AllocationStats.new(burn: burn).trace do
|
7
|
+
yield
|
8
|
+
end
|
9
|
+
|
10
|
+
columns = if ENV['DETAIL']
|
11
|
+
[:sourcefile, :sourceline, :class_plus]
|
12
|
+
else
|
13
|
+
[:class_plus]
|
14
|
+
end
|
15
|
+
|
16
|
+
puts stats.allocations(alias_paths: true).group_by(*columns).sort_by_size.to_text
|
17
|
+
end
|
18
|
+
|
19
|
+
benchmark_allocations do
|
20
|
+
10.times do
|
21
|
+
M::Runner.new(['test/examples/minitest_5_example_test.rb:19']).run
|
22
|
+
end
|
23
|
+
end
|
data/test/bench.rb
CHANGED
@@ -9,12 +9,16 @@ Benchmark.ips do |bench|
|
|
9
9
|
`ruby -Ilib ./bin/m test/examples/empty_example_test.rb 2>/dev/null`
|
10
10
|
end
|
11
11
|
|
12
|
+
bench.report("running m on an entire file with minitest4") do
|
13
|
+
`appraisal minitest4 ruby -Ilib ./bin/m test/examples/minitest_4_example_test.rb 2>/dev/null`
|
14
|
+
end
|
15
|
+
|
12
16
|
bench.report("running m on an entire file with minitest5") do
|
13
17
|
`appraisal minitest5 ruby -Ilib ./bin/m test/examples/minitest_5_example_test.rb 2>/dev/null`
|
14
18
|
end
|
15
19
|
|
16
|
-
bench.report("running m on an entire file with
|
17
|
-
`appraisal
|
20
|
+
bench.report("running m on an entire file with test-unit gem") do
|
21
|
+
`appraisal test_unit_gem ruby -Ilib ./bin/m test/examples/test_unit_example_test.rb 2>/dev/null`
|
18
22
|
end
|
19
23
|
|
20
24
|
bench.report("running m on a specific test with minitest4") do
|
@@ -24,4 +28,8 @@ Benchmark.ips do |bench|
|
|
24
28
|
bench.report("running m on a specific test with minitest5") do
|
25
29
|
`appraisal minitest5 ruby -Ilib ./bin/m test/examples/minitest_5_example_test.rb:19 2>/dev/null`
|
26
30
|
end
|
31
|
+
|
32
|
+
bench.report("running m on a specific test with test-unit gem") do
|
33
|
+
`appraisal test_unit_gem ruby -Ilib ./bin/m test/examples/test_unit_example_test.rb:15 2>/dev/null`
|
34
|
+
end
|
27
35
|
end
|
data/test/everything_test.rb
CHANGED
@@ -10,7 +10,11 @@ class EverythingTest < MTest
|
|
10
10
|
output = m('examples/thisdoesnexist_test.rb')
|
11
11
|
assert !$?.success?
|
12
12
|
assert_match(/Failed loading test file/, output)
|
13
|
-
|
13
|
+
if defined? JRUBY_VERSION
|
14
|
+
assert_match(/no such file to load/, output)
|
15
|
+
else
|
16
|
+
assert_match(/cannot load such file/, output)
|
17
|
+
end
|
14
18
|
end
|
15
19
|
|
16
20
|
def test_running_tests_within_a_subdirectory
|
data/test/minitest_5_test.rb
CHANGED
@@ -34,5 +34,11 @@ if M::Frameworks.minitest5?
|
|
34
34
|
assert_match %r{ test_that_kitty_can_eat: m examples/minitest_5_example_test\.rb:19}, output
|
35
35
|
assert_match %r{test_that_it_will_not_blend: m examples/minitest_5_example_test\.rb:23}, output
|
36
36
|
end
|
37
|
+
|
38
|
+
def test_run_with_after_run_block
|
39
|
+
output = m('examples/minitest_5_example_test.rb')
|
40
|
+
|
41
|
+
assert_output(/ran after run block/, output)
|
42
|
+
end
|
37
43
|
end
|
38
44
|
end
|
data/test/test_helper.rb
CHANGED
@@ -1,5 +1,9 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
begin
|
2
|
+
require 'coveralls'
|
3
|
+
Coveralls.wear_merged!
|
4
|
+
rescue LoadError
|
5
|
+
warn "gem 'coveralls' not available, proceeding without it"
|
6
|
+
end
|
3
7
|
|
4
8
|
module Testable
|
5
9
|
def m(arguments)
|
@@ -15,10 +19,25 @@ module Testable
|
|
15
19
|
end
|
16
20
|
|
17
21
|
require 'm'
|
18
|
-
|
22
|
+
|
23
|
+
def try_loading(gem)
|
24
|
+
begin
|
25
|
+
require gem
|
26
|
+
rescue LoadError
|
27
|
+
return false
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
try_loading('test-unit') ||
|
32
|
+
try_loading('minitest/autorun') ||
|
33
|
+
try_loading('test/unit')
|
34
|
+
|
19
35
|
if M::Frameworks.test_unit?
|
20
|
-
|
21
|
-
|
36
|
+
begin
|
37
|
+
require 'test-unit'
|
38
|
+
rescue LoadError
|
39
|
+
require('active_support/test_case')
|
40
|
+
end
|
22
41
|
|
23
42
|
class MTest < Test::Unit::TestCase
|
24
43
|
include ::Testable
|
data/test/test_unit_test.rb
CHANGED
@@ -3,7 +3,7 @@ require 'test_helper'
|
|
3
3
|
if M::Frameworks.test_unit?
|
4
4
|
class TestUnitTest < MTest
|
5
5
|
def test_run_simple_test_by_line_number
|
6
|
-
output = m('examples/test_unit_example_test.rb:
|
6
|
+
output = m('examples/test_unit_example_test.rb:9')
|
7
7
|
assert_output(/1 tests, 1 assertions/, output)
|
8
8
|
end
|
9
9
|
|
@@ -13,27 +13,27 @@ if M::Frameworks.test_unit?
|
|
13
13
|
end
|
14
14
|
|
15
15
|
def test_run_inside_of_test
|
16
|
-
output = m('examples/test_unit_example_test.rb:
|
16
|
+
output = m('examples/test_unit_example_test.rb:10')
|
17
17
|
assert_output(/1 tests, 1 assertions/, output)
|
18
18
|
end
|
19
19
|
|
20
20
|
def test_run_on_end_of_test
|
21
|
-
output = m('examples/test_unit_example_test.rb:
|
21
|
+
output = m('examples/test_unit_example_test.rb:11')
|
22
22
|
assert_output(/1 tests, 1 assertions/, output)
|
23
23
|
end
|
24
24
|
|
25
25
|
def test_run_inside_big_test
|
26
|
-
output = m('examples/test_unit_example_test.rb:
|
26
|
+
output = m('examples/test_unit_example_test.rb:15')
|
27
27
|
assert_output(/1 tests, 3 assertions/, output)
|
28
28
|
end
|
29
29
|
|
30
30
|
def test_run_on_blank_line
|
31
|
-
output = m('examples/test_unit_example_test.rb:
|
31
|
+
output = m('examples/test_unit_example_test.rb:8')
|
32
32
|
|
33
33
|
assert !$?.success?
|
34
|
-
assert_match(/No tests found on line
|
35
|
-
assert_match(%r{ test_apple: m examples/test_unit_example_test\.rb:
|
36
|
-
assert_match(%r{test_banana: m examples/test_unit_example_test\.rb:
|
34
|
+
assert_match(/No tests found on line 8. Valid tests to run:/, output)
|
35
|
+
assert_match(%r{ test_apple: m examples/test_unit_example_test\.rb:9}, output)
|
36
|
+
assert_match(%r{test_banana: m examples/test_unit_example_test\.rb:13}, output)
|
37
37
|
end
|
38
38
|
end
|
39
39
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: m
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nick Quaranto
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-09-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: method_source
|
@@ -94,7 +94,7 @@ dependencies:
|
|
94
94
|
- - ">="
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '0'
|
97
|
-
description:
|
97
|
+
description: Run test/unit tests by line number. Metal!
|
98
98
|
email:
|
99
99
|
- nick@quaran.to
|
100
100
|
executables:
|
@@ -111,11 +111,15 @@ files:
|
|
111
111
|
- README.md
|
112
112
|
- Rakefile
|
113
113
|
- benchmarks/20150430-benchmark.log
|
114
|
+
- benchmarks/20150505-benchmark.log
|
115
|
+
- benchmarks/20150927-benchmark.log
|
114
116
|
- bin/m
|
115
117
|
- gemfiles/minitest4.gemfile
|
116
118
|
- gemfiles/minitest4.gemfile.lock
|
117
119
|
- gemfiles/minitest5.gemfile
|
118
120
|
- gemfiles/minitest5.gemfile.lock
|
121
|
+
- gemfiles/test_unit_gem.gemfile
|
122
|
+
- gemfiles/test_unit_gem.gemfile.lock
|
119
123
|
- lib/m.rb
|
120
124
|
- lib/m/executor.rb
|
121
125
|
- lib/m/frameworks.rb
|
@@ -134,6 +138,7 @@ files:
|
|
134
138
|
- rush.jpg
|
135
139
|
- test/Rakefile
|
136
140
|
- test/active_support_test.rb
|
141
|
+
- test/allocations.rb
|
137
142
|
- test/bench.rb
|
138
143
|
- test/empty_test.rb
|
139
144
|
- test/everything_test.rb
|
@@ -173,8 +178,31 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
173
178
|
version: '0'
|
174
179
|
requirements: []
|
175
180
|
rubyforge_project:
|
176
|
-
rubygems_version: 2.4.
|
181
|
+
rubygems_version: 2.4.8
|
177
182
|
signing_key:
|
178
183
|
specification_version: 4
|
179
184
|
summary: Run test/unit tests by line number. Metal!
|
180
|
-
test_files:
|
185
|
+
test_files:
|
186
|
+
- test/Rakefile
|
187
|
+
- test/active_support_test.rb
|
188
|
+
- test/allocations.rb
|
189
|
+
- test/bench.rb
|
190
|
+
- test/empty_test.rb
|
191
|
+
- test/everything_test.rb
|
192
|
+
- test/examples/active_support_example_test.rb
|
193
|
+
- test/examples/active_support_unescaped_example_test.rb
|
194
|
+
- test/examples/empty_example_test.rb
|
195
|
+
- test/examples/minitest_4_example_test.rb
|
196
|
+
- test/examples/minitest_5_example_test.rb
|
197
|
+
- test/examples/multiple_example_test.rb
|
198
|
+
- test/examples/subdir/a_test.rb
|
199
|
+
- test/examples/subdir/b_test.rb
|
200
|
+
- test/examples/subdir/c_test.rb
|
201
|
+
- test/examples/subdir_with_failures/a_test.rb
|
202
|
+
- test/examples/test_unit_example_test.rb
|
203
|
+
- test/minitest_4_test.rb
|
204
|
+
- test/minitest_5_test.rb
|
205
|
+
- test/multiple_test.rb
|
206
|
+
- test/options_test.rb
|
207
|
+
- test/test_helper.rb
|
208
|
+
- test/test_unit_test.rb
|