Do not run simplecov on dspec specs
This commit is contained in:
parent
556c821cc6
commit
87a6d9f04f
@ -17,12 +17,16 @@ task :build_dist do
|
||||
end
|
||||
|
||||
RSpec::Core::RakeTask.new(:spec, :example_string) do |task, args|
|
||||
ENV["specs"] = "1"
|
||||
if args.example_string
|
||||
ENV["partial_specs"] = "1"
|
||||
task.rspec_opts = %W[-e "#{args.example_string}" -f documentation]
|
||||
end
|
||||
end
|
||||
task :spec => :build_dist
|
||||
task :spec do
|
||||
ENV.delete("specs")
|
||||
end
|
||||
|
||||
# dspec task is useful to test the distributable release script, but is not
|
||||
# useful for coverage information.
|
||||
@ -31,7 +35,7 @@ task :dspec, [:example_string] => :build_dist do |task, args|
|
||||
FileUtils.mkdir_p("test")
|
||||
FileUtils.cp("dist/rscons", "test/rscons.rb")
|
||||
ENV["dist_specs"] = "1"
|
||||
Rake::Task["spec"].invoke(args.example_string)
|
||||
Rake::Task["spec"].execute(args.example_string)
|
||||
ENV.delete("dist_specs")
|
||||
FileUtils.rm_f(Dir.glob(".rscons-*"))
|
||||
end
|
||||
@ -99,6 +103,7 @@ task :default => :spec
|
||||
task :all => [
|
||||
:build_dist,
|
||||
:spec,
|
||||
:dspec,
|
||||
:yard,
|
||||
:user_guide,
|
||||
]
|
||||
|
@ -118,21 +118,23 @@ describe Rscons do
|
||||
command_name = "#{command_prefix}#{@statics[:build_test_id]}"
|
||||
File.open("_simplecov_setup.rb", "w") do |fh|
|
||||
fh.puts <<EOF
|
||||
require "bundler"
|
||||
Bundler.setup
|
||||
require "simplecov"
|
||||
class MyFormatter
|
||||
def format(*args)
|
||||
unless ENV["dist_specs"]
|
||||
require "bundler"
|
||||
Bundler.setup
|
||||
require "simplecov"
|
||||
class MyFormatter
|
||||
def format(*args)
|
||||
end
|
||||
end
|
||||
end
|
||||
SimpleCov.start do
|
||||
root(#{@owd.inspect})
|
||||
command_name(#{command_name.inspect})
|
||||
filters.clear
|
||||
add_filter do |src|
|
||||
!(src.filename[SimpleCov.root])
|
||||
SimpleCov.start do
|
||||
root(#{@owd.inspect})
|
||||
command_name(#{command_name.inspect})
|
||||
filters.clear
|
||||
add_filter do |src|
|
||||
!(src.filename[SimpleCov.root])
|
||||
end
|
||||
formatter(MyFormatter)
|
||||
end
|
||||
formatter(MyFormatter)
|
||||
end
|
||||
# force color off
|
||||
ENV["TERM"] = nil
|
||||
|
@ -1,25 +1,25 @@
|
||||
require "simplecov"
|
||||
|
||||
SimpleCov.start do
|
||||
add_filter "/spec/"
|
||||
add_filter "/.bundle/"
|
||||
if ENV["partial_specs"]
|
||||
command_name "RSpec-partial"
|
||||
else
|
||||
command_name "RSpec"
|
||||
end
|
||||
if ENV["dist_specs"]
|
||||
add_filter "/bin/"
|
||||
add_filter "/lib/"
|
||||
else
|
||||
add_filter "test/rscons.rb"
|
||||
end
|
||||
project_name "Rscons"
|
||||
merge_timeout 3600
|
||||
end
|
||||
|
||||
if ENV["dist_specs"]
|
||||
require_relative "../test/rscons"
|
||||
else
|
||||
require "simplecov"
|
||||
|
||||
SimpleCov.start do
|
||||
add_filter "/spec/"
|
||||
add_filter "/.bundle/"
|
||||
if ENV["partial_specs"]
|
||||
command_name "RSpec-partial"
|
||||
else
|
||||
command_name "RSpec"
|
||||
end
|
||||
if ENV["dist_specs"]
|
||||
add_filter "/bin/"
|
||||
add_filter "/lib/"
|
||||
else
|
||||
add_filter "test/rscons.rb"
|
||||
end
|
||||
project_name "Rscons"
|
||||
merge_timeout 3600
|
||||
end
|
||||
|
||||
require "rscons"
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user