rearrange test helpers for later

This commit is contained in:
Torsten Rüger 2019-09-06 20:59:14 +03:00
parent f126aa52df
commit 646797301e
6 changed files with 37 additions and 16 deletions

View File

@ -20,6 +20,34 @@ module RubyX
assert itest
itest
end
end
module ParfaitHelper
def load_parfait(file)
File.read File.expand_path("../../../lib/parfait/#{file}.rb",__FILE__)
end
def load_parfait_test(file)
File.read File.expand_path("../../parfait/test_#{file}.rb",__FILE__)
end
def compiler
RubyXCompiler.new(RubyX.default_test_options)
end
def run_input
linker = compiler.ruby_to_binary(@input , :interpreter)
@interpreter = Risc::Interpreter.new(linker)
@interpreter.start_program
run_all
end
def run_all
while(@interpreter.instruction)
@interpreter.tick
#puts @interpreter.instruction
end
@interpreter.clock
end
end
end

View File

@ -1,13 +0,0 @@
require_relative "../helper"
module RubyX
module ParfaitHelper
def load_parfait(file)
File.read File.expand_path("../../../../lib/parfait/#{file}.rb",__FILE__)
end
def compiler
RubyXCompiler.new(RubyX.default_test_options)
end
end
end

View File

@ -1,4 +1,4 @@
require_relative "helper"
require_relative "../helper"
module RubyX

View File

@ -1,4 +1,4 @@
require_relative "helper"
require_relative "../helper"
module RubyX

View File

@ -1,4 +1,4 @@
require_relative "helper"
require_relative "../helper"
module RubyX

View File

@ -0,0 +1,6 @@
require_relative "../helper"
module RubyX
module Helper
end
end