Skip to content

Commit 9ee9146

Browse files
committed
1 parent 311ce2d commit 9ee9146

File tree

3 files changed

+22
-9
lines changed

3 files changed

+22
-9
lines changed

spec/mspec/lib/mspec/commands/mspec-run.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ def options(argv = ARGV)
3232
options.chdir
3333
options.prefix
3434
options.configure { |f| load f }
35+
options.env
3536
options.randomize
3637
options.repeat
3738
options.pretend

spec/mspec/lib/mspec/utils/options.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,13 @@ def configure(&block)
204204
"Load FILE containing configuration options", &block)
205205
end
206206

207+
def env
208+
on("--env", "KEY=VALUE", "Set environment variable") do |env|
209+
key, value = env.split('=', 2)
210+
ENV[key] = value
211+
end
212+
end
213+
207214
def targets
208215
on("-t", "--target", "TARGET",
209216
"Implementation to run the specs, where TARGET is:") do |t|
@@ -484,6 +491,7 @@ def debug
484491

485492
def all
486493
configure {}
494+
env
487495
targets
488496
formatters
489497
filters

spec/mspec/tool/sync/sync-rubyspec.rb

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
CHECK_LAST_MERGE = !MSPEC && ENV['CHECK_LAST_MERGE'] != 'false'
2424
TEST_MASTER = ENV['TEST_MASTER'] != 'false'
2525

26+
ONLY_FILTER = ENV['ONLY_FILTER'] == 'true'
27+
2628
MSPEC_REPO = File.expand_path("../../..", __FILE__)
2729
raise MSPEC_REPO if !Dir.exist?(MSPEC_REPO) or !Dir.exist?("#{MSPEC_REPO}/.git")
2830

@@ -230,15 +232,17 @@ def main(impls)
230232
impl = RubyImplementation.new(impl, data)
231233
update_repo(impl)
232234
filter_commits(impl)
233-
rebase_commits(impl)
234-
if new_commits?(impl)
235-
test_new_specs
236-
verify_commits(impl)
237-
fast_forward_master(impl)
238-
check_ci
239-
else
240-
STDERR.puts "#{BRIGHT_YELLOW}No new commits#{RESET}"
241-
fast_forward_master(impl)
235+
unless ONLY_FILTER
236+
rebase_commits(impl)
237+
if new_commits?(impl)
238+
test_new_specs
239+
verify_commits(impl)
240+
fast_forward_master(impl)
241+
check_ci
242+
else
243+
STDERR.puts "#{BRIGHT_YELLOW}No new commits#{RESET}"
244+
fast_forward_master(impl)
245+
end
242246
end
243247
end
244248
end

0 commit comments

Comments
 (0)