This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "YaST web service".
The branch, master has been updated
via e0960a3c9742b0ebc33cef834944fac607905a77 (commit)
from 8a1695702fc9039b9bd31822e27e935c03b369ea (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit e0960a3c9742b0ebc33cef834944fac607905a77
Author: Klaus Kämpf
Date: Thu Jun 25 13:52:29 2009 +0200
Add code coverage analyis plugin
-----------------------------------------------------------------------
Summary of changes and diff:
webservice/.gitignore | 3 +-
.../vendor/plugins/rails_rcov}/MIT-LICENSE | 2 +-
webservice/vendor/plugins/rails_rcov/ORIGIN | 2 +
webservice/vendor/plugins/rails_rcov/README | 86 +++++++++++
.../plugins/rails_rcov/tasks/rails_rcov.rake | 150 ++++++++++++++++++++
5 files changed, 241 insertions(+), 2 deletions(-)
copy {plugins/samba_server => webservice/vendor/plugins/rails_rcov}/MIT-LICENSE (97%)
create mode 100644 webservice/vendor/plugins/rails_rcov/ORIGIN
create mode 100644 webservice/vendor/plugins/rails_rcov/README
create mode 100644 webservice/vendor/plugins/rails_rcov/tasks/rails_rcov.rake
diff --git a/webservice/.gitignore b/webservice/.gitignore
index 5134eea..4bdd54e 100644
--- a/webservice/.gitignore
+++ b/webservice/.gitignore
@@ -1,4 +1,5 @@
*~
db/*.sqlite3
db/schema.rb
-log/*.log
\ No newline at end of file
+log/*.log
+coverage
\ No newline at end of file
diff --git a/plugins/samba_server/MIT-LICENSE b/webservice/vendor/plugins/rails_rcov/MIT-LICENSE
similarity index 97%
copy from plugins/samba_server/MIT-LICENSE
copy to webservice/vendor/plugins/rails_rcov/MIT-LICENSE
index 5ec2c0b..c61f2c8 100644
--- a/plugins/samba_server/MIT-LICENSE
+++ b/webservice/vendor/plugins/rails_rcov/MIT-LICENSE
@@ -1,4 +1,4 @@
-Copyright (c) 2009 Novell
+Copyright (c) 2006 Coda Hale
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
diff --git a/webservice/vendor/plugins/rails_rcov/ORIGIN b/webservice/vendor/plugins/rails_rcov/ORIGIN
new file mode 100644
index 0000000..bfd1b5a
--- /dev/null
+++ b/webservice/vendor/plugins/rails_rcov/ORIGIN
@@ -0,0 +1,2 @@
+./script/plugin install http://svn.codahale.com/rails_rcov
+
\ No newline at end of file
diff --git a/webservice/vendor/plugins/rails_rcov/README b/webservice/vendor/plugins/rails_rcov/README
new file mode 100644
index 0000000..eb9d84c
--- /dev/null
+++ b/webservice/vendor/plugins/rails_rcov/README
@@ -0,0 +1,86 @@
+ = rails_rcov plugin for Rails
+
+rails_rcov provides easy-to-use Rake tasks to determine the code coverage of
+your unit, functional, and integration tests using Mauricio Fernandez's rcov
+tool.
+
+== Installation
+
+First, install rcov from Mauricio's web site
+[http://eigenclass.org/hiki.rb?rcov]. Make sure it's on your system path, so
+that typing +rcov+ on the command line actually runs it. THIS PLUGIN DOESN'T DO
+ANYTHING BESIDES GENERATE ERRORS UNLESS YOU INSTALL RCOV FIRST. RCOV CONTAINS
+ALL THE MAGIC, THIS PLUGIN JUST RUNS IT.
+
+Second, install this plugin. If your project is source-controlled by Subversion
+(which it should be, really), the easiest way to install this is via Rails'
+plugin script:
+
+ ./script/plugin install -x http://svn.codahale.com/rails_rcov
+
+If you're not using Subversion, or if you don't want it adding
+<tt>svn:externals</tt> in your project, remove the <tt>-x</tt> switch:
+
+ ./script/plugin install http://svn.codahale.com/rails_rcov
+
+== Usage
+
+For each <tt>test:blah</tt> task you have for your Rails project, rails_rcov
+adds two more: <tt>test:blah:rcov</tt> and <tt>test:blah:clobber_rcov</tt>.
+
+Running <tt>rake test:units:rcov</tt>, for example, will run your unit tests
+through rcov and write the code coverage reports to
+<tt>your_rails_app/coverage/units</tt>.
+
+Running <tt>test:units:clobber_rcov</tt> will erase the generated report for the
+unit tests.
+
+Each rcov task takes two optional parameters: RCOV_PARAMS, whose argument is
+passed along to rcov, and SHOW_ONLY, which limits the files displayed in the
+report.
+
+RCOV_PARAMS:
+ # sort by coverage
+ rake test:units:rcov RCOV_PARAMS="--sort=coverage"
+
+ # show callsites and hide fully covered files
+ rake test:units:rcov RCOV_PARAMS="--callsites --only-uncovered"
+
+Check the rcov documentation for more details.
+
+SHOW_ONLY is a comma-separated list of the files you'd like to see. Right now
+there are four types of files rake_rcov recognizes: models, helpers,
+controllers, and lib. These can be abbreviated to their first letters:
+
+ # only show files from app/models
+ rake test:units:rcov SHOW_ONLY=models
+
+ # only show files from app/helpers and app/controllers
+ rake test:units:rcov SHOW_ONLY=helpers,controllers
+
+ # only show files from app/helpers and app/controllers, with less typing
+ rake test:units:rcov SHOW_ONLY=h,c
+
+Please note that rails_rcov has only been tested with a Bash shell, and any
+other environment could well explode in your face. If you're having trouble
+getting this to work on Windows, please take the time to figure out what's not
+working. Most of the time it boils down to the different ways the Window shell
+and the Bash shell escape metacharacters. Play around with the way rcov_rake
+escapes data (like on line 73, or 78) and send me a fix. I don't have a working
+Windows environment anymore, so leaving it up to me won't solve anything. ;-)
+
+== Resources
+
+=== Subversion
+
+* http://svn.codahale.com/rails_rcov
+
+=== Blog
+
+* http://blog.codahale.com
+
+== Credits
+
+Written by Coda Hale . Thanks to Nils Franzen for a Win32
+escaping patch. Thanks to Alex Wayne for suggesting how to make SHOW_ONLY not be
+useless.
\ No newline at end of file
diff --git a/webservice/vendor/plugins/rails_rcov/tasks/rails_rcov.rake b/webservice/vendor/plugins/rails_rcov/tasks/rails_rcov.rake
new file mode 100644
index 0000000..4fd798d
--- /dev/null
+++ b/webservice/vendor/plugins/rails_rcov/tasks/rails_rcov.rake
@@ -0,0 +1,150 @@
+# This File Uses Magic
+# ====================
+# Here's an example of how this file works. As an example, let's say you typed
+# this into your terminal:
+#
+# $ rake --tasks
+#
+# The rake executable goes through all the various places .rake files can be,
+# accumulates them all, and then runs them. When this file is loaded by Rake,
+# it iterates through all the tasks, and for each task named 'test:blah' adds
+# test:blah:rcov and test:blah:rcov_clobber.
+#
+# So you've seen all the tasks, and you type this into your terminal:
+#
+# $ rake test:units:rcov
+#
+# Rake does the same thing as above, but it runs the test:units:rcov task, which
+# pretty much just does this:
+#
+# $ ruby [this file] [the test you want to run] [some options]
+#
+# Now this file is run via the Ruby interpreter, and after glomming up the
+# options, it acts just like the Rake executable, with a slight difference: it
+# passes all the arguments to rcov, not ruby, so all your unit tests get some
+# rcov sweet loving.
+
+if ARGV.grep(/--run-rake-task=/).empty?
+ # Define all our Rake tasks
+
+ require 'rake/clean'
+ require 'rcov/rcovtask'
+
+ def to_rcov_task_sym(s)
+ s = s.gsub(/(test:)/,'')
+ s.empty? ? nil : s.intern
+ end
+
+ def to_rcov_task_name(s)
+ s = s.gsub(/(test:)/,'')
+ s =~ /s$/i ? s[0..-2] : s
+ end
+
+ def new_rcov_task(test_name)
+ output_dir = "./coverage/#{test_name.gsub('test:','')}"
+ CLOBBER.include(output_dir)
+
+ # Add a task to run the rcov process
+ desc "Run all #{to_rcov_task_name(test_name)} tests with Rcov to measure coverage"
+ task :rcov => [:clobber_rcov] do |t|
+ run_code = '"' << File.expand_path(__FILE__) << '"'
+ run_code << " --run-rake-task=#{test_name}"
+
+ params = String.new
+ if ENV['RCOV_PARAMS']
+ params << ENV['RCOV_PARAMS']
+ end
+
+ # rake test:units:rcov SHOW_ONLY=models,controllers,lib,helpers
+ # rake test:units:rcov SHOW_ONLY=m,c,l,h
+ if ENV['SHOW_ONLY']
+ show_only = ENV['SHOW_ONLY'].to_s.split(',').map{|x|x.strip}
+ if show_only.any?
+ reg_exp = []
+ for show_type in show_only
+ reg_exp << case show_type
+ when 'm', 'models' : 'app\/models'
+ when 'c', 'controllers' : 'app\/controllers'
+ when 'h', 'helpers' : 'app\/helpers'
+ when 'l', 'lib' : 'lib'
+ else
+ show_type
+ end
+ end
+ reg_exp.map!{ |m| "(#{m})" }
+ params << " -x \\\"^(?!#{reg_exp.join('|')})\\\""
+ end
+ end
+
+ unless params.empty?
+ run_code << " --rcov-params=\"#{params}\""
+ end
+
+ ruby run_code
+ end
+
+ # Add a task to clean up after ourselves
+ desc "Remove Rcov reports for #{to_rcov_task_name(test_name)} tests"
+ task :clobber_rcov do |t|
+ rm_r output_dir, :force => true
+ end
+
+ # Link our clobber task to the main one
+ task :clobber => [:clobber_rcov]
+ end
+
+ test_tasks = Rake::Task.tasks.select{ |t| t.comment && t.name =~ /^test/ }
+ for test_task in test_tasks
+ namespace :test do
+ if sym = to_rcov_task_sym(test_task.name)
+ namespace sym do
+ new_rcov_task(test_task.name)
+ end
+ end
+ end
+ end
+else
+ # Load rake tasks, hijack ruby, and redirect the task through rcov
+ require 'rubygems'
+ require 'rake'
+
+ module RcovTestSettings
+ class << self
+ attr_accessor :output_dir, :options
+ def to_params
+ "-o \"#{@output_dir}\" -T -x \"rubygems/*,rcov*\" --rails #{@options}"
+ end
+ end
+
+ # load options and arguments from command line
+ unless (cmd_line = ARGV.grep(/--rcov-params=/)).empty?
+ @options = cmd_line.first.gsub(/--rcov-params=/, '')
+ end
+ end
+
+ def is_windows?
+ processor, platform, *rest = RUBY_PLATFORM.split("-")
+ platform == 'mswin32'
+ end
+
+ # intercept what Rake *would* be doing with Ruby, and send it through Rcov instead
+ module RakeFileUtils
+ alias :ruby_without_rcov :ruby
+ def ruby(*args, &block)
+ cmd = (is_windows? ? 'rcov.cmd' : 'rcov') << " #{RcovTestSettings.to_params} #{args}"
+ status = sh(cmd, {}, &block)
+ puts "View the full results at file://#{RcovTestSettings.output_dir}/index.html"
+ return status
+ end
+ end
+
+ # read the test name and execute it (through Rcov)
+ unless (cmd_line = ARGV.grep(/--run-rake-task=/)).empty?
+ test_name = cmd_line.first.gsub(/--run-rake-task=/,'')
+ ARGV.clear; ARGV << test_name
+ RcovTestSettings.output_dir = File.expand_path("./coverage/#{test_name.gsub('test:','')}")
+ Rake.application.run
+ else
+ raise "No test to execute!"
+ end
+end
\ No newline at end of file
hooks/post-receive
--
YaST web service
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org