ftest 0.2.1 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c74881d078896ac38442c877ecca6dbdad5d739f
4
- data.tar.gz: 2e7146641d9f0bfefd920e0edb2fb5e2656747a5
3
+ metadata.gz: e61f9a6be7447773cae069acd4d0bd9b8e5b83b5
4
+ data.tar.gz: 1a41862c915bcb998590d9dfe117b98016fb8248
5
5
  SHA512:
6
- metadata.gz: 33b69d60643c7622583be04bbbf308b8b49b97e0d7ddfb28dacc535b380d3af6862e0745e000f96e628efd0aac1668974afc184cc19bfd9de4b2bbfcdc8eaa1d
7
- data.tar.gz: 7099432413a94b4b85f12ded3ce90a5fc0dd3f4834928d729d38399b6342ecb0c9c9f57900b4ab05778beae8c11d2bf5b614406be7930c9e41bfa7e4c866f760
6
+ metadata.gz: b80e594bcd505f583f07551df8636077e2bd5e3a58bbe4744947424d7d82c6331f294547278cc551df3d69a5b8ed3b1f5710ffae6581790efc249e79fad9200e
7
+ data.tar.gz: 08ae6b85526670449915eb27e1dd3fc5ff9728fbf282979b928a19f95ddd0fe3fc571e276066a3704eb1a0f1f44192df7e5fdf39def76e8b68e6abe283d64a29
@@ -134,30 +134,48 @@ module FTest
134
134
  def parse_options
135
135
  OptionParser.new do |opts|
136
136
  opts.banner = <<-BANNER
137
- Usage: #{program_name} [options] [PATH]
137
+ Usage: #{program_name} [options] [PATH1] [PATH2] … [PATHn]
138
138
 
139
- If no PATH is specified, ./tests is assumed
139
+ If no PATH(s) are specified, ./tests is assumed
140
140
 
141
141
  BANNER
142
142
 
143
143
  opts.on "-b", "--full-backtrace", "Do not filter assertion stack traces" do
144
144
  @options.full_backtrace
145
145
  end
146
+
146
147
  opts.on "-c", "--color", "Enable/disable colored output" do
147
148
  @options.color
148
149
  end
150
+
149
151
  opts.on "-f", "--fail-fast", "When any test script fails, exit immediately" do
150
152
  @options.fail_fast
151
153
  end
154
+
155
+ opts.on "-h", "--help", "Print this message and exit successfully" do
156
+ puts opts
157
+ exit 0
158
+ end
159
+
152
160
  opts.on "-n", "--num=COUNT", "Max number of sub processes to run concurrently" do |num|
153
161
  @options.child_count = num
154
162
  end
163
+
155
164
  opts.on "-q", "--quiet", "Reduces log verbosity" do
156
165
  @options.quiet
157
166
  end
167
+
158
168
  opts.on "-r", "--reverse-traces", "Reverse the order of stack traces" do
159
169
  @options.reverse_backtraces
160
170
  end
171
+
172
+ opts.on "-V", "--version", "Print version and exit successfully" do
173
+ spec = Gem.loaded_specs["ftest"]
174
+ version = if spec then spec.version else "(local)" end
175
+ puts "Version: #{version}"
176
+ exit 0
177
+ end
178
+
161
179
  opts.on "-v", "--verbose", "Increases log verbosity" do
162
180
  @options.verbose
163
181
  end
@@ -18,17 +18,24 @@ module FTest
18
18
  @palette = palette
19
19
  end
20
20
 
21
- %i(level=).each do |method_name|
21
+ %i(level= progname=).each do |method_name|
22
22
  define_method method_name do |*args, &block|
23
23
  @logger.public_send method_name, *args, &block
24
24
  end
25
25
  end
26
26
 
27
27
  %i(unknown fatal error warn info debug).each do |log_level|
28
- define_method log_level do |msg = nil, &block|
29
- msg ||= block[]
30
- colored_msg = format log_level, msg
31
- @logger.public_send log_level, colored_msg
28
+ define_method log_level do |msg_or_progname = nil, &orig_block|
29
+ colored_msg = format log_level, msg_or_progname
30
+
31
+ if orig_block
32
+ progname = colored_msg
33
+ block = -> do format log_level, orig_block.() end
34
+ else
35
+ block = -> do colored_msg end
36
+ end
37
+
38
+ @logger.public_send log_level, progname, &block
32
39
  end
33
40
  end
34
41
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ftest
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan Ladd
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-09-03 00:00:00.000000000 Z
11
+ date: 2015-09-13 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Fork based runner for tests written as simple ruby scripts
14
14
  email: nathanladd+github@gmail.com