Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ jobs:
exclude:
- os: windows-latest
ruby: truffleruby-head
include:
- os: windows-latest
ruby: ruby-mswin
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
Expand All @@ -72,10 +75,14 @@ jobs:
- run: bundle exec rake libffi
- run: bundle exec rake compile

- if: matrix.os == 'windows-latest'
# force the use of GNU make.exe on MSWIN platform for building libtest.dll
run: bundle exec rake test MAKE=make

- if: matrix.os != 'windows-latest'
run: bundle exec rake test FFI_TEST_GC=true

- run: bundle exec rake bench:all
- run: bundle exec rake bench:all MAKE=make
if: ${{ matrix.ruby != 'truffleruby-head' && matrix.ruby != 'jruby-head' }}
env:
ITER: 10
Expand Down
6 changes: 5 additions & 1 deletion spec/ffi/embed-test/embed-test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@
Dir.chdir(File.dirname(EXT))

nul = File.open(File::NULL)
make = system('type gmake', { :out => nul, :err => nul }) && 'gmake' || 'make'
make = if RUBY_PLATFORM =~ /mswin/i
'nmake'
else
system('type gmake', { :out => nul, :err => nul }) && 'gmake' || 'make'
end

# create Makefile
system(RbConfig.ruby, "extconf.rb")
Expand Down
6 changes: 5 additions & 1 deletion spec/ffi/long_double_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,8 @@ module LibTest
expect(v).to be_within(0.01).of(0.1)
end
end
end unless ['truffleruby', 'jruby'].include?(RUBY_ENGINE) || /x64-mingw32/ =~ RUBY_PLATFORM

# * Truffleruby and JRuby don't support long double
# * x64-mingw32 with MSVCRT crashes
# * The libtest.dll on mswin is built by gcc currently (since the GNUmakefile is not compatible to MSVC), which crashes at long double
end unless ['truffleruby', 'jruby'].include?(RUBY_ENGINE) || /x64-mingw32|mswin/ =~ RUBY_PLATFORM
4 changes: 3 additions & 1 deletion spec/ffi/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@

RSpec.configure do |c|
c.filter_run_excluding gc_dependent: true unless ENV['FFI_TEST_GC'] == 'true'
c.filter_run_excluding( :ractor ) unless defined?(Ractor) && RUBY_VERSION >= "3.1" && (RUBY_VERSION !~ /^3.3./ || RUBY_PLATFORM !~ /mingw/)

# Ractor is only usable on ruby-3.1+, but it hangs on Windows on ruby-3.3 and 3.4
c.filter_run_excluding( :ractor ) unless defined?(Ractor) && RUBY_VERSION >= "3.1" && (RUBY_VERSION !~ /^3.[34]./ || RUBY_PLATFORM !~ /mingw|mswin/)
end

module TestLibrary
Expand Down