Skip to content

Commit 5aa707a

Browse files
committed
Updated build tests to support Windows.
1 parent d742d08 commit 5aa707a

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

build-tests/platform_helpers.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
require 'rbconfig'
22

3+
def windows?
4+
host_os = RbConfig::CONFIG['host_os']
5+
host_os =~ /mswin32/i || host_os =~ /mingw32/i
6+
end
7+
38
def mri?(engine = RUBY_ENGINE)
49
engine == 'ruby'
510
end

build-tests/runner.rb

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@
3333
INSTALL_RSPEC_COMMAND = 'gem install rspec'
3434

3535
UNINSTALL_GEMS_COMMAND = <<-CMD
36-
gem uninstall -q -a -I concurrent-ruby-ext
37-
gem uninstall -q -a -I concurrent-ruby
36+
gem uninstall -q -a -I concurrent-ruby-ext && \
37+
gem uninstall -q -a -I concurrent-ruby && \
3838
gem uninstall -q -a -I ref
3939
CMD
4040

@@ -81,7 +81,11 @@ def run_test_suite(files, ext, platform = '')
8181
ok = system(cmd)
8282

8383
files.each do |file|
84-
cmd = "TEST_PLATFORM='#{test_platform}' #{RSPEC} #{file}"
84+
if windows?
85+
cmd = "set TEST_PLATFORM='#{test_platform}' && #{RSPEC} #{file}"
86+
else
87+
cmd = "TEST_PLATFORM='#{test_platform}' #{RSPEC} #{file}"
88+
end
8589
ok = system(cmd)
8690
end
8791

0 commit comments

Comments
 (0)