rubyx/test/virtual/test_hello.rb

43 lines
718 B
Ruby
Raw Normal View History

require_relative "virtual_helper"
class HelloTest < MiniTest::Test
include VirtualHelper
def check
machine = Virtual::Machine.boot
expressions = machine.compile_main @string_input
2015-06-12 17:52:06 +02:00
machine.run_before "Register::CallImplementation"
2015-06-19 11:29:41 +02:00
puts Sof.write(machine.space)
2015-06-12 17:52:06 +02:00
machine.run_after "Register::CallImplementation"
2014-08-30 13:17:00 +02:00
writer = Elf::ObjectWriter.new(machine)
2014-08-30 13:17:00 +02:00
writer.save "hello.o"
end
2014-08-22 08:21:59 +02:00
def qtest_simplest_function
@string_input = <<HERE
def foo(x)
5
end
HERE
check
end
def test_puts_string
@string_input = <<HERE
2015-05-30 13:49:10 +02:00
putstring("Hello")
HERE
check
end
def ttest_string_put
@string_input = <<HERE
def foo()
"Hello".puts()
end
HERE
check
end
end