rubyx/test/elf/helper.rb

20 lines
435 B
Ruby
Raw Normal View History

2018-06-23 15:58:43 +03:00
require_relative "../helper"
module Elf
class FullTest < MiniTest::Test
2018-06-25 20:21:15 +03: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 23:03:23 +02:00
linker = RubyX::RubyXCompiler.new(RubyX.default_test_options).ruby_to_binary( input , :arm )
2018-07-03 10:12:40 +03:00
writer = Elf::ObjectWriter.new(linker)
writer.save StringIO.new
end
2018-06-23 15:58:43 +03:00
end
end