Skip to content

Commit 80c9083

Browse files
committed
Get bootstraptest and basictest basically working
1 parent 5f12572 commit 80c9083

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

test/basictest/runner.rb

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,13 @@
33
exit if defined?(CROSS_COMPILING) and CROSS_COMPILING
44
ruby = ENV["RUBY"]
55
unless ruby
6-
load './rbconfig.rb'
7-
ruby = "./#{RbConfig::CONFIG['ruby_install_name']}#{RbConfig::CONFIG['EXEEXT']}"
6+
if RUBY_ENGINE == 'truffleruby'
7+
require 'rbconfig'
8+
ruby = RbConfig.ruby
9+
else
10+
load './rbconfig.rb'
11+
ruby = "./#{RbConfig::CONFIG['ruby_install_name']}#{RbConfig::CONFIG['EXEEXT']}"
12+
end
813
end
914
unless File.exist? ruby
1015
print "#{ruby} is not found.\n"

test/bootstraptest/runner.rb

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,12 @@ def Dir.mktmpdir(prefix_suffix=nil, tmpdir=nil)
5959
end
6060

6161
def main
62-
@ruby = File.expand_path('miniruby')
62+
if RUBY_ENGINE == 'truffleruby'
63+
require 'rbconfig'
64+
@ruby = RbConfig.ruby
65+
else
66+
@ruby = File.expand_path('miniruby')
67+
end
6368
@verbose = false
6469
$VERBOSE = false
6570
$stress = false
@@ -367,7 +372,7 @@ def assert_normal_exit(testsrc, *rest, timeout: nil, **opt)
367372
end
368373

369374
def assert_finish(timeout_seconds, testsrc, message = '')
370-
timeout_seconds *= 3 if RubyVM::MJIT.enabled? # for --jit-wait
375+
timeout_seconds *= 3 if defined?(RubyVM::MJIT) && RubyVM::MJIT.enabled? # for --jit-wait
371376
newtest
372377
show_progress(message) {
373378
faildesc = nil

0 commit comments

Comments
 (0)