Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 5f7a96e040
Fetching contributors…

Cannot retrieve contributors at this time

94 lines (71 sloc) 2.472 kb
#--
# Cloud Foundry 2012.02.03 Beta
# Copyright (c) [2009-2012] VMware, Inc. All Rights Reserved.
#
# This product is licensed to you under the Apache License, Version 2.0 (the "License").
# You may not use this product except in compliance with the License.
#
# This product includes a number of subcomponents with
# separate copyright notices and license terms. Your use of these
# subcomponents is subject to the terms and conditions of the
# subcomponent's license, as noted in the LICENSE file.
#++
require "rake"
require "tempfile"
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", __FILE__)
SPEC_OPTS = %w(--format progress --colour)
require "rubygems"
require "bundler"
Bundler.setup(:default, :test)
require "rspec/core/rake_task"
require "ci/reporter/rake/rspec"
reports_dir = File.expand_path(File.join(File.dirname(__FILE__), "..", "spec_reports"))
ENV["CI_REPORTS"] = reports_dir
task :spec => ["spec:all"]
namespace "spec" do
gemfile = "../Gemfile"
spec_opts = ["--format", "documentation", "--colour"]
desc "Run unit tests"
task "unit" => ["run_unit"]
desc "Run functional tests"
task "functional" => ["run_functional"]
task "all" => ["run_all"]
desc "Run specs for rcov"
task "rcov" => ["cleanup_coverage", "run_rcov"]
RSpec::Core::RakeTask.new("run_all") do |t|
#t.gemfile = gemfile
t.rspec_opts = spec_opts
t.pattern = "{unit,functional}/**/*_spec.rb"
end
RSpec::Core::RakeTask.new("run_unit") do |t|
#t.gemfile = gemfile
t.rspec_opts = spec_opts
t.pattern = "unit/**/*_spec.rb"
end
RSpec::Core::RakeTask.new("run_functional") do |t|
#t.gemfile = gemfile
t.rspec_opts = spec_opts
t.pattern = "functional/**/*_spec.rb"
end
RSpec::Core::RakeTask.new(:ci => ["ci:setup:rspec"]) do |t|
t.pattern = '**/*_spec.rb'
end
require 'simplecov'
require 'simplecov-rcov'
task :run_rcov => :cleanup_coverage do
SimpleCov.root('..')
SimpleCov.coverage_dir("spec_coverage")
SimpleCov.formatter = SimpleCov::Formatter::RcovFormatter
SimpleCov.start do
require "rspec/core"
add_filter "/gems/"
unit_dir = File.expand_path("../unit", __FILE__)
func_dir = File.expand_path("../functional", __FILE__)
RSpec::Core::Runner.disable_autorun!
RSpec::Core::Runner.run([unit_dir, func_dir], STDERR, STDOUT)
end
end
task "cleanup_coverage" do
rm_rf "spec_coverage"
end
end
Jump to Line
Something went wrong with that request. Please try again.