Sha256: 0a39e4aab725e68b86a41c9707095dcbdc86ee0e19cca7c276c2ae12aab82c69

Contents?: true

Size: 1.25 KB

Versions: 1

Compression:

Stored size: 1.25 KB

Contents

require 'rubygems'
require 'bundler/setup'
#require 'test/unit'
require 'rake/testtask'
require 'rcov/rcovtask'
# to get xunit test results: rake ci:setup:testunit test
require 'ci/reporter/rake/test_unit'

Bundler::GemHelper.install_tasks

# integration test files
INT_TEST_FILES = FileList['test/int_test*.rb']

# helper to dry up tasks
def def_test(t, opts = {})
  t.libs << "test"
  t.test_files = opts[:test_files] if opts[:test_files]
  t.rcov_opts += opts[:rcov_opts] if opts[:rcov_opts]
  t.verbose = true
end

Rake::TestTask.new do |t|
  def_test(t)
end

Rake::TestTask.new(:integration) do |t|
  def_test(t, :test_files => INT_TEST_FILES)
end

task :test_all => [ :test, :integration ]

RCOV_OPTS = [ '--xrefs', # comment to disable cross-references
              '--html',
              '--exclude /gems/' ] # '-a'
              
#desc "Create a cross-referenced code coverage report."
Rcov::RcovTask.new do |t|
  def_test(t, :rcov_opts => RCOV_OPTS)
end

Rcov::RcovTask.new(:rcov_integration) do |t|
  def_test(t, :test_files => INT_TEST_FILES, :rcov_opts => RCOV_OPTS)
end

Rcov::RcovTask.new(:rcov_all) do |t|
  # test_files field not accessible on RcovTask? meh
  def_test(t, :test_files => FileList['test/test*.rb'] + INT_TEST_FILES, :rcov_opts => RCOV_OPTS)
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
kvm-0.0.1.pre Rakefile