Starting to parse parfait tests
will have to detour via require next
This commit is contained in:
parent
363d1cb36f
commit
1539904ee2
18
test/rubyx/rt_parfait/helper.rb
Normal file
18
test/rubyx/rt_parfait/helper.rb
Normal 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
|
20
test/rubyx/rt_parfait/test_object.rb
Normal file
20
test/rubyx/rt_parfait/test_object.rb
Normal 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
|
Loading…
Reference in New Issue
Block a user