start new elf testing category (and minors)
This commit is contained in:
1
test/elf/test_all.rb
Normal file
1
test/elf/test_all.rb
Normal file
@ -0,0 +1 @@
|
||||
require_relative "test_hello"
|
29
test/elf/test_hello.rb
Normal file
29
test/elf/test_hello.rb
Normal file
@ -0,0 +1,29 @@
|
||||
require_relative "compiler_helper"
|
||||
|
||||
class HelloTest < MiniTest::Test
|
||||
|
||||
def check
|
||||
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
|
||||
output_at = "Register::CallImplementation"
|
||||
#{}"Register::CallImplementation"
|
||||
machine.run_before output_at
|
||||
#puts Sof.write(machine.space)
|
||||
machine.run_after output_at
|
||||
writer = Elf::ObjectWriter.new(machine)
|
||||
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
|
Reference in New Issue
Block a user