rubyx/stash/soml/parfait/helper.rb
Torsten Ruger aa79e41d1c rename register to risc
seems to fit the layer much better as we really have a very reduced
instruction set
2017-01-19 09:02:29 +02:00

29 lines
545 B
Ruby

require_relative '../helper'
# Parfait test test just that, parfait.
#
# The idea is to have really really small main programs that test one very small thing
# AND return an exit code (or write stdout) that can be checked by
# compiling and running the thing remotely
#
module ParfaitTests
include RuntimeTests
def setup
@stdout = ""
@machine = Risc.machine.boot
Vm::Compiler.load_parfait
end
def main
runko = <<HERE
class Space < Object
int main()
PROGRAM
end
end
HERE
runko.sub("PROGRAM" , @main )
end
end