@@ -341,8 +341,8 @@ def should_print_full_java_command(options, env: {})
341
341
out . should include ( "--jvm" )
342
342
end
343
343
344
- if TruffleRuby . graalvm_home or ! TruffleRuby . native?
345
- # These options are only shown in GraalVM, they are not available in a native standalone
344
+ unless TruffleRuby . native?
345
+ # This is only shown in JVM standalones
346
346
out . should include ( "--polyglot" )
347
347
end
348
348
end
@@ -417,53 +417,4 @@ def should_print_full_java_command(options, env: {})
417
417
out . should == 'bar'
418
418
end
419
419
end
420
-
421
- guard -> {
422
- # GraalVM with both --jvm and --native
423
- defined? ( ::TruffleRuby ) and TruffleRuby . graalvm_home and TruffleRuby . native?
424
- } do
425
- describe "runtime configuration flags" do
426
- before :each do
427
- @trufflerubyopt = ENV [ 'TRUFFLERUBYOPT' ]
428
- # remove --native/--jvm from $TRUFFLERUBYOPT as they can conflict with command line arguments for these specs
429
- ENV [ 'TRUFFLERUBYOPT' ] = @trufflerubyopt . to_s . gsub ( /--(native|jvm)\b / , '' )
430
- end
431
-
432
- after :each do
433
- ENV [ 'TRUFFLERUBYOPT' ] = @trufflerubyopt
434
- end
435
-
436
- [ 'RUBYOPT' , 'TRUFFLERUBYOPT' ] . each do |var |
437
- it "should recognize ruby --vm options in #{ var } when switching to JVM" do
438
- env = { var => "--jvm #{ @ignore_jvm_thread_warnings } --vm.Dfoo=bar" } # ignoring the original value of RUBYOPT/TRUFFLERUBYOPT on purpose here
439
- out = ruby_exe ( 'puts RUBY_DESCRIPTION; puts Truffle::System.get_java_property("foo")' , env : env , args : @redirect )
440
- check_status_and_empty_stderr
441
- out = out . lines . map ( &:chomp )
442
- out [ 0 ] . should =~ /(GraalVM CE|Oracle GraalVM) JVM/
443
- out [ 1 ] . should == 'bar'
444
- end
445
- end
446
-
447
- it "uses --native by default" do
448
- out = ruby_exe ( nil , options : "--version" , args : @redirect )
449
- check_status_and_empty_stderr
450
- out . should =~ /(GraalVM CE|Oracle GraalVM) Native/
451
- end
452
-
453
- it "switches to JVM with --jvm as a Ruby argument" do
454
- out = ruby_exe ( nil , options : "--jvm #{ @ignore_jvm_thread_warnings } --version" , args : @redirect )
455
- check_status_and_empty_stderr
456
- out . should =~ /(GraalVM CE|Oracle GraalVM) JVM/
457
- end
458
-
459
- it "keeps --jvm as an application argument if given as an application argument" do
460
- script = fixture ( __FILE__ , "argv.rb" )
461
- out = ruby_exe ( nil , options : "-v" , args : "#{ script } --jvm 1 2 #{ @redirect } " )
462
- check_status_and_empty_stderr
463
- out = out . lines . map ( &:chomp )
464
- out [ 0 ] . should =~ /(GraalVM CE|Oracle GraalVM) Native/
465
- out . should . include? ( '["--jvm", "1", "2"]' )
466
- end
467
- end
468
- end
469
420
end
0 commit comments