rubyx/test/elf/helper.rb

20 lines
435 B
Ruby
Raw Normal View History

2018-06-23 14:58:43 +02:00
require_relative "../helper"
module Elf
class FullTest < MiniTest::Test
2018-06-25 19:21:15 +02:00
def in_space(input)
"class Space; #{input} ; end"
end
def as_main(input)
in_space("def main(arg);#{input};end")
end
def check(input)
2019-02-08 22:03:23 +01:00
linker = RubyX::RubyXCompiler.new(RubyX.default_test_options).ruby_to_binary( input , :arm )
2018-07-03 09:12:40 +02:00
writer = Elf::ObjectWriter.new(linker)
writer.save StringIO.new
end
2018-06-23 14:58:43 +02:00
end
end