Added --env option to mspec for test-bundled-gems
This commit is contained in:
parent
671e6eb644
commit
26aebdb6d6
Notes:
git
2024-11-27 07:45:41 +00:00
@ -1646,8 +1646,9 @@ test-bundled-gems-spec: $(TEST_RUNNABLE)-test-bundled-gems-spec
|
|||||||
yes-test-bundled-gems-spec: yes-test-spec-precheck $(PREPARE_BUNDLED_GEMS)
|
yes-test-bundled-gems-spec: yes-test-spec-precheck $(PREPARE_BUNDLED_GEMS)
|
||||||
$(ACTIONS_GROUP)
|
$(ACTIONS_GROUP)
|
||||||
$(gnumake_recursive)$(Q) \
|
$(gnumake_recursive)$(Q) \
|
||||||
BUNDLED_GEMS=$(BUNDLED_GEMS) $(RUNRUBY) -r./$(arch)-fake -r$(tooldir)/lib/_tmpdir \
|
$(RUNRUBY) -r./$(arch)-fake -r$(tooldir)/lib/_tmpdir \
|
||||||
$(srcdir)/spec/mspec/bin/mspec run -B $(srcdir)/spec/bundled_gems.mspec $(MSPECOPT) $(SPECOPTS)
|
$(srcdir)/spec/mspec/bin/mspec run --env BUNDLED_GEMS=$(BUNDLED_GEMS) -B $(srcdir)/spec/bundled_gems.mspec \
|
||||||
|
$(MSPECOPT) $(SPECOPTS)
|
||||||
$(ACTIONS_ENDGROUP)
|
$(ACTIONS_ENDGROUP)
|
||||||
no-test-bundled-gems-spec:
|
no-test-bundled-gems-spec:
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@ load File.dirname(__FILE__) + '/default.mspec'
|
|||||||
|
|
||||||
class MSpecScript
|
class MSpecScript
|
||||||
test_bundled_gems = get(:stdlibs).to_a & get(:bundled_gems).to_a
|
test_bundled_gems = get(:stdlibs).to_a & get(:bundled_gems).to_a
|
||||||
unless ENV["BUNDLED_GEMS"].empty?
|
unless ENV["BUNDLED_GEMS"].nil?
|
||||||
test_bundled_gems = ENV["BUNDLED_GEMS"].split(",").map do |gem|
|
test_bundled_gems = ENV["BUNDLED_GEMS"].split(",").map do |gem|
|
||||||
test_bundled_gems.find{|test_gem| test_gem.include?(gem) }
|
test_bundled_gems.find{|test_gem| test_gem.include?(gem) }
|
||||||
end.compact
|
end.compact
|
||||||
|
@ -32,6 +32,7 @@ class MSpecRun < MSpecScript
|
|||||||
options.chdir
|
options.chdir
|
||||||
options.prefix
|
options.prefix
|
||||||
options.configure { |f| load f }
|
options.configure { |f| load f }
|
||||||
|
options.env
|
||||||
options.randomize
|
options.randomize
|
||||||
options.repeat
|
options.repeat
|
||||||
options.pretend
|
options.pretend
|
||||||
|
@ -204,6 +204,13 @@ class MSpecOptions
|
|||||||
"Load FILE containing configuration options", &block)
|
"Load FILE containing configuration options", &block)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def env
|
||||||
|
on("--env", "KEY=VALUE", "Set environment variable") do |env|
|
||||||
|
key, value = env.split('=', 2)
|
||||||
|
ENV[key] = value
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def targets
|
def targets
|
||||||
on("-t", "--target", "TARGET",
|
on("-t", "--target", "TARGET",
|
||||||
"Implementation to run the specs, where TARGET is:") do |t|
|
"Implementation to run the specs, where TARGET is:") do |t|
|
||||||
@ -484,6 +491,7 @@ class MSpecOptions
|
|||||||
|
|
||||||
def all
|
def all
|
||||||
configure {}
|
configure {}
|
||||||
|
env
|
||||||
targets
|
targets
|
||||||
formatters
|
formatters
|
||||||
filters
|
filters
|
||||||
|
Loading…
x
Reference in New Issue
Block a user