fix fragment tests to actually execute on the pi and check the output

This commit is contained in:
Torsten Ruger
2014-05-28 14:55:13 +03:00
parent e9720c4c54
commit 5a415aed92
9 changed files with 26 additions and 12 deletions

View File

@@ -37,12 +37,17 @@ module Fragments
writer = Elf::ObjectWriter.new(@program , Elf::Constants::TARGET_ARM)
assembly = writer.text
# use this for getting the bytes to compare to :
#puts assembly
puts assembly
writer.save("#{name}.o")
assembly.text.bytes.each_with_index do |byte , index|
is = @should[index]
assert_equal Fixnum , is.class , "@#{index.to_s(16)} = #{is}"
assert_equal byte , is , "@#{index.to_s(16)} #{byte.to_s(16)} != #{is.to_s(16)}"
end
if( RbConfig::CONFIG["build_cpu"] == "arm")
system "ld -N #{name}.o"
result = %x[./a.out]
assert_equal @output , result
end
end
end