dohtest 0.1.51 → 0.1.52
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/lib/dohtest/configure.rb +10 -0
- data/lib/dohtest/find_files.rb +17 -0
- data/lib/dohtest/load_test_files.rb +18 -0
- data/lib/dohtest/master_runner.rb +4 -6
- data/lib/dohtest/stream_output.rb +4 -2
- metadata +4 -3
- data/lib/dohtest/require_paths.rb +0 -29
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a3829322dbd582038ad299b99fdf60f6c5efb97c
|
4
|
+
data.tar.gz: 71fb6741be4f451b02d85e194dfd250b228e04d2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ddcd101ea8d3fdc89745e72878a046c75d9d08b72fc55bdbc35a63d69f4cdc22bb61b034cbfe1157855b2ee69a4a6125f6c0f3338301bb6320dfa7b39cf69223
|
7
|
+
data.tar.gz: 8a3e0f4cdfbdf558177e53f2bf2d707e4dee242ed80e11540e65b2850ad14fd906c6d2669d49c95dfd742b3d1feaa4f68176bf30d232606fc41aa66c4ceb522c
|
data/lib/dohtest/configure.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'dohroot'
|
2
|
+
require 'dohtest/find_files'
|
2
3
|
|
3
4
|
module DohTest
|
4
5
|
extend self
|
@@ -59,8 +60,17 @@ def add_default_config_values
|
|
59
60
|
DohTest.config[:seed] ||= (Time.new.to_f * 1000).to_i
|
60
61
|
end
|
61
62
|
|
63
|
+
def set_test_files
|
64
|
+
paths = DohTest.config[:paths]
|
65
|
+
if paths.empty?
|
66
|
+
paths = ['.']
|
67
|
+
end
|
68
|
+
DohTest.config[:test_files] = DohTest.find_test_files(DohTest.config[:glob], paths)
|
69
|
+
end
|
70
|
+
|
62
71
|
def configure(start_path)
|
63
72
|
add_default_config_values
|
73
|
+
set_test_files
|
64
74
|
load_configuration_file(start_path)
|
65
75
|
end
|
66
76
|
|
@@ -0,0 +1,17 @@
|
|
1
|
+
module DohTest
|
2
|
+
extend self
|
3
|
+
|
4
|
+
def find_files(glob, paths)
|
5
|
+
retval = []
|
6
|
+
expanded_paths = paths.map {|path| File.expand_path(path) }
|
7
|
+
expanded_paths.each do |path|
|
8
|
+
if File.directory?(path)
|
9
|
+
retval.concat(Dir.glob(File.join(path, '**', glob)).to_a)
|
10
|
+
else
|
11
|
+
retval << path
|
12
|
+
end
|
13
|
+
end
|
14
|
+
return retval
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module DohTest
|
2
|
+
extend self
|
3
|
+
|
4
|
+
def require_test_file(path, callbacks)
|
5
|
+
callbacks.each do |callback|
|
6
|
+
callback.call(path)
|
7
|
+
end
|
8
|
+
require(path)
|
9
|
+
end
|
10
|
+
|
11
|
+
def load_test_files(paths)
|
12
|
+
callbacks = @config[:pre_require_callback]
|
13
|
+
paths.each do |path|
|
14
|
+
require_test_file(path, callbacks)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
require 'dohtest/group_runner'
|
2
|
-
require 'dohtest/
|
2
|
+
require 'dohtest/load_test_files'
|
3
3
|
|
4
4
|
module DohTest
|
5
5
|
|
@@ -14,15 +14,13 @@ class MasterRunner
|
|
14
14
|
srand(@config[:seed])
|
15
15
|
@output.run_begin(@config)
|
16
16
|
|
17
|
-
|
18
|
-
if paths.empty?
|
19
|
-
paths = ['.']
|
20
|
-
end
|
21
|
-
if !DohTest.require_paths(@config[:glob], paths)
|
17
|
+
if @config[:test_files].empty?
|
22
18
|
@output.no_tests_found
|
23
19
|
return 1
|
24
20
|
end
|
25
21
|
|
22
|
+
DohTest.load_test_files(@config[:test_files])
|
23
|
+
|
26
24
|
@config[:pre_test_callback].each do |callback|
|
27
25
|
callback.call(@output)
|
28
26
|
end
|
@@ -16,9 +16,11 @@ class StreamOutput
|
|
16
16
|
end
|
17
17
|
|
18
18
|
def run_begin(config)
|
19
|
-
|
20
|
-
|
19
|
+
display_config = config.dup
|
20
|
+
display_config.delete(:test_files)
|
21
|
+
@std_ios.puts "running tests with config: #{display_config}"
|
21
22
|
|
23
|
+
@config = config
|
22
24
|
has_terminal = @std_ios.tty?
|
23
25
|
@no_color = !has_terminal || @config[:no_color]
|
24
26
|
@verbose = (has_terminal && !@config[:quiet]) || @config[:verbose]
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dohtest
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.52
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Makani Mason
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2017-12-
|
12
|
+
date: 2017-12-29 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: dohroot
|
@@ -58,9 +58,10 @@ files:
|
|
58
58
|
- lib/dohtest/capture_output.rb
|
59
59
|
- lib/dohtest/configure.rb
|
60
60
|
- lib/dohtest/failure.rb
|
61
|
+
- lib/dohtest/find_files.rb
|
61
62
|
- lib/dohtest/group_runner.rb
|
63
|
+
- lib/dohtest/load_test_files.rb
|
62
64
|
- lib/dohtest/master_runner.rb
|
63
|
-
- lib/dohtest/require_paths.rb
|
64
65
|
- lib/dohtest/stream_output.rb
|
65
66
|
- lib/dohtest/test_group.rb
|
66
67
|
- test/test_backtrace_parser.rb
|
@@ -1,29 +0,0 @@
|
|
1
|
-
module DohTest
|
2
|
-
extend self
|
3
|
-
|
4
|
-
def require_test_file(path, callbacks)
|
5
|
-
callbacks.each do |callback|
|
6
|
-
callback.call(path)
|
7
|
-
end
|
8
|
-
require(path)
|
9
|
-
end
|
10
|
-
|
11
|
-
def require_paths(glob, paths)
|
12
|
-
retval = false
|
13
|
-
expanded_paths = paths.map {|path| File.expand_path(path) }
|
14
|
-
callbacks = @config[:pre_require_callback]
|
15
|
-
expanded_paths.each do |path|
|
16
|
-
if File.directory?(path)
|
17
|
-
Dir.glob(File.join(path, '**', glob)).each do |filename|
|
18
|
-
retval = true
|
19
|
-
DohTest.require_test_file(filename, callbacks)
|
20
|
-
end
|
21
|
-
else
|
22
|
-
retval = true
|
23
|
-
DohTest.require_test_file(path, callbacks)
|
24
|
-
end
|
25
|
-
end
|
26
|
-
return retval
|
27
|
-
end
|
28
|
-
|
29
|
-
end
|