calculator/tests/test_hex.sh

16 lines
449 B
Bash

#!/bin/sh
test_btohex() {
# FIXME: Remove grep when this bug is fixed:
# https://github.com/sysprog21/rv32emu/issues/561
result=$("${QEMU}" -B 0x80000000 -s 2k tests/btohex.elf | grep '^a0:')
# 3541 is 5A in ASCII (reversed from input due to little endian)
test $? -eq 0 && test "${result}" = "a0: 00003541"
}
test_tohex() {
result=$("${QEMU}" -B 0x80000000 -s 2k tests/tohex.elf)
test $? -eq 0 && test "${result}" = "CAFEFEED"
}