Skip to content

Commit

Permalink
Showing 3 changed files with 25 additions and 2 deletions.
4 changes: 4 additions & 0 deletions test/truffle/cexts/oily_png/test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
require 'chunky_png'
require 'oily_png'

abort unless OilyPNG::Color.r(0x11223344) == ChunkyPNG::Color.r(0x11223344)
10 changes: 10 additions & 0 deletions test/truffle/cexts/psd_native/test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
require 'psd'
require 'psd_native'

module PSDNative::Util
extend self
end

abort unless PSDNative::Util.clamp(40, 10, 90) == PSD::Util.clamp(40, 10, 90)
abort unless PSDNative::Util.clamp(5, 10, 90) == PSD::Util.clamp(5, 10, 90)
abort unless PSDNative::Util.clamp(100, 10, 90) == PSD::Util.clamp(100, 10, 90)
13 changes: 11 additions & 2 deletions tool/jt.rb
Original file line number Diff line number Diff line change
@@ -362,7 +362,7 @@ def help
puts 'jt test gems tests using gems'
puts 'jt test ecosystem tests using the wider ecosystem such as bundler, Rails, etc'
puts 'jt test cexts run C extension tests'
puts ' (implies --graal, where Graal needs to include Sulong, and set SULONG_DIR to a built checkout of Sulong)'
puts ' (implies --graal, where Graal needs to include Sulong, set SULONG_DIR to a built checkout of Sulong, and set GEM_HOME)'
puts 'jt test report :language build a report on language specs'
puts ' :core (results go into test/target/mspec-html-report)'
puts ' :library'
@@ -616,9 +616,18 @@ def test_cexts(*args)
ensure
File.delete output_file rescue nil
end
['oily_png', 'psd_native'].each do |gem_name|

[
['oily_png', ['chunky_png-1.3.6', 'oily_png-1.2.0'], ['oily_png']],
['psd_native', ['chunky_png-1.3.6', 'oily_png-1.2.0', 'bindata-2.3.1', 'hashie-3.4.4', 'psd-enginedata-1.1.1', 'psd-2.1.2', 'psd_native-1.1.3'], ['oily_png', 'psd_native']]
].each do |gem_name, dependencies, libs|
config = "#{JRUBY_DIR}/test/truffle/cexts/#{gem_name}"
sh Utilities.find_jruby, "#{JRUBY_DIR}/bin/jruby-cext-c", config, '-Werror=implicit-function-declaration'
arguments = []
run '--graal',
*(dependencies.map { |d| ['-I', "#{ENV['GEM_HOME']}/gems/#{d}/lib"] }.flatten),
*(libs.map { |l| ['-I', "#{JRUBY_DIR}/test/truffle/cexts/#{l}/lib"] }.flatten),
"#{JRUBY_DIR}/test/truffle/cexts/#{gem_name}/test.rb" unless gem_name == 'psd_native' # psd_native is excluded
end
end
private :test_cexts

0 comments on commit 6c8df96

Please sign in to comment.