Permalink
Browse files

+ Updated .autotest and rakefile wrt rcov for new hoe capabilities

[git-p4: depot-paths = "//src/ruby_parser/dev/": change = 4827]
  • Loading branch information...
1 parent fa2024a commit 14f8e065b392a895a0687ccb262c5411dfa131cf @zenspider zenspider committed Apr 3, 2009
Showing with 5 additions and 32 deletions.
  1. +2 −5 .autotest
  2. +3 −27 Rakefile
View
@@ -1,14 +1,15 @@
# -*- ruby -*-
require 'autotest/restart'
+require 'autotest/rcov'
Autotest.add_hook :initialize do |at|
at.extra_files << "../../ParseTree/dev/test/pt_testcase.rb"
at.libs << ":../../ParseTree/dev/lib:../../ParseTree/dev/test:../../sexp_processor/dev/lib"
at.add_exception 'unit'
at.add_exception 'coverage'
- at.add_exception '.diff'
at.add_exception 'coverage.info'
+ at.add_exception '.diff'
at.unit_diff = "unit_diff -u -b"
@@ -38,7 +39,3 @@ class Autotest
File.expand_path "~/.multiruby/install/1.9.0-0/bin/ruby"
end
end if ENV['ONENINE']
-
-# require 'autotest/rcov'
-# Autotest::RCov.command = 'rcov_info'
-# Autotest::RCov.pattern = 'test/test_ruby_lexer.rb'
View
@@ -4,6 +4,9 @@ require 'rubygems'
# because hoe requires flay which requires ruby_parser
$:.unshift 'lib'
+
+$:.unshift "../../hoe/dev/lib"
+
require 'hoe'
Hoe.add_include_dirs("../../ParseTree/dev/lib",
@@ -57,20 +60,6 @@ def next_num(glob)
num = Dir[glob].max[/\d+/].to_i + 1
end
-begin
- require 'rcov/rcovtask'
- Rcov::RcovTask.new do |t|
- pattern = ENV['PATTERN'] || 'test/test_ruby_*.rb'
-
- t.test_files = FileList[pattern]
- t.verbose = true
- t.rcov_opts << "--threshold 80"
- t.rcov_opts << "--no-color"
- end
-rescue LoadError
- # skip
-end
-
desc "Compares PT to RP and deletes all files that match"
task :compare do
files = Dir["unit/**/*.rb"]
@@ -97,19 +86,6 @@ task :sort do
sh 'grepsort "^ +def (test|util)" test/test_ruby_lexer.rb'
end
-task :rcov_info => :parser do
- pattern = ENV['PATTERN'] || "test/test_*.rb"
- ruby "-Ilib -S rcov --text-report --save coverage.info #{pattern}"
-end
-
-task :rcov_overlay do
- rcov, eol = Marshal.load(File.read("coverage.info")).last[ENV["FILE"]], 1
- puts rcov[:lines].zip(rcov[:coverage]).map { |line, coverage|
- bol, eol = eol, eol + line.length
- [bol, eol, "#ffcccc"] unless coverage
- }.compact.inspect
-end
-
task :loc do
loc1 = `wc -l ../1.0.0/lib/ruby_lexer.rb`[/\d+/]
flog1 = `flog -s ../1.0.0/lib/ruby_lexer.rb`[/\d+\.\d+/]

0 comments on commit 14f8e06

Please sign in to comment.