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, file)
|
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)
|
2018-06-23 14:58:43 +02:00
|
|
|
writer.save "test/#{file}.o"
|
2018-06-24 23:39:13 +02:00
|
|
|
end
|
2018-06-23 14:58:43 +02:00
|
|
|
end
|
|
|
|
end
|