From 050179fee45071c5ded52bf4b7ac35aa4b020300 Mon Sep 17 00:00:00 2001 From: Torsten Ruger Date: Wed, 18 Nov 2015 13:27:20 +0200 Subject: [PATCH] fix exit code check MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit did’t know exit codes are restricted to 1 byte (_really_ old stuff) take a swing at testing by testing low byte does leave room for error, but still something for this stage --- test/soml/helper.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/test/soml/helper.rb b/test/soml/helper.rb index 0b897f9d..593b1e21 100644 --- a/test/soml/helper.rb +++ b/test/soml/helper.rb @@ -12,6 +12,8 @@ Rye::Cmd.add_command :aout, './a.out' # REMOTE has to be set to user@machine:port or it will default to an emulator # the minimum is REMOTE=username , and off course ssh keys have to be set up +# btw can't test with ruby on a PI as code creation only works on 64bit +# that's because ruby nibbles 2 bits from a word, and soml code doesn't work around that module RuntimeTests def setup @@ -37,7 +39,7 @@ module RuntimeTests assert_equal ret , @interpreter.get_register(:r0).return_value , "exit wrong #{@string_input}" end check_remote ret - file = write_object_file + write_object_file end def connected @@ -64,6 +66,7 @@ module RuntimeTests assert_equal "" , ret.stderr.join , "remote had error" if ret should = @interpreter.get_register(:r0).return_value + should &= 0xFF # don't knwo why exit codes are restricted but there you are assert_equal should , ret.exit_status.to_i , "remote exit failed for #{@string_input}" end end @@ -83,7 +86,7 @@ module RuntimeTests end def check_return_class val - check + check val assert_equal val , @interpreter.get_register(:r0).return_value.class end end