2015-11-18 12:04:57 +01:00
|
|
|
require_relative '../helper'
|
2015-11-07 16:37:41 +01:00
|
|
|
|
2015-11-18 12:04:57 +01:00
|
|
|
# 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
|
2015-11-07 16:37:41 +01:00
|
|
|
|
|
|
|
def setup
|
|
|
|
@stdout = ""
|
2015-11-18 12:04:57 +01:00
|
|
|
@machine = Register.machine.boot
|
|
|
|
Soml::Compiler.load_parfait
|
2015-11-07 16:37:41 +01:00
|
|
|
end
|
2015-11-18 12:04:57 +01:00
|
|
|
|
2015-11-07 16:37:41 +01:00
|
|
|
def main
|
2015-11-18 12:04:57 +01:00
|
|
|
runko = <<HERE
|
2015-11-30 15:09:12 +01:00
|
|
|
class Space < Object
|
2015-11-07 16:37:41 +01:00
|
|
|
int main()
|
|
|
|
PROGRAM
|
|
|
|
end
|
|
|
|
end
|
|
|
|
HERE
|
2015-11-18 12:04:57 +01:00
|
|
|
runko.sub("PROGRAM" , @main )
|
2015-11-07 16:37:41 +01:00
|
|
|
end
|
|
|
|
end
|