rearrange test helpers for later
This commit is contained in:
parent
f126aa52df
commit
646797301e
@ -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
|
||||
|
@ -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
|
@ -1,4 +1,4 @@
|
||||
require_relative "helper"
|
||||
require_relative "../helper"
|
||||
|
||||
module RubyX
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
require_relative "helper"
|
||||
require_relative "../helper"
|
||||
|
||||
module RubyX
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
require_relative "helper"
|
||||
require_relative "../helper"
|
||||
|
||||
module RubyX
|
||||
|
||||
|
6
test/rubyx/rt_parfait/rt_helper.rb
Normal file
6
test/rubyx/rt_parfait/rt_helper.rb
Normal file
@ -0,0 +1,6 @@
|
||||
require_relative "../helper"
|
||||
|
||||
module RubyX
|
||||
module Helper
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue
Block a user