Permalink
Browse files

Minor adjustments to filter code.

  • Loading branch information...
trans committed Mar 16, 2012
1 parent a29278e commit 097bdbaa69b9b6a93b29854fbd6c113c11b9337f
Showing with 19 additions and 11 deletions.
  1. +6 −1 History.txt
  2. +2 −1 Manifest.txt
  3. +1 −1 Version.txt
  4. +10 −8 lib/turn/reporter.rb
View
@@ -1,4 +1,9 @@
-== 0.9.3 / 2012-02-09
+== 0.9.4 / 2012-03-16
+ * Fix dot reporter to use `.` instead of `S` for passed tests.
+ * Do not filter backtraces of local directory.
+ * Do not colourize zero counts in pretty reporter.
+
+== 0.9.3 / 2012-02-17
* Default to pretty reporter.
* Can set reporter via `rpt` environment variable.
* Fix backtrace filter.
View
@@ -1,4 +1,4 @@
-#!mast bin lib test try [A-Z]*.*
+#!mast -x Gemfile.lock bin lib test try [A-Z]*.*
bin/turn
lib/turn/autoload.rb
lib/turn/autorun.rb
@@ -30,6 +30,7 @@ lib/turn/testunit.rb
lib/turn/version.rb
lib/turn.rb
test/helper.rb
+test/reporter_test.rb
test/runner
test/test_framework.rb
test/test_reporters.rb
View
@@ -1 +1 @@
-0.9.3
+0.9.4
View
@@ -72,6 +72,9 @@ def clean_backtrace(backtrace)
limit_backtrace(filter_backtrace(backtrace))
end
+ # TODO: Is the text/unit line needed any more now that Dir.pwd is excluded
+ # from filtering?
+
$RUBY_IGNORE_CALLERS ||= []
$RUBY_IGNORE_CALLERS.concat([
/\/lib\/turn.*\.rb/,
@@ -86,15 +89,14 @@ def clean_backtrace(backtrace)
# as that probably means there was an issue with the test harness itself.
def filter_backtrace(backtrace)
return [] unless backtrace
- bt = backtrace.dup
- pwd= Dir.pwd
- bt = bt.reject{ |line| $RUBY_IGNORE_CALLERS.any?{|re| re =~ line} unless line.start_with?(pwd) } unless $DEBUG
- #bt.reject!{ |line| line.rindex('minitest') }
- #bt.reject!{ |line| line.rindex('test/unit') }
- #bt.reject!{ |line| line.rindex('lib/turn') }
- #bt.reject!{ |line| line.rindex('bin/turn') }
+ bt, pwd = backtrace.dup, Dir.pwd
+ unless $DEBUG
+ bt = bt.reject do |line|
+ $RUBY_IGNORE_CALLERS.any?{|re| re =~ line} unless line.start_with?(pwd)
+ end
+ end
bt = backtrace if bt.empty? # if empty just dump the whole thing
- bt.map{ |line| line.sub(Dir.pwd+'/', '') }
+ bt.map{ |line| line.sub(pwd+'/', '') }
end
# Limit backtrace to number of lines if `trace` configuration option is set.

0 comments on commit 097bdba

Please sign in to comment.