@@ -10,7 +10,10 @@ class TestEnvironmentVariables
10
10
module Common
11
11
TEST_PLATFORM = ENV [ "TEST_PLATFORM" ] || "x64-mingw-ucrt"
12
12
DOCKERHUB_USER = ENV [ 'DOCKERHUB_USER' ] || "larskanis"
13
- TEST_IMAGE_NAME = "#{ DOCKERHUB_USER } /rake-compiler-dock-mri-#{ TEST_PLATFORM } :#{ RakeCompilerDock ::IMAGE_VERSION } "
13
+
14
+ IS_JRUBY = TEST_PLATFORM . to_s == "jruby"
15
+ platform = IS_JRUBY ? "jruby" : "mri-#{ TEST_PLATFORM } "
16
+ TEST_IMAGE_NAME = "#{ DOCKERHUB_USER } /rake-compiler-dock-#{ platform } :#{ RakeCompilerDock ::IMAGE_VERSION } "
14
17
15
18
def rcd_env
16
19
self . class . instance_variable_get ( "@rcd_env" ) || begin
@@ -25,24 +28,26 @@ def rcd_env
25
28
end
26
29
end
27
30
28
- def test_RUBY_CC_VERSION
29
- df = File . read ( File . expand_path ( "../../Dockerfile.mri.erb" , __FILE__ ) )
30
- df =~ /^ENV RUBY_CC_VERSION\s +(.*)\s +$/
31
- assert_equal $1, rcd_env [ 'RUBY_CC_VERSION' ]
32
- end
31
+ unless IS_JRUBY
32
+ def test_RUBY_CC_VERSION
33
+ df = File . read ( File . expand_path ( "../../Dockerfile.mri.erb" , __FILE__ ) )
34
+ df =~ /^ENV RUBY_CC_VERSION\s +(.*)\s +$/
35
+ assert_equal $1, rcd_env [ 'RUBY_CC_VERSION' ]
36
+ end
33
37
34
- def test_RAKE_EXTENSION_TASK_NO_NATIVE
35
- assert_equal "true" , rcd_env [ 'RAKE_EXTENSION_TASK_NO_NATIVE' ]
36
- end
38
+ def test_RAKE_EXTENSION_TASK_NO_NATIVE
39
+ assert_equal "true" , rcd_env [ 'RAKE_EXTENSION_TASK_NO_NATIVE' ]
40
+ end
37
41
38
- def test_symlink_rake_compiler
39
- cmd = invocation ( "if test -h $HOME/.rake-compiler ; then echo yes ; else echo no ; fi" )
40
- assert_equal ( "yes" , %x(#{ cmd } ) . strip )
41
- end
42
+ def test_symlink_rake_compiler
43
+ cmd = invocation ( "if test -h $HOME/.rake-compiler ; then echo yes ; else echo no ; fi" )
44
+ assert_equal ( "yes" , %x(#{ cmd } ) . strip )
45
+ end
42
46
43
- def test_gem_directory
44
- cmd = invocation ( "if test -d $HOME/.gem ; then echo yes ; else echo no ; fi" )
45
- assert_equal ( "yes" , %x(#{ cmd } ) . strip )
47
+ def test_gem_directory
48
+ cmd = invocation ( "if test -d $HOME/.gem ; then echo yes ; else echo no ; fi" )
49
+ assert_equal ( "yes" , %x(#{ cmd } ) . strip )
50
+ end
46
51
end
47
52
end
48
53
@@ -51,7 +56,7 @@ class UsingWrapper < Test::Unit::TestCase
51
56
52
57
def invocation ( command )
53
58
idir = File . join ( File . dirname ( __FILE__ ) , '../lib' )
54
- "RCD_PLATFORM=#{ TEST_PLATFORM } #{ RbConfig ::CONFIG [ 'RUBY_INSTALL_NAME' ] } -I#{ idir . inspect } bin/rake-compiler-dock bash -c '#{ command } '"
59
+ "RCD_PLATFORM=#{ TEST_PLATFORM } RCD_RUBYVM= #{ IS_JRUBY ? 'jruby' : 'mri' } #{ RbConfig ::CONFIG [ 'RUBY_INSTALL_NAME' ] } -I#{ idir . inspect } bin/rake-compiler-dock bash -c '#{ command } '"
55
60
end
56
61
57
62
def test_HOST_RUBY_PLATFORM
0 commit comments