fix all tests for previous commit

This commit is contained in:
Torsten Ruger
2019-02-08 23:03:23 +02:00
parent 74b790250a
commit 37eeb81f45
71 changed files with 117 additions and 94 deletions
+1 -1
View File
@@ -21,7 +21,7 @@ module Risc
end
class DummyPlatform
def self.boot
Parfait.boot!
Parfait.boot!(Parfait.default_test_options)
Risc.boot!
end
def translator
+1 -1
View File
@@ -4,7 +4,7 @@ require 'minitest/mock'
module Risc
class TestBranchListenerBooted < MiniTest::Test
def setup
Parfait.boot!
Parfait.boot!(Parfait.default_test_options)
Risc.boot!
@binary = Parfait::BinaryCode.new(1)
@bin_pos = CodeListener.init(@binary,:interpreter).set(0)
+1 -1
View File
@@ -3,7 +3,7 @@ require_relative "helper"
module Risc
class TestCodeListener < MiniTest::Test
def setup
Parfait.boot!
Parfait.boot!(Parfait.default_test_options)
@binary = Parfait::BinaryCode.new(1)
@method = Parfait.object_space.types.values.first.methods
@label = Risc.label("hi","ho")
+1 -1
View File
@@ -3,7 +3,7 @@ require_relative "helper"
module Risc
class TestCodeListenerFull < MiniTest::Test
def setup
Parfait.boot!
Parfait.boot!(Parfait.default_test_options)
Risc.boot!
@linker = Mom::MomCompiler.new.translate(:interpreter)
@binary = Parfait::BinaryCode.new(1)
+1 -1
View File
@@ -3,7 +3,7 @@ require_relative "helper"
module Risc
class TestPositionTranslated < MiniTest::Test
def setup
Parfait.boot!
Parfait.boot!(Parfait.default_test_options)
Risc.boot!
@binary = Parfait::BinaryCode.new(1)
@method = Parfait.object_space.types.values.first.methods
@@ -3,7 +3,7 @@ require_relative "helper"
module Risc
class TestInstructionListener < MiniTest::Test
def setup
Parfait.boot!
Parfait.boot!(Parfait.default_test_options)
@binary = Parfait::BinaryCode.new(1)
@bin_pos = Position.new(@binary).set(0)
@instruction = DummyInstruction.new(DummyInstruction.new)
+1 -1
View File
@@ -4,7 +4,7 @@ module Risc
class TestLabelListener < MiniTest::Test
def setup
Parfait.boot!
Parfait.boot!(Parfait.default_test_options)
@label = Label.new("Hi","Ho" , FakeAddress.new(5))
@label_pos = Position.new(@label ).set(4)
@code = Parfait::BinaryCode.new(1)
+1 -1
View File
@@ -14,7 +14,7 @@ module Risc
assert !@pos.valid?
end
def test_next_slot
Parfait.boot!
Parfait.boot!(Parfait.default_test_options)
mov = Arm::ArmMachine.mov(:r1 , :r1)
position = Position.new(mov ).set(0)
assert_equal 4, position.next_slot
+1 -1
View File
@@ -3,7 +3,7 @@ require_relative "helper"
module Risc
class TestMachinePositions < MiniTest::Test
def setup_for(platform)
Parfait.boot!
Parfait.boot!(Parfait.default_test_options)
Risc.boot!
@linker = Mom::MomCompiler.new.translate(platform)
@linker.position_all
+1 -1
View File
@@ -4,7 +4,7 @@ module Risc
class TestCodeBuilder < MiniTest::Test
def setup
Parfait.boot!
Parfait.boot!(Parfait.default_test_options)
Risc.boot!
init = Parfait.object_space.get_init
@builder = Risc::MethodCompiler.new( init ).builder(init)
+1 -1
View File
@@ -4,7 +4,7 @@ module Risc
class TestCompilerBuilder < MiniTest::Test
def setup
Parfait.boot!
Parfait.boot!(Parfait.default_test_options)
Risc.boot!
@init = Parfait.object_space.get_init
@compiler = Risc::MethodCompiler.new( @init )
+1 -1
View File
@@ -4,7 +4,7 @@ module Risc
class TestBuilderInfer < MiniTest::Test
def setup
Parfait.boot!
Parfait.boot!(Parfait.default_test_options)
Risc.boot!
@init = Parfait.object_space.get_init
@compiler = Risc::MethodCompiler.new( @init )
+1 -1
View File
@@ -4,7 +4,7 @@ module Risc
class TestBuiltinFunction < MiniTest::Test
def setup
Parfait.boot!
Parfait.boot!(Parfait.default_test_options)
end
def test_has_boot_function
assert Builtin.boot_functions
+1 -1
View File
@@ -4,7 +4,7 @@ module Risc
class TestCollector < MiniTest::Test
def setup
Parfait.boot!
Parfait.boot!(Parfait.default_test_options)
Risc.boot!
@linker = Mom::MomCompiler.new.translate(:arm)
end
+1 -1
View File
@@ -3,7 +3,7 @@ require_relative "helper"
module Risc
class TestInterpreterBasics < MiniTest::Test
def setup
Parfait.boot!
Parfait.boot!(Parfait.default_test_options)
Risc.boot!
@linker = Mom::MomCompiler.new.translate(:interpreter)
end
+1 -1
View File
@@ -21,7 +21,7 @@ module Risc
class TestIdentityTranslator < MiniTest::Test
def setup
Parfait.boot!
Parfait.boot!(Parfait.default_test_options)
Risc.boot!
@translator = IdentityTranslator.new
end
+2 -2
View File
@@ -4,7 +4,7 @@ module Risc
class TestLinkerObjects < MiniTest::Test
def setup
Parfait.boot!
Parfait.boot!(Parfait.default_test_options)
Risc.boot!
@linker = Mom::MomCompiler.new.translate(:arm)
end
@@ -19,7 +19,7 @@ module Risc
end
class TestLinkerInit < MiniTest::Test
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
def test_pos_cpu
assert_equal 0 , Position.get(@linker.cpu_init).at
+1 -1
View File
@@ -4,7 +4,7 @@ module Risc
class TestMachinePos < MiniTest::Test
def setup
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
end
def test_positions_set
+3 -3
View File
@@ -8,12 +8,12 @@ module Risc
end
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
end
def in_test_mom(str)
RubyX::RubyXCompiler.new(in_Test(str)).ruby_to_mom()
FIXMERubyX::RubyXCompiler.new(in_Test(str)).ruby_to_mom()
end
def create_method(body = "@ivar = 5")
in_test_vool("def meth; #{body};end")
@@ -64,7 +64,7 @@ module Risc
assert_equal 2 , method.frame_type.variable_index(:a)
end
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
compiler = mom.method_compilers.first
assert_equal MethodCompiler , compiler.class
+1 -1
View File
@@ -4,7 +4,7 @@ module Risc
class TestPadding < MiniTest::Test
def setup
Parfait.boot!
Parfait.boot!(Parfait.default_test_options)
end
def test_small
+1 -1
View File
@@ -4,7 +4,7 @@ module Parfait
class TestAdapter < MiniTest::Test
def setup
Parfait.boot!
Parfait.boot!(Parfait.default_test_options)
end
def test_list_create_from_array
+1 -1
View File
@@ -10,7 +10,7 @@ module Risc
class TestRegisterValue < MiniTest::Test
def setup
Parfait.boot!
Parfait.boot!(Parfait.default_test_options)
@r0 = RegisterValue.new(:r0 , :Message)
@r1 = RegisterValue.new(:r1 , :Space)
@r2 = RegisterValue.new(:r1 , :Factory)
+1 -1
View File
@@ -4,7 +4,7 @@ module Risc
class TestRegisterValue1 < MiniTest::Test
def setup
Parfait.boot!
Parfait.boot!(Parfait.default_test_options)
@r0 = RegisterValue.new(:r0 , :Message)
@r1 = RegisterValue.new(:r1 , :Space)
@compiler = FakeCompiler.new
+2 -2
View File
@@ -4,7 +4,7 @@ module Risc
class TestTextWriter < MiniTest::Test
def setup
Parfait.boot!
Parfait.boot!(Parfait.default_test_options)
Risc.boot!
@linker = Mom::MomCompiler.new.translate(:arm)
end
@@ -19,7 +19,7 @@ module Risc
class TestTextWriterPositions < MiniTest::Test
def setup
Parfait.boot!
Parfait.boot!(Parfait.default_test_options)
Risc.boot!
@linker = Mom::MomCompiler.new.translate(:arm)
@linker.position_all
+1 -1
View File
@@ -4,7 +4,7 @@ module Risc
class TestTranslator < MiniTest::Test
def setup
Parfait.boot!
Parfait.boot!(Parfait.default_test_options)
@translator = Arm::Translator.new
end