From f4d6835694086e9e54d97c2ced633718fc6bc34d Mon Sep 17 00:00:00 2001 From: Joseph Ferano Date: Mon, 15 Jan 2024 10:45:46 +0700 Subject: [PATCH] ASM test file improved error handling/reporting --- test_asm.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/test_asm.sh b/test_asm.sh index 457220a..77971f6 100755 --- a/test_asm.sh +++ b/test_asm.sh @@ -9,13 +9,18 @@ make asm_files > /dev/null for ASM_BIN in asm_files/*.bin; do ./decode "$ASM_BIN" > output.asm 2> /dev/null - nasm output.asm -o output.bin + nasm output.asm -o output.bin 2> /dev/null ASM_FILE=${ASM_BIN%.*}.asm + if [ ! -e output.bin ]; then + rm output.asm + echo -e "${ASM_FILE}: ${RED}Issue decoding assembly: Could not produce bin${NC}" + continue + fi diff "${ASM_BIN}" output.bin > /dev/null if [ $? -eq 0 ]; then echo -e "${ASM_FILE}: ${GREEN}Decoded properly${NC}" else - echo -e "${ASM_FILE}: ${RED}Issue decoding assembly${NC}" + echo -e "${ASM_FILE}: ${RED}Bin files do not match!${NC}" fi rm output.asm output.bin