Skip to content

Commit 372a68f

Browse files
committed
Fixed build tests on Windows.
1 parent 6a17ca0 commit 372a68f

File tree

4 files changed

+13
-10
lines changed

4 files changed

+13
-10
lines changed

build-tests/atomic_boolean_builds_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def atomic_boolean_test(clazz, opts = {})
6161
end
6262
end
6363

64-
if 'EXT' == ENV['TEST_PLATFORM']
64+
if 'EXT' == ENV['TEST_PLATFORM'].strip
6565

6666
describe Concurrent::CAtomicBoolean do
6767

build-tests/atomic_fixnum_builds_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def atomic_fixnum_test(clazz, opts = {})
6161
end
6262
end
6363

64-
if 'EXT' == ENV['TEST_PLATFORM']
64+
if 'EXT' == ENV['TEST_PLATFORM'].strip
6565

6666
describe Concurrent::CAtomicFixnum do
6767

build-tests/atomic_reference_builds_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def atomic_reference_test(clazz, opts = {})
4040
end
4141
end
4242

43-
if jruby? && 'JRUBY' == ENV['TEST_PLATFORM']
43+
if jruby? && 'JRUBY' == ENV['TEST_PLATFORM'].strip
4444

4545
describe Concurrent::JavaAtomic do
4646

@@ -61,7 +61,7 @@ def atomic_reference_test(clazz, opts = {})
6161
end
6262
end
6363

64-
if 'EXT' == ENV['TEST_PLATFORM']
64+
if 'EXT' == ENV['TEST_PLATFORM'].strip
6565

6666
describe Concurrent::CAtomic do
6767

build-tests/runner.rb

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,11 @@
1515
require 'concurrent/version'
1616
require_relative 'platform_helpers'
1717

18+
1819
EXT_PLATFORMS = {
1920
'i686-linux' => 'x86-linux',
2021
'x86_64-linux' => 'x86_64-linux',
21-
'x86-mingw32' => 'x86-mingw32',
22+
'i386-mingw32' => 'x86-mingw32',
2223
'x64-mingw32' => 'x64-mingw32',
2324
'i386-solaris2.11' => 'x86-solaris-2.11',
2425
'x86_64-darwin14.0' => 'x86_64-darwin-14',
@@ -28,7 +29,7 @@
2829
PKG_PATH = File.join(File.dirname(__FILE__), '..', 'pkg')
2930
TEST_FILES = Dir["#{TEST_PATH}/*_spec.rb"]
3031

31-
RSPEC = "rspec --default-path #{TEST_PATH} -fd --color --seed 0"
32+
RSPEC = "rspec --default-path #{TEST_PATH} -fd #{windows? ? '' : '--color'} --seed 0"
3233

3334
INSTALL_RSPEC_COMMAND = 'gem install rspec'
3435

@@ -55,7 +56,7 @@ def extension_gem_name(platform = RUBY_PLATFORM)
5556
def install_gems_command(ext, platform = '')
5657
cmd = "gem install #{PKG_PATH}/concurrent-ruby-#{Concurrent::VERSION}.gem"
5758
if ext
58-
cmd << "\ngem install #{PKG_PATH}/#{extension_gem_name(platform)}"
59+
cmd << " && gem install #{PKG_PATH}/#{extension_gem_name(platform)}"
5960
end
6061
cmd
6162
end
@@ -83,7 +84,7 @@ def run_test_suite(files, ext, platform = '')
8384

8485
files.each do |file|
8586
if windows?
86-
cmd = "set TEST_PLATFORM='#{test_platform}' && #{RSPEC} #{file}"
87+
cmd = "set TEST_PLATFORM=#{test_platform} && #{RSPEC} #{file}"
8788
else
8889
cmd = "TEST_PLATFORM='#{test_platform}' #{RSPEC} #{file}"
8990
end
@@ -105,8 +106,10 @@ def run_test_suite(files, ext, platform = '')
105106
puts SUITE_BREAK
106107
run_test_suite(TEST_FILES, false, 'jruby')
107108
elsif mri?
108-
puts SUITE_BREAK
109-
run_test_suite(TEST_FILES, true)
109+
if ! windows?
110+
puts SUITE_BREAK
111+
run_test_suite(TEST_FILES, true)
112+
end
110113
if platform_specific_extensions?(RUBY_PLATFORM)
111114
puts SUITE_BREAK
112115
run_test_suite(TEST_FILES, true, RUBY_PLATFORM)

0 commit comments

Comments
 (0)