Compare commits
4 Commits
eebd08c34d
...
e6317ae236
| Author | SHA1 | Date | |
|---|---|---|---|
| e6317ae236 | |||
| baf4e036fb | |||
| 9d6321685e | |||
| 3a5db626ac |
2
.gitignore
vendored
2
.gitignore
vendored
@ -7,5 +7,5 @@
|
|||||||
/gen/
|
/gen/
|
||||||
/large_project/
|
/large_project/
|
||||||
/pkg/
|
/pkg/
|
||||||
/test/
|
/test_run/
|
||||||
/yard/
|
/yard/
|
||||||
|
|||||||
2
Gemfile
2
Gemfile
@ -3,7 +3,7 @@ source 'https://rubygems.org'
|
|||||||
gem "base64"
|
gem "base64"
|
||||||
gem "rspec"
|
gem "rspec"
|
||||||
gem "rake"
|
gem "rake"
|
||||||
gem "simplecov", "~> 0.15.0"
|
gem "simplecov"
|
||||||
gem "openssl"
|
gem "openssl"
|
||||||
if RbConfig::CONFIG["host"]["msys"]
|
if RbConfig::CONFIG["host"]["msys"]
|
||||||
gem "json", "2.1.0"
|
gem "json", "2.1.0"
|
||||||
|
|||||||
15
Gemfile.lock
15
Gemfile.lock
@ -4,7 +4,7 @@ GEM
|
|||||||
base64 (0.3.0)
|
base64 (0.3.0)
|
||||||
date (3.5.1)
|
date (3.5.1)
|
||||||
diff-lcs (1.6.2)
|
diff-lcs (1.6.2)
|
||||||
docile (1.1.5)
|
docile (1.4.1)
|
||||||
erb (6.0.1)
|
erb (6.0.1)
|
||||||
json (2.18.0)
|
json (2.18.0)
|
||||||
openssl (4.0.0)
|
openssl (4.0.0)
|
||||||
@ -30,11 +30,12 @@ GEM
|
|||||||
diff-lcs (>= 1.2.0, < 2.0)
|
diff-lcs (>= 1.2.0, < 2.0)
|
||||||
rspec-support (~> 3.13.0)
|
rspec-support (~> 3.13.0)
|
||||||
rspec-support (3.13.6)
|
rspec-support (3.13.6)
|
||||||
simplecov (0.15.1)
|
simplecov (0.22.0)
|
||||||
docile (~> 1.1.0)
|
docile (~> 1.1)
|
||||||
json (>= 1.8, < 3)
|
simplecov-html (~> 0.11)
|
||||||
simplecov-html (~> 0.10.0)
|
simplecov_json_formatter (~> 0.1)
|
||||||
simplecov-html (0.10.2)
|
simplecov-html (0.13.2)
|
||||||
|
simplecov_json_formatter (0.1.4)
|
||||||
stringio (3.2.0)
|
stringio (3.2.0)
|
||||||
syntax (1.2.2)
|
syntax (1.2.2)
|
||||||
tsort (0.2.0)
|
tsort (0.2.0)
|
||||||
@ -52,7 +53,7 @@ DEPENDENCIES
|
|||||||
rdoc
|
rdoc
|
||||||
redcarpet
|
redcarpet
|
||||||
rspec
|
rspec
|
||||||
simplecov (~> 0.15.0)
|
simplecov
|
||||||
syntax
|
syntax
|
||||||
yard
|
yard
|
||||||
|
|
||||||
|
|||||||
32
Rakefile.rb
32
Rakefile.rb
@ -8,8 +8,10 @@ end
|
|||||||
require "rspec/core/rake_task"
|
require "rspec/core/rake_task"
|
||||||
require "rake/clean"
|
require "rake/clean"
|
||||||
require "fileutils"
|
require "fileutils"
|
||||||
|
require "simplecov"
|
||||||
|
require "stringio"
|
||||||
|
|
||||||
CLEAN.include %w[build_test_run .yardoc yard coverage test]
|
CLEAN.include %w[build_test_run .yardoc yard coverage test_run]
|
||||||
CLOBBER.include %w[dist gen large_project pkg]
|
CLOBBER.include %w[dist gen large_project pkg]
|
||||||
|
|
||||||
task :build_dist do
|
task :build_dist do
|
||||||
@ -19,24 +21,42 @@ end
|
|||||||
RSpec::Core::RakeTask.new(:spec, :example_string) do |task, args|
|
RSpec::Core::RakeTask.new(:spec, :example_string) do |task, args|
|
||||||
ENV["specs"] = "1"
|
ENV["specs"] = "1"
|
||||||
if args.example_string
|
if args.example_string
|
||||||
ENV["partial_specs"] = "1"
|
|
||||||
task.rspec_opts = %W[-e "#{args.example_string}" -f documentation]
|
task.rspec_opts = %W[-e "#{args.example_string}" -f documentation]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
task :spec => :build_dist
|
|
||||||
task :spec do
|
task :spec do
|
||||||
ENV.delete("specs")
|
ENV.delete("specs")
|
||||||
end
|
end
|
||||||
|
task :spec => :build_tests
|
||||||
|
task :spec do
|
||||||
|
unless ENV["rscons_dist_specs"]
|
||||||
|
original_stdout = $stdout
|
||||||
|
sio = StringIO.new
|
||||||
|
$stdout = sio
|
||||||
|
SimpleCov.collate Dir["coverage/.resultset.json", "coverage/bt*/.resultset.json"]
|
||||||
|
$stdout = original_stdout
|
||||||
|
sio.string.lines.each do |line|
|
||||||
|
$stdout.write(line) unless line =~ /Coverage report generated for/
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
task :build_tests do |task, args|
|
||||||
|
ENV["specs"] = "1"
|
||||||
|
sh "ruby -Ilib build_tests/build_tests.rb"
|
||||||
|
ENV.delete("specs")
|
||||||
|
end
|
||||||
|
|
||||||
# dspec task is useful to test the distributable release script, but is not
|
# dspec task is useful to test the distributable release script, but is not
|
||||||
# useful for coverage information.
|
# useful for coverage information.
|
||||||
desc "Dist Specs"
|
desc "Dist Specs"
|
||||||
task :dspec, [:example_string] => :build_dist do |task, args|
|
task :dspec, [:example_string] => :build_dist do |task, args|
|
||||||
FileUtils.rm_rf("test")
|
FileUtils.rm_rf("test_run")
|
||||||
FileUtils.mkdir_p("test")
|
FileUtils.mkdir_p("test_run")
|
||||||
FileUtils.cp("dist/rscons", "test/rscons.rb")
|
FileUtils.cp("dist/rscons", "test_run/rscons.rb")
|
||||||
ENV["rscons_dist_specs"] = "1"
|
ENV["rscons_dist_specs"] = "1"
|
||||||
Rake::Task["spec"].execute(args)
|
Rake::Task["spec"].execute(args)
|
||||||
|
Rake::Task["build_tests"].execute(args)
|
||||||
ENV.delete("rscons_dist_specs")
|
ENV.delete("rscons_dist_specs")
|
||||||
FileUtils.rm_f(Dir.glob(".rscons-*"))
|
FileUtils.rm_f(Dir.glob(".rscons-*"))
|
||||||
end
|
end
|
||||||
|
|||||||
3541
build_tests/build_tests.rb
Normal file
3541
build_tests/build_tests.rb
Normal file
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,8 +1,12 @@
|
|||||||
if ENV["rscons_dist_specs"]
|
if ENV["rscons_dist_specs"]
|
||||||
require_relative "../test/rscons"
|
require_relative "../test_run/rscons"
|
||||||
else
|
else
|
||||||
require "simplecov"
|
require "simplecov"
|
||||||
|
|
||||||
|
class MyFormatter
|
||||||
|
def format(*args)
|
||||||
|
end
|
||||||
|
end
|
||||||
SimpleCov.start do
|
SimpleCov.start do
|
||||||
add_filter "/spec/"
|
add_filter "/spec/"
|
||||||
add_filter "/.bundle/"
|
add_filter "/.bundle/"
|
||||||
@ -11,9 +15,10 @@ else
|
|||||||
else
|
else
|
||||||
command_name "RSpec"
|
command_name "RSpec"
|
||||||
end
|
end
|
||||||
add_filter "test/rscons.rb"
|
add_filter "test_run/rscons.rb"
|
||||||
project_name "Rscons"
|
project_name "Rscons"
|
||||||
merge_timeout 3600
|
merge_timeout 3600
|
||||||
|
formatter(MyFormatter)
|
||||||
end
|
end
|
||||||
|
|
||||||
require "rscons"
|
require "rscons"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user