better framework for running arm test

more explicit, rather than gobbling files, pass code in
preload is available (so code does not have to be duplicated)
interpret first, so bad mistakes get caught
no ssh, just qemu-arm, configure through env
This commit is contained in:
2020-03-26 20:28:59 +02:00
parent 4bae5c418b
commit 94e4f3a9bf
2 changed files with 106 additions and 0 deletions

31
test/mains/test_assign.rb Normal file
View File

@ -0,0 +1,31 @@
require_relative "helper"
module Mains
class AssignTester < MiniTest::Test
include MainsHelper
def test_local
@input = as_main 'a = 15 ; return a'
assert_result 15 , ""
end
def test_plus
@preload = "Integer.plus"
@input = as_main("a = 5 + 5 ; return a")
assert_result 10 , ""
end
def test_plus2
@preload = "Integer.plus"
@input = as_main("a = 5 ;a = 5 + a ; return a")
assert_result 10 , ""
end
def test_plus3
@preload = "Integer.plus"
@input = as_main("a = 5 ;a = 5 + a ;a = a + 5; return a")
assert_result 15 , ""
end
end
end