Starting to parse parfait tests

will have to detour via require next
This commit is contained in:
Torsten Rüger 2019-09-06 21:02:09 +03:00
parent 363d1cb36f
commit 1539904ee2
2 changed files with 38 additions and 0 deletions

View File

@ -0,0 +1,18 @@
#
# This is the helper for the runtime tests.
# That means the code is parsed and helps execute rt tests for parfait.
# (also means this is never loaded at test time)
#
# The aim is to us the tests at /tests/parfait to test parfait at runtime
# To achieve that, we implement the ParfaitTest, as a mini MiniTest
class ParfaitTest
def setup
@space = Parfait.object_space
end
def assert(arg)
return unless(arg)
"No passed".putstring
exit(1)
end
end

View File

@ -0,0 +1,20 @@
require_relative "rt_helper"
module RubyX
class ObjectTest < MiniTest::Test
include ParfaitHelper
def setup
@input = load_parfait(:object) #+ load_parfait_test(:object)
end
def test_basics
risc = compiler.ruby_to_binary @input , :interpreter
assert_equal Risc::Linker , risc.class
end
def test_run_all
@input += "class Space;def main(arg);::Parfait::Object.new;end;end"
run_input
end
end
end