rubyx/test/elf/helper.rb

24 lines
486 B
Ruby
Raw Normal View History

2018-06-23 15:58:43 +03:00
require_relative "../helper"
module Elf
class FullTest < MiniTest::Test
DEBUG = false
def setup
end
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, file)
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)
2018-06-23 15:58:43 +03:00
writer.save "test/#{file}.o"
end
2018-06-23 15:58:43 +03:00
end
end