fix fragment tests to actually execute on the pi and check the output
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user