Compare commits

..
Author SHA1 Message Date
josh 1932b65992 WIP - parallel tests 2026-01-25 22:01:58 -05:00
5 changed files with 993 additions and 1121 deletions

No files matched your search

+1 -1
View File
@@ -3,7 +3,7 @@ source 'https://rubygems.org'
gem "base64" gem "base64"
gem "rspec" gem "rspec"
gem "rake" gem "rake"
gem "simplecov" gem "simplecov", "~> 0.15.0"
gem "openssl" gem "openssl"
if RbConfig::CONFIG["host"]["msys"] if RbConfig::CONFIG["host"]["msys"]
gem "json", "2.1.0" gem "json", "2.1.0"
+7 -8
View File
@@ -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.4.1) docile (1.1.5)
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,12 +30,11 @@ 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.22.0) simplecov (0.15.1)
docile (~> 1.1) docile (~> 1.1.0)
simplecov-html (~> 0.11) json (>= 1.8, < 3)
simplecov_json_formatter (~> 0.1) simplecov-html (~> 0.10.0)
simplecov-html (0.13.2) simplecov-html (0.10.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)
@@ -53,7 +52,7 @@ DEPENDENCIES
rdoc rdoc
redcarpet redcarpet
rspec rspec
simplecov simplecov (~> 0.15.0)
syntax syntax
yard yard
+2 -22
View File
@@ -8,8 +8,6 @@ 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_run] 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]
@@ -21,31 +19,14 @@ 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.
@@ -56,7 +37,6 @@ task :dspec, [:example_string] => :build_dist do |task, args|
FileUtils.cp("dist/rscons", "test_run/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
+981 -1083
View File
File diff suppressed because it is too large. Load diff
+2 -7
View File
@@ -1,12 +1,8 @@
if ENV["rscons_dist_specs"] if ENV["rscons_dist_specs"]
require_relative "../test_run/rscons" require_relative "../test/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/"
@@ -15,10 +11,9 @@ else
else else
command_name "RSpec" command_name "RSpec"
end end
add_filter "test_run/rscons.rb" add_filter "test/rscons.rb"
project_name "Rscons" project_name "Rscons"
merge_timeout 3600 merge_timeout 3600
formatter(MyFormatter)
end end
require "rscons" require "rscons"