rubyx/test/compiler/test_hello.rb

30 lines
719 B
Ruby
Raw Normal View History

2015-07-19 09:54:36 +02:00
require_relative "compiler_helper"
class HelloTest < MiniTest::Test
def check
2015-07-19 10:52:43 +02:00
machine = Virtual.machine.boot
Parfait::Space.object_space.get_class_by_name(:Integer).remove_instance_method :plus
#TODO remove this hack: write proper aliases
statements = machine.parse_and_compile @string_input
2015-06-22 21:48:42 +02:00
output_at = "Register::CallImplementation"
2015-06-20 23:21:42 +02:00
#{}"Register::CallImplementation"
machine.run_before output_at
2015-06-30 09:22:54 +02:00
#puts Sof.write(machine.space)
2015-06-20 23:21:42 +02:00
machine.run_after output_at
writer = Elf::ObjectWriter.new(machine)
2014-08-30 13:17:00 +02:00
writer.save "hello.o"
end
def test_string_put
@string_input = <<HERE
class Object
int main()
"Hello again\n".putstring()
end
end
HERE
check
end
end