2018-04-19 18:47:35 +02:00
|
|
|
require_relative "../helper"
|
|
|
|
|
2019-10-03 20:07:55 +02:00
|
|
|
module SlotMachine
|
2018-04-19 18:47:35 +02:00
|
|
|
module Builtin
|
2019-08-11 13:31:00 +02:00
|
|
|
class BootTest < MiniTest::Test
|
2019-09-13 09:41:13 +02:00
|
|
|
include Preloader
|
2019-08-22 16:52:19 +02:00
|
|
|
|
2019-09-13 09:41:13 +02:00
|
|
|
def get_compiler(clazz , name)
|
|
|
|
compiler = RubyX::RubyXCompiler.new(RubyX.default_test_options)
|
2019-10-03 20:07:55 +02:00
|
|
|
coll = compiler.ruby_to_slot( get_preload("Space.main;#{clazz}.#{name}") )
|
2019-09-28 11:41:38 +02:00
|
|
|
@method = coll.method_compilers.last_compiler
|
2019-09-13 09:41:13 +02:00
|
|
|
@method
|
2019-08-11 13:31:00 +02:00
|
|
|
end
|
2019-09-13 09:41:13 +02:00
|
|
|
|
2020-03-06 17:09:56 +01:00
|
|
|
def risc(at)
|
|
|
|
@risc_i = @method.to_risc.risc_instructions unless @risc_i
|
|
|
|
return @risc_i if at == 0
|
|
|
|
@risc_i.next( at )
|
|
|
|
end
|
|
|
|
|
2019-08-11 13:31:00 +02:00
|
|
|
end
|
2018-04-19 18:47:35 +02:00
|
|
|
end
|
|
|
|
end
|