fix all tests for previous commit
This commit is contained in:
parent
74b790250a
commit
37eeb81f45
@ -19,8 +19,8 @@ module RubyX
|
|||||||
attr_reader :vool
|
attr_reader :vool
|
||||||
|
|
||||||
# initialize boots Parfait and Risc (ie load Builin)
|
# initialize boots Parfait and Risc (ie load Builin)
|
||||||
def initialize
|
def initialize(options)
|
||||||
Parfait.boot!
|
Parfait.boot!(options)
|
||||||
Risc.boot!
|
Risc.boot!
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -96,8 +96,8 @@ module RubyX
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
def self.ruby_to_binary( ruby , platform)
|
def self.ruby_to_binary( ruby , platform , options)
|
||||||
compiler = RubyXCompiler.new
|
compiler = RubyXCompiler.new(options)
|
||||||
compiler.ruby_to_vool(ruby)
|
compiler.ruby_to_vool(ruby)
|
||||||
|
|
||||||
# integrate other sources into vool tree
|
# integrate other sources into vool tree
|
||||||
|
@ -22,7 +22,7 @@ class RubyXC < Thor
|
|||||||
end
|
end
|
||||||
puts "compiling #{file}"
|
puts "compiling #{file}"
|
||||||
|
|
||||||
linker = ::RubyX::RubyXCompiler.new.ruby_to_binary( ruby , :arm )
|
linker = ::RubyX::RubyXCompiler.new({}).ruby_to_binary( ruby , :arm )
|
||||||
writer = Elf::ObjectWriter.new(linker)
|
writer = Elf::ObjectWriter.new(linker)
|
||||||
|
|
||||||
outfile = file.split("/").last.gsub(".rb" , ".o")
|
outfile = file.split("/").last.gsub(".rb" , ".o")
|
||||||
|
@ -15,7 +15,7 @@ module Arm
|
|||||||
end
|
end
|
||||||
module ArmHelper
|
module ArmHelper
|
||||||
def setup
|
def setup
|
||||||
Parfait.boot!
|
Parfait.boot!(Parfait.default_test_options)
|
||||||
@machine = Arm::ArmMachine
|
@machine = Arm::ArmMachine
|
||||||
@binary = FakeBin.new
|
@binary = FakeBin.new
|
||||||
Risc::Position.clear_positions
|
Risc::Position.clear_positions
|
||||||
|
@ -25,7 +25,7 @@ module Arm
|
|||||||
assert_nil code.branch_to
|
assert_nil code.branch_to
|
||||||
end
|
end
|
||||||
def test_method_call
|
def test_method_call
|
||||||
Parfait.boot!
|
Parfait.boot!(Parfait.default_test_options)
|
||||||
bin = Parfait::BinaryCode.new(1)
|
bin = Parfait::BinaryCode.new(1)
|
||||||
Risc::Position.new(bin).set(0x20)
|
Risc::Position.new(bin).set(0x20)
|
||||||
code = @machine.call( bin ,{} )#this jumps to the next instruction
|
code = @machine.call( bin ,{} )#this jumps to the next instruction
|
||||||
|
@ -4,7 +4,7 @@ module Arm
|
|||||||
class TestTranslator < MiniTest::Test
|
class TestTranslator < MiniTest::Test
|
||||||
|
|
||||||
def setup
|
def setup
|
||||||
Parfait.boot!
|
Parfait.boot!(Parfait.default_test_options)
|
||||||
@jump = Risc::DynamicJump.new("" , :r1)
|
@jump = Risc::DynamicJump.new("" , :r1)
|
||||||
@codes = Translator.new.translate @jump
|
@codes = Translator.new.translate @jump
|
||||||
end
|
end
|
||||||
|
@ -17,7 +17,7 @@ module Elf
|
|||||||
in_space("def main(arg);#{input};end")
|
in_space("def main(arg);#{input};end")
|
||||||
end
|
end
|
||||||
def check(input, file)
|
def check(input, file)
|
||||||
linker = RubyX::RubyXCompiler.new.ruby_to_binary( input , :arm )
|
linker = RubyX::RubyXCompiler.new(RubyX.default_test_options).ruby_to_binary( input , :arm )
|
||||||
writer = Elf::ObjectWriter.new(linker)
|
writer = Elf::ObjectWriter.new(linker)
|
||||||
writer.save "test/#{file}.o"
|
writer.save "test/#{file}.o"
|
||||||
end
|
end
|
||||||
|
@ -6,7 +6,7 @@ module Elf
|
|||||||
|
|
||||||
def setup
|
def setup
|
||||||
super
|
super
|
||||||
@linker = RubyX::RubyXCompiler.new.ruby_to_risc(as_main("return 1"),:arm)
|
@linker = RubyX::RubyXCompiler.new(RubyX.default_test_options).ruby_to_risc(as_main("return 1"),:arm)
|
||||||
@linker.position_all
|
@linker.position_all
|
||||||
@linker.create_binary
|
@linker.create_binary
|
||||||
end
|
end
|
||||||
|
@ -29,7 +29,7 @@ module Risc
|
|||||||
end
|
end
|
||||||
def produce_instructions
|
def produce_instructions
|
||||||
assert @expect , "No output given"
|
assert @expect , "No output given"
|
||||||
linker = RubyX::RubyXCompiler.new.ruby_to_risc(as_test_main,:interpreter)
|
linker = RubyX::RubyXCompiler.new(RubyX.default_test_options).ruby_to_risc(as_test_main,:interpreter)
|
||||||
compiler = linker.assemblers.find{|c| c.callable.name == :main and c.callable.self_type.object_class.name == :Test}
|
compiler = linker.assemblers.find{|c| c.callable.name == :main and c.callable.self_type.object_class.name == :Test}
|
||||||
compiler.instructions
|
compiler.instructions
|
||||||
end
|
end
|
||||||
|
@ -4,7 +4,7 @@ module Mom
|
|||||||
|
|
||||||
class TestSlotDefinitionConstant < MiniTest::Test
|
class TestSlotDefinitionConstant < MiniTest::Test
|
||||||
def setup
|
def setup
|
||||||
Parfait.boot!
|
Parfait.boot!(Parfait.default_test_options)
|
||||||
@compiler = Risc::FakeCompiler.new
|
@compiler = Risc::FakeCompiler.new
|
||||||
@definition = SlotDefinition.new(StringConstant.new("hi") , [])
|
@definition = SlotDefinition.new(StringConstant.new("hi") , [])
|
||||||
@register = @definition.to_register(@compiler , InstructionMock.new)
|
@register = @definition.to_register(@compiler , InstructionMock.new)
|
||||||
|
@ -3,7 +3,7 @@ require_relative "helper"
|
|||||||
module Mom
|
module Mom
|
||||||
class TestSlotDefinitionKnown1 < MiniTest::Test
|
class TestSlotDefinitionKnown1 < MiniTest::Test
|
||||||
def setup
|
def setup
|
||||||
Parfait.boot!
|
Parfait.boot!(Parfait.default_test_options)
|
||||||
@compiler = Risc::FakeCompiler.new
|
@compiler = Risc::FakeCompiler.new
|
||||||
@definition = SlotDefinition.new(:message , :caller)
|
@definition = SlotDefinition.new(:message , :caller)
|
||||||
@register = @definition.to_register(@compiler , "fake source")
|
@register = @definition.to_register(@compiler , "fake source")
|
||||||
|
@ -3,7 +3,7 @@ require_relative "helper"
|
|||||||
module Mom
|
module Mom
|
||||||
class TestSlotDefinitionKnown2 < MiniTest::Test
|
class TestSlotDefinitionKnown2 < MiniTest::Test
|
||||||
def setup
|
def setup
|
||||||
Parfait.boot!
|
Parfait.boot!(Parfait.default_test_options)
|
||||||
@compiler = Risc::FakeCompiler.new
|
@compiler = Risc::FakeCompiler.new
|
||||||
@definition = SlotDefinition.new(:message , [:caller , :type])
|
@definition = SlotDefinition.new(:message , [:caller , :type])
|
||||||
@register = @definition.to_register(@compiler , InstructionMock.new)
|
@register = @definition.to_register(@compiler , InstructionMock.new)
|
||||||
|
@ -4,7 +4,7 @@ module Mom
|
|||||||
class TestSlotLoad1 < MiniTest::Test
|
class TestSlotLoad1 < MiniTest::Test
|
||||||
|
|
||||||
def setup
|
def setup
|
||||||
Parfait.boot!
|
Parfait.boot!(Parfait.default_test_options)
|
||||||
load = SlotLoad.new( [:message, :caller] , [:message,:type] )
|
load = SlotLoad.new( [:message, :caller] , [:message,:type] )
|
||||||
@compiler = Risc::FakeCompiler.new
|
@compiler = Risc::FakeCompiler.new
|
||||||
load.to_risc(@compiler)
|
load.to_risc(@compiler)
|
||||||
|
@ -4,7 +4,7 @@ module Mom
|
|||||||
class TestSlotLoad2 < MiniTest::Test
|
class TestSlotLoad2 < MiniTest::Test
|
||||||
|
|
||||||
def setup
|
def setup
|
||||||
Parfait.boot!
|
Parfait.boot!(Parfait.default_test_options)
|
||||||
@compiler = Risc::FakeCompiler.new
|
@compiler = Risc::FakeCompiler.new
|
||||||
load = SlotLoad.new( [:message, :caller, :type] , [:message, :caller , :type] )
|
load = SlotLoad.new( [:message, :caller, :type] , [:message, :caller , :type] )
|
||||||
load.to_risc(@compiler)
|
load.to_risc(@compiler)
|
||||||
|
@ -6,7 +6,7 @@ module Vool
|
|||||||
include MomCompile
|
include MomCompile
|
||||||
|
|
||||||
def setup
|
def setup
|
||||||
Parfait.boot!
|
Parfait.boot!(Parfait.default_test_options)
|
||||||
@ret = compile_mom( as_test_main("self.main {|elem| elem = 5 } "))
|
@ret = compile_mom( as_test_main("self.main {|elem| elem = 5 } "))
|
||||||
end
|
end
|
||||||
def test_is_compiler
|
def test_is_compiler
|
||||||
@ -22,7 +22,7 @@ module Vool
|
|||||||
class TestBlockLocal < MiniTest::Test
|
class TestBlockLocal < MiniTest::Test
|
||||||
include MomCompile
|
include MomCompile
|
||||||
def setup
|
def setup
|
||||||
Parfait.boot!
|
Parfait.boot!(Parfait.default_test_options)
|
||||||
@ret = compile_mom( as_test_main("self.main {|elem| local = 5 } "))
|
@ret = compile_mom( as_test_main("self.main {|elem| local = 5 } "))
|
||||||
@block = @ret.method_compilers.first.get_method.blocks
|
@block = @ret.method_compilers.first.get_method.blocks
|
||||||
end
|
end
|
||||||
@ -43,7 +43,7 @@ module Vool
|
|||||||
include MomCompile
|
include MomCompile
|
||||||
|
|
||||||
def setup
|
def setup
|
||||||
Parfait.boot!
|
Parfait.boot!(Parfait.default_test_options)
|
||||||
end
|
end
|
||||||
def test_method_arg_compiles
|
def test_method_arg_compiles
|
||||||
ret = compile_mom( as_test_main("self.main {|elem| arg = 5 } "))
|
ret = compile_mom( as_test_main("self.main {|elem| arg = 5 } "))
|
||||||
|
@ -6,7 +6,7 @@ module Vool
|
|||||||
include MomCompile
|
include MomCompile
|
||||||
|
|
||||||
def setup
|
def setup
|
||||||
Parfait.boot!
|
Parfait.boot!(Parfait.default_test_options)
|
||||||
@ret = compile_mom( as_test_main("return 1"))
|
@ret = compile_mom( as_test_main("return 1"))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@ module Mom
|
|||||||
include MomCompile
|
include MomCompile
|
||||||
|
|
||||||
def setup
|
def setup
|
||||||
Parfait.boot!
|
Parfait.boot!(Parfait.default_test_options)
|
||||||
@comp = compile_mom( "class Test ; def main(); return 'Hi'; end; end;")
|
@comp = compile_mom( "class Test ; def main(); return 'Hi'; end; end;")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@ module Mom
|
|||||||
include MomCompile
|
include MomCompile
|
||||||
|
|
||||||
def setup
|
def setup
|
||||||
Parfait.boot!
|
Parfait.boot!(Parfait.default_test_options)
|
||||||
@comp = compile_mom( "class Test ; def main(); main{return 'Ho'};return 'Hi'; end; end;")
|
@comp = compile_mom( "class Test ; def main(); main{return 'Ho'};return 'Hi'; end; end;")
|
||||||
@linker = @comp.translate(:interpreter)
|
@linker = @comp.translate(:interpreter)
|
||||||
end
|
end
|
||||||
|
@ -23,6 +23,16 @@ module Parfait
|
|||||||
def test_get_next_object
|
def test_get_next_object
|
||||||
assert_equal Parfait::Integer , @factory.get_next_object.class
|
assert_equal Parfait::Integer , @factory.get_next_object.class
|
||||||
end
|
end
|
||||||
|
def test_default_page
|
||||||
|
assert_equal 1024 , Factory.page_size
|
||||||
|
end
|
||||||
|
def test_default_reserve
|
||||||
|
assert_equal 10 , Factory.reserve_size
|
||||||
|
end
|
||||||
|
def test_set_page
|
||||||
|
assert_equal 10 , Factory.page_size = 10
|
||||||
|
Factory.page_size = 1024
|
||||||
|
end
|
||||||
def test_first_is_reserve
|
def test_first_is_reserve
|
||||||
@factory.get_next_object
|
@factory.get_next_object
|
||||||
assert_equal Parfait::Integer , @factory.reserve.class
|
assert_equal Parfait::Integer , @factory.reserve.class
|
||||||
|
@ -4,7 +4,7 @@ module Parfait
|
|||||||
class TestEmptyWord < ParfaitTest
|
class TestEmptyWord < ParfaitTest
|
||||||
|
|
||||||
def setup
|
def setup
|
||||||
Parfait.boot!
|
Parfait.boot!(Parfait.default_test_options)
|
||||||
@word = Parfait::Word.new(0)
|
@word = Parfait::Word.new(0)
|
||||||
end
|
end
|
||||||
def test_word_create
|
def test_word_create
|
||||||
|
@ -21,7 +21,7 @@ module Risc
|
|||||||
end
|
end
|
||||||
class DummyPlatform
|
class DummyPlatform
|
||||||
def self.boot
|
def self.boot
|
||||||
Parfait.boot!
|
Parfait.boot!(Parfait.default_test_options)
|
||||||
Risc.boot!
|
Risc.boot!
|
||||||
end
|
end
|
||||||
def translator
|
def translator
|
||||||
|
@ -4,7 +4,7 @@ require 'minitest/mock'
|
|||||||
module Risc
|
module Risc
|
||||||
class TestBranchListenerBooted < MiniTest::Test
|
class TestBranchListenerBooted < MiniTest::Test
|
||||||
def setup
|
def setup
|
||||||
Parfait.boot!
|
Parfait.boot!(Parfait.default_test_options)
|
||||||
Risc.boot!
|
Risc.boot!
|
||||||
@binary = Parfait::BinaryCode.new(1)
|
@binary = Parfait::BinaryCode.new(1)
|
||||||
@bin_pos = CodeListener.init(@binary,:interpreter).set(0)
|
@bin_pos = CodeListener.init(@binary,:interpreter).set(0)
|
||||||
|
@ -3,7 +3,7 @@ require_relative "helper"
|
|||||||
module Risc
|
module Risc
|
||||||
class TestCodeListener < MiniTest::Test
|
class TestCodeListener < MiniTest::Test
|
||||||
def setup
|
def setup
|
||||||
Parfait.boot!
|
Parfait.boot!(Parfait.default_test_options)
|
||||||
@binary = Parfait::BinaryCode.new(1)
|
@binary = Parfait::BinaryCode.new(1)
|
||||||
@method = Parfait.object_space.types.values.first.methods
|
@method = Parfait.object_space.types.values.first.methods
|
||||||
@label = Risc.label("hi","ho")
|
@label = Risc.label("hi","ho")
|
||||||
|
@ -3,7 +3,7 @@ require_relative "helper"
|
|||||||
module Risc
|
module Risc
|
||||||
class TestCodeListenerFull < MiniTest::Test
|
class TestCodeListenerFull < MiniTest::Test
|
||||||
def setup
|
def setup
|
||||||
Parfait.boot!
|
Parfait.boot!(Parfait.default_test_options)
|
||||||
Risc.boot!
|
Risc.boot!
|
||||||
@linker = Mom::MomCompiler.new.translate(:interpreter)
|
@linker = Mom::MomCompiler.new.translate(:interpreter)
|
||||||
@binary = Parfait::BinaryCode.new(1)
|
@binary = Parfait::BinaryCode.new(1)
|
||||||
|
@ -3,7 +3,7 @@ require_relative "helper"
|
|||||||
module Risc
|
module Risc
|
||||||
class TestPositionTranslated < MiniTest::Test
|
class TestPositionTranslated < MiniTest::Test
|
||||||
def setup
|
def setup
|
||||||
Parfait.boot!
|
Parfait.boot!(Parfait.default_test_options)
|
||||||
Risc.boot!
|
Risc.boot!
|
||||||
@binary = Parfait::BinaryCode.new(1)
|
@binary = Parfait::BinaryCode.new(1)
|
||||||
@method = Parfait.object_space.types.values.first.methods
|
@method = Parfait.object_space.types.values.first.methods
|
||||||
|
@ -3,7 +3,7 @@ require_relative "helper"
|
|||||||
module Risc
|
module Risc
|
||||||
class TestInstructionListener < MiniTest::Test
|
class TestInstructionListener < MiniTest::Test
|
||||||
def setup
|
def setup
|
||||||
Parfait.boot!
|
Parfait.boot!(Parfait.default_test_options)
|
||||||
@binary = Parfait::BinaryCode.new(1)
|
@binary = Parfait::BinaryCode.new(1)
|
||||||
@bin_pos = Position.new(@binary).set(0)
|
@bin_pos = Position.new(@binary).set(0)
|
||||||
@instruction = DummyInstruction.new(DummyInstruction.new)
|
@instruction = DummyInstruction.new(DummyInstruction.new)
|
||||||
|
@ -4,7 +4,7 @@ module Risc
|
|||||||
class TestLabelListener < MiniTest::Test
|
class TestLabelListener < MiniTest::Test
|
||||||
|
|
||||||
def setup
|
def setup
|
||||||
Parfait.boot!
|
Parfait.boot!(Parfait.default_test_options)
|
||||||
@label = Label.new("Hi","Ho" , FakeAddress.new(5))
|
@label = Label.new("Hi","Ho" , FakeAddress.new(5))
|
||||||
@label_pos = Position.new(@label ).set(4)
|
@label_pos = Position.new(@label ).set(4)
|
||||||
@code = Parfait::BinaryCode.new(1)
|
@code = Parfait::BinaryCode.new(1)
|
||||||
|
@ -14,7 +14,7 @@ module Risc
|
|||||||
assert !@pos.valid?
|
assert !@pos.valid?
|
||||||
end
|
end
|
||||||
def test_next_slot
|
def test_next_slot
|
||||||
Parfait.boot!
|
Parfait.boot!(Parfait.default_test_options)
|
||||||
mov = Arm::ArmMachine.mov(:r1 , :r1)
|
mov = Arm::ArmMachine.mov(:r1 , :r1)
|
||||||
position = Position.new(mov ).set(0)
|
position = Position.new(mov ).set(0)
|
||||||
assert_equal 4, position.next_slot
|
assert_equal 4, position.next_slot
|
||||||
|
@ -3,7 +3,7 @@ require_relative "helper"
|
|||||||
module Risc
|
module Risc
|
||||||
class TestMachinePositions < MiniTest::Test
|
class TestMachinePositions < MiniTest::Test
|
||||||
def setup_for(platform)
|
def setup_for(platform)
|
||||||
Parfait.boot!
|
Parfait.boot!(Parfait.default_test_options)
|
||||||
Risc.boot!
|
Risc.boot!
|
||||||
@linker = Mom::MomCompiler.new.translate(platform)
|
@linker = Mom::MomCompiler.new.translate(platform)
|
||||||
@linker.position_all
|
@linker.position_all
|
||||||
|
@ -4,7 +4,7 @@ module Risc
|
|||||||
class TestCodeBuilder < MiniTest::Test
|
class TestCodeBuilder < MiniTest::Test
|
||||||
|
|
||||||
def setup
|
def setup
|
||||||
Parfait.boot!
|
Parfait.boot!(Parfait.default_test_options)
|
||||||
Risc.boot!
|
Risc.boot!
|
||||||
init = Parfait.object_space.get_init
|
init = Parfait.object_space.get_init
|
||||||
@builder = Risc::MethodCompiler.new( init ).builder(init)
|
@builder = Risc::MethodCompiler.new( init ).builder(init)
|
||||||
|
@ -4,7 +4,7 @@ module Risc
|
|||||||
class TestCompilerBuilder < MiniTest::Test
|
class TestCompilerBuilder < MiniTest::Test
|
||||||
|
|
||||||
def setup
|
def setup
|
||||||
Parfait.boot!
|
Parfait.boot!(Parfait.default_test_options)
|
||||||
Risc.boot!
|
Risc.boot!
|
||||||
@init = Parfait.object_space.get_init
|
@init = Parfait.object_space.get_init
|
||||||
@compiler = Risc::MethodCompiler.new( @init )
|
@compiler = Risc::MethodCompiler.new( @init )
|
||||||
|
@ -4,7 +4,7 @@ module Risc
|
|||||||
class TestBuilderInfer < MiniTest::Test
|
class TestBuilderInfer < MiniTest::Test
|
||||||
|
|
||||||
def setup
|
def setup
|
||||||
Parfait.boot!
|
Parfait.boot!(Parfait.default_test_options)
|
||||||
Risc.boot!
|
Risc.boot!
|
||||||
@init = Parfait.object_space.get_init
|
@init = Parfait.object_space.get_init
|
||||||
@compiler = Risc::MethodCompiler.new( @init )
|
@compiler = Risc::MethodCompiler.new( @init )
|
||||||
|
@ -4,7 +4,7 @@ module Risc
|
|||||||
class TestBuiltinFunction < MiniTest::Test
|
class TestBuiltinFunction < MiniTest::Test
|
||||||
|
|
||||||
def setup
|
def setup
|
||||||
Parfait.boot!
|
Parfait.boot!(Parfait.default_test_options)
|
||||||
end
|
end
|
||||||
def test_has_boot_function
|
def test_has_boot_function
|
||||||
assert Builtin.boot_functions
|
assert Builtin.boot_functions
|
||||||
|
@ -4,7 +4,7 @@ module Risc
|
|||||||
class TestCollector < MiniTest::Test
|
class TestCollector < MiniTest::Test
|
||||||
|
|
||||||
def setup
|
def setup
|
||||||
Parfait.boot!
|
Parfait.boot!(Parfait.default_test_options)
|
||||||
Risc.boot!
|
Risc.boot!
|
||||||
@linker = Mom::MomCompiler.new.translate(:arm)
|
@linker = Mom::MomCompiler.new.translate(:arm)
|
||||||
end
|
end
|
||||||
|
@ -3,7 +3,7 @@ require_relative "helper"
|
|||||||
module Risc
|
module Risc
|
||||||
class TestInterpreterBasics < MiniTest::Test
|
class TestInterpreterBasics < MiniTest::Test
|
||||||
def setup
|
def setup
|
||||||
Parfait.boot!
|
Parfait.boot!(Parfait.default_test_options)
|
||||||
Risc.boot!
|
Risc.boot!
|
||||||
@linker = Mom::MomCompiler.new.translate(:interpreter)
|
@linker = Mom::MomCompiler.new.translate(:interpreter)
|
||||||
end
|
end
|
||||||
|
@ -21,7 +21,7 @@ module Risc
|
|||||||
class TestIdentityTranslator < MiniTest::Test
|
class TestIdentityTranslator < MiniTest::Test
|
||||||
|
|
||||||
def setup
|
def setup
|
||||||
Parfait.boot!
|
Parfait.boot!(Parfait.default_test_options)
|
||||||
Risc.boot!
|
Risc.boot!
|
||||||
@translator = IdentityTranslator.new
|
@translator = IdentityTranslator.new
|
||||||
end
|
end
|
||||||
|
@ -4,7 +4,7 @@ module Risc
|
|||||||
class TestLinkerObjects < MiniTest::Test
|
class TestLinkerObjects < MiniTest::Test
|
||||||
|
|
||||||
def setup
|
def setup
|
||||||
Parfait.boot!
|
Parfait.boot!(Parfait.default_test_options)
|
||||||
Risc.boot!
|
Risc.boot!
|
||||||
@linker = Mom::MomCompiler.new.translate(:arm)
|
@linker = Mom::MomCompiler.new.translate(:arm)
|
||||||
end
|
end
|
||||||
@ -19,7 +19,7 @@ module Risc
|
|||||||
end
|
end
|
||||||
class TestLinkerInit < MiniTest::Test
|
class TestLinkerInit < MiniTest::Test
|
||||||
def setup
|
def setup
|
||||||
@linker = RubyX::RubyXCompiler.new.ruby_to_binary("class Space;def main;return 1;end;end",:arm)
|
@linker = RubyX::RubyXCompiler.new(RubyX.default_test_options).ruby_to_binary("class Space;def main;return 1;end;end",:arm)
|
||||||
end
|
end
|
||||||
def test_pos_cpu
|
def test_pos_cpu
|
||||||
assert_equal 0 , Position.get(@linker.cpu_init).at
|
assert_equal 0 , Position.get(@linker.cpu_init).at
|
||||||
|
@ -4,7 +4,7 @@ module Risc
|
|||||||
class TestMachinePos < MiniTest::Test
|
class TestMachinePos < MiniTest::Test
|
||||||
def setup
|
def setup
|
||||||
code = "class Space; def main(arg);a = 1;return a;end;end"
|
code = "class Space; def main(arg);a = 1;return a;end;end"
|
||||||
@linker = RubyX::RubyXCompiler.new.ruby_to_risc(code,:arm)
|
@linker = RubyX::RubyXCompiler.new(RubyX.default_test_options).ruby_to_risc(code,:arm)
|
||||||
@linker.position_all
|
@linker.position_all
|
||||||
end
|
end
|
||||||
def test_positions_set
|
def test_positions_set
|
||||||
|
@ -8,12 +8,12 @@ module Risc
|
|||||||
end
|
end
|
||||||
|
|
||||||
def in_test_vool(str)
|
def in_test_vool(str)
|
||||||
vool = RubyX::RubyXCompiler.new.ruby_to_vool(in_Test(str))
|
vool = RubyX::RubyXCompiler.new(RubyX.default_test_options).ruby_to_vool(in_Test(str))
|
||||||
vool.to_mom(nil)
|
vool.to_mom(nil)
|
||||||
vool
|
vool
|
||||||
end
|
end
|
||||||
def in_test_mom(str)
|
def in_test_mom(str)
|
||||||
RubyX::RubyXCompiler.new(in_Test(str)).ruby_to_mom()
|
FIXMERubyX::RubyXCompiler.new(in_Test(str)).ruby_to_mom()
|
||||||
end
|
end
|
||||||
def create_method(body = "@ivar = 5")
|
def create_method(body = "@ivar = 5")
|
||||||
in_test_vool("def meth; #{body};end")
|
in_test_vool("def meth; #{body};end")
|
||||||
@ -64,7 +64,7 @@ module Risc
|
|||||||
assert_equal 2 , method.frame_type.variable_index(:a)
|
assert_equal 2 , method.frame_type.variable_index(:a)
|
||||||
end
|
end
|
||||||
def constant_setup(input)
|
def constant_setup(input)
|
||||||
mom = RubyX::RubyXCompiler.new.ruby_to_mom(in_Test(input))
|
mom = RubyX::RubyXCompiler.new(RubyX.default_test_options).ruby_to_mom(in_Test(input))
|
||||||
assert_equal Mom::MomCompiler , mom.class
|
assert_equal Mom::MomCompiler , mom.class
|
||||||
compiler = mom.method_compilers.first
|
compiler = mom.method_compilers.first
|
||||||
assert_equal MethodCompiler , compiler.class
|
assert_equal MethodCompiler , compiler.class
|
||||||
|
@ -4,7 +4,7 @@ module Risc
|
|||||||
class TestPadding < MiniTest::Test
|
class TestPadding < MiniTest::Test
|
||||||
|
|
||||||
def setup
|
def setup
|
||||||
Parfait.boot!
|
Parfait.boot!(Parfait.default_test_options)
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_small
|
def test_small
|
||||||
|
@ -4,7 +4,7 @@ module Parfait
|
|||||||
class TestAdapter < MiniTest::Test
|
class TestAdapter < MiniTest::Test
|
||||||
|
|
||||||
def setup
|
def setup
|
||||||
Parfait.boot!
|
Parfait.boot!(Parfait.default_test_options)
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_list_create_from_array
|
def test_list_create_from_array
|
||||||
|
@ -10,7 +10,7 @@ module Risc
|
|||||||
class TestRegisterValue < MiniTest::Test
|
class TestRegisterValue < MiniTest::Test
|
||||||
|
|
||||||
def setup
|
def setup
|
||||||
Parfait.boot!
|
Parfait.boot!(Parfait.default_test_options)
|
||||||
@r0 = RegisterValue.new(:r0 , :Message)
|
@r0 = RegisterValue.new(:r0 , :Message)
|
||||||
@r1 = RegisterValue.new(:r1 , :Space)
|
@r1 = RegisterValue.new(:r1 , :Space)
|
||||||
@r2 = RegisterValue.new(:r1 , :Factory)
|
@r2 = RegisterValue.new(:r1 , :Factory)
|
||||||
|
@ -4,7 +4,7 @@ module Risc
|
|||||||
class TestRegisterValue1 < MiniTest::Test
|
class TestRegisterValue1 < MiniTest::Test
|
||||||
|
|
||||||
def setup
|
def setup
|
||||||
Parfait.boot!
|
Parfait.boot!(Parfait.default_test_options)
|
||||||
@r0 = RegisterValue.new(:r0 , :Message)
|
@r0 = RegisterValue.new(:r0 , :Message)
|
||||||
@r1 = RegisterValue.new(:r1 , :Space)
|
@r1 = RegisterValue.new(:r1 , :Space)
|
||||||
@compiler = FakeCompiler.new
|
@compiler = FakeCompiler.new
|
||||||
|
@ -4,7 +4,7 @@ module Risc
|
|||||||
class TestTextWriter < MiniTest::Test
|
class TestTextWriter < MiniTest::Test
|
||||||
|
|
||||||
def setup
|
def setup
|
||||||
Parfait.boot!
|
Parfait.boot!(Parfait.default_test_options)
|
||||||
Risc.boot!
|
Risc.boot!
|
||||||
@linker = Mom::MomCompiler.new.translate(:arm)
|
@linker = Mom::MomCompiler.new.translate(:arm)
|
||||||
end
|
end
|
||||||
@ -19,7 +19,7 @@ module Risc
|
|||||||
class TestTextWriterPositions < MiniTest::Test
|
class TestTextWriterPositions < MiniTest::Test
|
||||||
|
|
||||||
def setup
|
def setup
|
||||||
Parfait.boot!
|
Parfait.boot!(Parfait.default_test_options)
|
||||||
Risc.boot!
|
Risc.boot!
|
||||||
@linker = Mom::MomCompiler.new.translate(:arm)
|
@linker = Mom::MomCompiler.new.translate(:arm)
|
||||||
@linker.position_all
|
@linker.position_all
|
||||||
|
@ -4,7 +4,7 @@ module Risc
|
|||||||
class TestTranslator < MiniTest::Test
|
class TestTranslator < MiniTest::Test
|
||||||
|
|
||||||
def setup
|
def setup
|
||||||
Parfait.boot!
|
Parfait.boot!(Parfait.default_test_options)
|
||||||
@translator = Arm::Translator.new
|
@translator = Arm::Translator.new
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -3,14 +3,14 @@ require_relative "../helper"
|
|||||||
module Ruby
|
module Ruby
|
||||||
module RubyTests
|
module RubyTests
|
||||||
def setup
|
def setup
|
||||||
Parfait.boot!
|
Parfait.boot!(Parfait.default_test_options)
|
||||||
end
|
end
|
||||||
def compile(input)
|
def compile(input)
|
||||||
RubyCompiler.compile(input)
|
RubyCompiler.compile(input)
|
||||||
end
|
end
|
||||||
|
|
||||||
def ruby_to_vool(input)
|
def ruby_to_vool(input)
|
||||||
RubyXCompiler.new(input).ruby_to_vool
|
FIXMERubyXCompiler.new(input).ruby_to_vool
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
@ -51,7 +51,7 @@ module Ruby
|
|||||||
include RubyTests
|
include RubyTests
|
||||||
|
|
||||||
def setup
|
def setup
|
||||||
Parfait.boot!
|
Parfait.boot!(Parfait.default_test_options)
|
||||||
end
|
end
|
||||||
def compile_const( input )
|
def compile_const( input )
|
||||||
lst = compile( input )
|
lst = compile( input )
|
||||||
@ -83,7 +83,7 @@ module Ruby
|
|||||||
include RubyTests
|
include RubyTests
|
||||||
|
|
||||||
def setup
|
def setup
|
||||||
Parfait.boot!
|
Parfait.boot!(Parfait.default_test_options)
|
||||||
end
|
end
|
||||||
def compile_const( input )
|
def compile_const( input )
|
||||||
lst = compile( input )
|
lst = compile( input )
|
||||||
|
@ -67,7 +67,7 @@ module Ruby
|
|||||||
include RubyTests
|
include RubyTests
|
||||||
|
|
||||||
def setup
|
def setup
|
||||||
Parfait.boot!
|
Parfait.boot!(Parfait.default_test_options)
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_int_receiver
|
def test_int_receiver
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
require_relative "../helper"
|
require_relative "../helper"
|
||||||
|
|
||||||
module RubyX
|
module RubyX
|
||||||
|
|
||||||
module RubyXHelper
|
module RubyXHelper
|
||||||
def setup
|
def setup
|
||||||
end
|
end
|
||||||
@ -9,10 +10,10 @@ module RubyX
|
|||||||
mom.translate(platform)
|
mom.translate(platform)
|
||||||
end
|
end
|
||||||
def ruby_to_vool(input)
|
def ruby_to_vool(input)
|
||||||
RubyXCompiler.new.ruby_to_vool(input)
|
RubyXCompiler.new(RubyX.default_test_options).ruby_to_vool(input)
|
||||||
end
|
end
|
||||||
def ruby_to_mom(input)
|
def ruby_to_mom(input)
|
||||||
RubyXCompiler.new.ruby_to_mom(input)
|
RubyXCompiler.new(RubyX.default_test_options).ruby_to_mom(input)
|
||||||
end
|
end
|
||||||
def compile_in_test( input )
|
def compile_in_test( input )
|
||||||
vool = ruby_to_vool in_Test(input)
|
vool = ruby_to_vool in_Test(input)
|
||||||
|
@ -22,7 +22,7 @@ module RubyX
|
|||||||
end
|
end
|
||||||
|
|
||||||
def test_space_is_unchanged_by_compile
|
def test_space_is_unchanged_by_compile
|
||||||
compiler = RubyXCompiler.new
|
compiler = RubyXCompiler.new(RubyX.default_test_options)
|
||||||
space1 = Parfait.object_space.get_class_by_name(:Space)
|
space1 = Parfait.object_space.get_class_by_name(:Space)
|
||||||
compiler.ruby_to_vool "class Space ;end"
|
compiler.ruby_to_vool "class Space ;end"
|
||||||
space2 = Parfait.object_space.get_class_by_name(:Space)
|
space2 = Parfait.object_space.get_class_by_name(:Space)
|
||||||
@ -30,7 +30,7 @@ module RubyX
|
|||||||
end
|
end
|
||||||
|
|
||||||
def test_space_type_is_unchanged_by_compile
|
def test_space_type_is_unchanged_by_compile
|
||||||
compiler = RubyXCompiler.new
|
compiler = RubyXCompiler.new(RubyX.default_test_options)
|
||||||
space1 = Parfait.object_space.get_type_by_class_name(:Space)
|
space1 = Parfait.object_space.get_type_by_class_name(:Space)
|
||||||
compiler.ruby_to_vool "class Space ;end"
|
compiler.ruby_to_vool "class Space ;end"
|
||||||
space2 = Parfait.object_space.get_type_by_class_name(:Space)
|
space2 = Parfait.object_space.get_type_by_class_name(:Space)
|
||||||
|
@ -25,7 +25,7 @@ module RubyX
|
|||||||
end
|
end
|
||||||
|
|
||||||
def test_space_type_is_unchanged_by_compile
|
def test_space_type_is_unchanged_by_compile
|
||||||
compiler = RubyXCompiler.new
|
compiler = RubyXCompiler.new(RubyX.default_test_options)
|
||||||
space1 = Parfait.object_space.get_type_by_class_name(:Space)
|
space1 = Parfait.object_space.get_type_by_class_name(:Space)
|
||||||
compiler.ruby_to_vool "class Space ;end"
|
compiler.ruby_to_vool "class Space ;end"
|
||||||
space2 = Parfait.object_space.get_type_by_class_name(:Space)
|
space2 = Parfait.object_space.get_type_by_class_name(:Space)
|
||||||
|
@ -9,23 +9,23 @@ module RubyX
|
|||||||
"class Space ; def #{name}(arg);return arg;end; end"
|
"class Space ; def #{name}(arg);return arg;end; end"
|
||||||
end
|
end
|
||||||
def test_return_linker
|
def test_return_linker
|
||||||
@linker = RubyXCompiler.ruby_to_binary(space_source_for("main"), :interpreter)
|
@linker = RubyXCompiler.ruby_to_binary(space_source_for("main"), :interpreter , RubyX.default_test_options)
|
||||||
assert_equal Risc::Linker , @linker.class
|
assert_equal Risc::Linker , @linker.class
|
||||||
end
|
end
|
||||||
def test_one_vool_call
|
def test_one_vool_call
|
||||||
compiler = RubyXCompiler.new
|
compiler = RubyXCompiler.new(RubyX.default_test_options)
|
||||||
compiler.ruby_to_vool(space_source_for("main"))
|
compiler.ruby_to_vool(space_source_for("main"))
|
||||||
assert_equal Vool::ClassStatement , compiler.vool.class
|
assert_equal Vool::ClassStatement , compiler.vool.class
|
||||||
end
|
end
|
||||||
def test_two_vool_calls
|
def test_two_vool_calls
|
||||||
compiler = RubyXCompiler.new
|
compiler = RubyXCompiler.new(RubyX.default_test_options)
|
||||||
compiler.ruby_to_vool(space_source_for("main"))
|
compiler.ruby_to_vool(space_source_for("main"))
|
||||||
compiler.ruby_to_vool(space_source_for("twain"))
|
compiler.ruby_to_vool(space_source_for("twain"))
|
||||||
assert_equal Vool::ScopeStatement , compiler.vool.class
|
assert_equal Vool::ScopeStatement , compiler.vool.class
|
||||||
assert_equal 2 , compiler.vool.length
|
assert_equal 2 , compiler.vool.length
|
||||||
end
|
end
|
||||||
def test_bin_two_sources
|
def test_bin_two_sources
|
||||||
compiler = RubyXCompiler.new
|
compiler = RubyXCompiler.new(RubyX.default_test_options)
|
||||||
compiler.ruby_to_vool(space_source_for("main"))
|
compiler.ruby_to_vool(space_source_for("main"))
|
||||||
compiler.ruby_to_vool(space_source_for("twain"))
|
compiler.ruby_to_vool(space_source_for("twain"))
|
||||||
linker = compiler.to_binary(:interpreter)
|
linker = compiler.to_binary(:interpreter)
|
||||||
|
@ -22,7 +22,7 @@ module MomCompile
|
|||||||
include ScopeHelper
|
include ScopeHelper
|
||||||
|
|
||||||
def compile_method(input)
|
def compile_method(input)
|
||||||
statements = RubyX::RubyXCompiler.new.ruby_to_vool(input)
|
statements = RubyX::RubyXCompiler.new(RubyX.default_test_options).ruby_to_vool(input)
|
||||||
assert statements.is_a?(Vool::ClassStatement)
|
assert statements.is_a?(Vool::ClassStatement)
|
||||||
ret = statements.to_mom(nil)
|
ret = statements.to_mom(nil)
|
||||||
assert_equal Parfait::Class , statements.clazz.class , statements
|
assert_equal Parfait::Class , statements.clazz.class , statements
|
||||||
@ -50,7 +50,7 @@ module MomCompile
|
|||||||
block.body.to_mom(block_c)
|
block.body.to_mom(block_c)
|
||||||
end
|
end
|
||||||
def compile_mom(input)
|
def compile_mom(input)
|
||||||
RubyX::RubyXCompiler.new.ruby_to_mom(input)
|
RubyX::RubyXCompiler.new(RubyX.default_test_options).ruby_to_mom(input)
|
||||||
end
|
end
|
||||||
|
|
||||||
def check_array( should , is )
|
def check_array( should , is )
|
||||||
|
11
test/support/options.rb
Normal file
11
test/support/options.rb
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
module Parfait
|
||||||
|
def self.default_test_options
|
||||||
|
{}
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
module RubyX
|
||||||
|
def self.default_test_options
|
||||||
|
{ parfait: Parfait.default_test_options}
|
||||||
|
end
|
||||||
|
end
|
@ -2,7 +2,7 @@ module Parfait
|
|||||||
class ParfaitTest < MiniTest::Test
|
class ParfaitTest < MiniTest::Test
|
||||||
|
|
||||||
def setup
|
def setup
|
||||||
Parfait.boot!
|
Parfait.boot!(Parfait.default_test_options)
|
||||||
@space = Parfait.object_space
|
@space = Parfait.object_space
|
||||||
end
|
end
|
||||||
def make_method
|
def make_method
|
||||||
|
@ -7,7 +7,8 @@ module Risc
|
|||||||
include ScopeHelper
|
include ScopeHelper
|
||||||
|
|
||||||
def setup
|
def setup
|
||||||
@linker = RubyX::RubyXCompiler.new.ruby_to_binary(@string_input, :interpreter)
|
compiler = RubyX::RubyXCompiler.new(RubyX.default_test_options)
|
||||||
|
@linker = compiler.ruby_to_binary(@string_input, :interpreter)
|
||||||
@interpreter = Interpreter.new(@linker)
|
@interpreter = Interpreter.new(@linker)
|
||||||
@interpreter.start_program
|
@interpreter.start_program
|
||||||
end
|
end
|
||||||
|
@ -5,7 +5,7 @@ module VoolBlocks
|
|||||||
include MomCompile
|
include MomCompile
|
||||||
|
|
||||||
def setup
|
def setup
|
||||||
Parfait.boot!
|
Parfait.boot!(Parfait.default_test_options)
|
||||||
@ins = compile_first_block( "local = 5")
|
@ins = compile_first_block( "local = 5")
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -32,7 +32,7 @@ module VoolBlocks
|
|||||||
class TestAssignMomInstanceToLocal < MiniTest::Test
|
class TestAssignMomInstanceToLocal < MiniTest::Test
|
||||||
include MomCompile
|
include MomCompile
|
||||||
def setup
|
def setup
|
||||||
Parfait.boot!
|
Parfait.boot!(Parfait.default_test_options)
|
||||||
@ins = compile_first_block( "local = @a" , "@a = 5") #second arg in method scope
|
@ins = compile_first_block( "local = @a" , "@a = 5") #second arg in method scope
|
||||||
end
|
end
|
||||||
def test_class_compiles
|
def test_class_compiles
|
||||||
@ -50,7 +50,7 @@ module VoolBlocks
|
|||||||
include MomCompile
|
include MomCompile
|
||||||
|
|
||||||
def setup
|
def setup
|
||||||
Parfait.boot!
|
Parfait.boot!(Parfait.default_test_options)
|
||||||
@ins = compile_first_block( "arg = 5")
|
@ins = compile_first_block( "arg = 5")
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -68,7 +68,7 @@ module VoolBlocks
|
|||||||
class TestAssignMomToInstance < MiniTest::Test
|
class TestAssignMomToInstance < MiniTest::Test
|
||||||
include MomCompile
|
include MomCompile
|
||||||
def setup
|
def setup
|
||||||
Parfait.boot!
|
Parfait.boot!(Parfait.default_test_options)
|
||||||
end
|
end
|
||||||
def test_assigns_const
|
def test_assigns_const
|
||||||
@ins = compile_first_block( "@a = 5")
|
@ins = compile_first_block( "@a = 5")
|
||||||
|
@ -6,7 +6,7 @@ module VoolBlocks
|
|||||||
include Mom
|
include Mom
|
||||||
|
|
||||||
def setup
|
def setup
|
||||||
Parfait.boot!
|
Parfait.boot!(Parfait.default_test_options)
|
||||||
Risc::Builtin.boot_functions
|
Risc::Builtin.boot_functions
|
||||||
@ins = compile_first_block( "if(5.div4) ; @a = 6 ; else; @a = 5 ; end")
|
@ins = compile_first_block( "if(5.div4) ; @a = 6 ; else; @a = 5 ; end")
|
||||||
end
|
end
|
||||||
|
@ -6,7 +6,7 @@ module VoolBlocks
|
|||||||
include Mom
|
include Mom
|
||||||
|
|
||||||
def setup
|
def setup
|
||||||
Parfait.boot!
|
Parfait.boot!(Parfait.default_test_options)
|
||||||
@ins = compile_first_block( "while(@a) ; @a = 5 ; end")
|
@ins = compile_first_block( "while(@a) ; @a = 5 ; end")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ module Vool
|
|||||||
include MomCompile
|
include MomCompile
|
||||||
|
|
||||||
def setup
|
def setup
|
||||||
Parfait.boot!
|
Parfait.boot!(Parfait.default_test_options)
|
||||||
Risc::Builtin.boot_functions
|
Risc::Builtin.boot_functions
|
||||||
@ins = compile_first_method( send_method )
|
@ins = compile_first_method( send_method )
|
||||||
end
|
end
|
||||||
|
@ -6,7 +6,7 @@ module Vool
|
|||||||
include Mom
|
include Mom
|
||||||
|
|
||||||
def setup
|
def setup
|
||||||
Parfait.boot!
|
Parfait.boot!(Parfait.default_test_options)
|
||||||
Risc.boot!
|
Risc.boot!
|
||||||
@ins = compile_first_method( "a = main(1 + 2)" )
|
@ins = compile_first_method( "a = main(1 + 2)" )
|
||||||
end
|
end
|
||||||
|
@ -6,7 +6,7 @@ module Vool
|
|||||||
include Mom
|
include Mom
|
||||||
|
|
||||||
def setup
|
def setup
|
||||||
Parfait.boot!
|
Parfait.boot!(Parfait.default_test_options)
|
||||||
@ins = compile_first_method( "a = 5; a.div4")
|
@ins = compile_first_method( "a = 5; a.div4")
|
||||||
end
|
end
|
||||||
def test_check_type
|
def test_check_type
|
||||||
|
@ -5,7 +5,7 @@ module Vool
|
|||||||
include MomCompile
|
include MomCompile
|
||||||
|
|
||||||
def setup
|
def setup
|
||||||
Parfait.boot!
|
Parfait.boot!(Parfait.default_test_options)
|
||||||
@ins = compile_first_method( "local = 5")
|
@ins = compile_first_method( "local = 5")
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -36,7 +36,7 @@ module Vool
|
|||||||
class TestAssignMomInstanceToLocal < MiniTest::Test
|
class TestAssignMomInstanceToLocal < MiniTest::Test
|
||||||
include MomCompile
|
include MomCompile
|
||||||
def setup
|
def setup
|
||||||
Parfait.boot!
|
Parfait.boot!(Parfait.default_test_options)
|
||||||
@ins = compile_first_method( "@a = 5 ; local = @a")
|
@ins = compile_first_method( "@a = 5 ; local = @a")
|
||||||
end
|
end
|
||||||
def test_class_compiles
|
def test_class_compiles
|
||||||
@ -49,7 +49,7 @@ module Vool
|
|||||||
include MomCompile
|
include MomCompile
|
||||||
|
|
||||||
def setup
|
def setup
|
||||||
Parfait.boot!
|
Parfait.boot!(Parfait.default_test_options)
|
||||||
@ins = compile_first_method( "arg = 5")
|
@ins = compile_first_method( "arg = 5")
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -73,7 +73,7 @@ module Vool
|
|||||||
class TestAssignMomToInstance < MiniTest::Test
|
class TestAssignMomToInstance < MiniTest::Test
|
||||||
include MomCompile
|
include MomCompile
|
||||||
def setup
|
def setup
|
||||||
Parfait.boot!
|
Parfait.boot!(Parfait.default_test_options)
|
||||||
end
|
end
|
||||||
def test_assigns_const
|
def test_assigns_const
|
||||||
@ins = compile_first_method( "@a = 5")
|
@ins = compile_first_method( "@a = 5")
|
||||||
|
@ -6,7 +6,7 @@ module Vool
|
|||||||
include Mom
|
include Mom
|
||||||
|
|
||||||
def setup
|
def setup
|
||||||
Parfait.boot!
|
Parfait.boot!(Parfait.default_test_options)
|
||||||
Risc::Builtin.boot_functions
|
Risc::Builtin.boot_functions
|
||||||
@ins = compile_first_method( "if(5.div4) ; @a = 6 ; else; @a = 5 ; end")
|
@ins = compile_first_method( "if(5.div4) ; @a = 6 ; else; @a = 5 ; end")
|
||||||
end
|
end
|
||||||
|
@ -7,7 +7,7 @@ module Vool
|
|||||||
include Mom
|
include Mom
|
||||||
|
|
||||||
def setup
|
def setup
|
||||||
Parfait.boot!
|
Parfait.boot!(Parfait.default_test_options)
|
||||||
@ins = compile_first_method( "if(@a) ; @a = 5 ; end")
|
@ins = compile_first_method( "if(@a) ; @a = 5 ; end")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@ module Vool
|
|||||||
include Mom
|
include Mom
|
||||||
|
|
||||||
def setup
|
def setup
|
||||||
Parfait.boot!
|
Parfait.boot!(Parfait.default_test_options)
|
||||||
@ins = compile_first_method( "if(@a) ; @a = 5 ; else; @a = 6 ; end")
|
@ins = compile_first_method( "if(@a) ; @a = 5 ; else; @a = 6 ; end")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@ module Vool
|
|||||||
include MomCompile
|
include MomCompile
|
||||||
|
|
||||||
def setup
|
def setup
|
||||||
Parfait.boot!
|
Parfait.boot!(Parfait.default_test_options)
|
||||||
@ins = compile_first_method( "@a = 5")
|
@ins = compile_first_method( "@a = 5")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@ module Vool
|
|||||||
include MomCompile
|
include MomCompile
|
||||||
|
|
||||||
def setup
|
def setup
|
||||||
Parfait.boot!
|
Parfait.boot!(Parfait.default_test_options)
|
||||||
@ins = compile_first_method( "a = 5")
|
@ins = compile_first_method( "a = 5")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ module Vool
|
|||||||
include Mom
|
include Mom
|
||||||
|
|
||||||
def setup
|
def setup
|
||||||
Parfait.boot!
|
Parfait.boot!(Parfait.default_test_options)
|
||||||
@inst = compile_first_method( "return 5")
|
@inst = compile_first_method( "return 5")
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -43,7 +43,7 @@ module Vool
|
|||||||
include Mom
|
include Mom
|
||||||
|
|
||||||
def setup
|
def setup
|
||||||
Parfait.boot!
|
Parfait.boot!(Parfait.default_test_options)
|
||||||
Risc.boot!
|
Risc.boot!
|
||||||
@ins = compile_first_method( "return 5.div4")
|
@ins = compile_first_method( "return 5.div4")
|
||||||
end
|
end
|
||||||
|
@ -7,7 +7,7 @@ module Vool
|
|||||||
include Mom
|
include Mom
|
||||||
|
|
||||||
def setup
|
def setup
|
||||||
Parfait.boot!
|
Parfait.boot!(Parfait.default_test_options)
|
||||||
Risc::Builtin.boot_functions
|
Risc::Builtin.boot_functions
|
||||||
@ins = compile_first_method( "while(5.div4) ; 5.div4 ; end")
|
@ins = compile_first_method( "while(5.div4) ; 5.div4 ; end")
|
||||||
end
|
end
|
||||||
|
@ -6,7 +6,7 @@ module Vool
|
|||||||
include Mom
|
include Mom
|
||||||
|
|
||||||
def setup
|
def setup
|
||||||
Parfait.boot!
|
Parfait.boot!(Parfait.default_test_options)
|
||||||
@ins = compile_first_method( "while(@a) ; @a = 5 ; end")
|
@ins = compile_first_method( "while(@a) ; @a = 5 ; end")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -59,7 +59,7 @@ module Vool
|
|||||||
include YieldBasics
|
include YieldBasics
|
||||||
|
|
||||||
def setup
|
def setup
|
||||||
Parfait.boot!
|
Parfait.boot!(Parfait.default_test_options)
|
||||||
@ins = compile_first_method( "return yield(1)" )
|
@ins = compile_first_method( "return yield(1)" )
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -83,7 +83,7 @@ module Vool
|
|||||||
include Mom
|
include Mom
|
||||||
include YieldBasics
|
include YieldBasics
|
||||||
def setup
|
def setup
|
||||||
Parfait.boot!
|
Parfait.boot!(Parfait.default_test_options)
|
||||||
@ins = compile_first_method( "return yield" )
|
@ins = compile_first_method( "return yield" )
|
||||||
end
|
end
|
||||||
def test_array
|
def test_array
|
||||||
|
Loading…
Reference in New Issue
Block a user