diff --git a/test/risc/helper.rb b/test/risc/helper.rb index 7667f816..26258082 100644 --- a/test/risc/helper.rb +++ b/test/risc/helper.rb @@ -1,2 +1 @@ require_relative "../helper" -Risc.machine.boot unless Risc.machine.booted diff --git a/test/risc/interpreter/helper.rb b/test/risc/interpreter/helper.rb index 846d7cb0..26258082 100644 --- a/test/risc/interpreter/helper.rb +++ b/test/risc/interpreter/helper.rb @@ -1,24 +1 @@ require_relative "../helper" -require "util/eventable" -require "risc/interpreter" - -module Risc - module Ticker - include InterpreterHelpers - include CompilerHelper - - def setup - Risc.machine.boot - do_clean_compile - Vool::VoolCompiler.ruby_to_vool( @string_input ) - Collector.collect_space - @interpreter = Interpreter.new - @interpreter.start Risc.machine.risc_init - end - - # must be after boot, but before main compile, to define method - def do_clean_compile - end - - end -end diff --git a/test/support/interpreter_helpers.rb b/test/support/risc_interpreter.rb similarity index 83% rename from test/support/interpreter_helpers.rb rename to test/support/risc_interpreter.rb index 1c79a026..07d02093 100644 --- a/test/support/interpreter_helpers.rb +++ b/test/support/risc_interpreter.rb @@ -1,6 +1,23 @@ +require "util/eventable" +require "risc/interpreter" +require_relative "compiling" + module Risc - # relies on @interpreter instance to be set up during setup - module InterpreterHelpers + module Ticker + include CompilerHelper + + def setup + Risc.machine.boot + do_clean_compile + Vool::VoolCompiler.ruby_to_vool( @string_input ) + Collector.collect_space + @interpreter = Interpreter.new + @interpreter.start Risc.machine.risc_init + end + + # must be after boot, but before main compile, to define method + def do_clean_compile + end # check the given array of instructions is what the interpreter actually does # possible second argument ignores the given amount, usually up until main