calculator/tests/test_math.sh
2025-02-13 20:32:39 +10:00

16 lines
320 B
Bash

#!/bin/sh
test_add64() {
result=$("${QEMU}" -B 0x80000000 -s 2k tests/math_add64.elf)
# 3.5
# 3.75
expected=$(cat << END
00000003.80000000
00000003.C0000000
END
)
# TODO: Ideally this test would allow calling the binary repeatedly with
# different inputs.
test $? -eq 0 && test "$result" = "$expected"
}