ASM test file improved error handling/reporting
This commit is contained in:
parent
094733ee70
commit
f4d6835694
@ -9,13 +9,18 @@ make asm_files > /dev/null
|
|||||||
for ASM_BIN in asm_files/*.bin;
|
for ASM_BIN in asm_files/*.bin;
|
||||||
do
|
do
|
||||||
./decode "$ASM_BIN" > output.asm 2> /dev/null
|
./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
|
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
|
diff "${ASM_BIN}" output.bin > /dev/null
|
||||||
if [ $? -eq 0 ]; then
|
if [ $? -eq 0 ]; then
|
||||||
echo -e "${ASM_FILE}: ${GREEN}Decoded properly${NC}"
|
echo -e "${ASM_FILE}: ${GREEN}Decoded properly${NC}"
|
||||||
else
|
else
|
||||||
echo -e "${ASM_FILE}: ${RED}Issue decoding assembly${NC}"
|
echo -e "${ASM_FILE}: ${RED}Bin files do not match!${NC}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
rm output.asm output.bin
|
rm output.asm output.bin
|
||||||
|
Loading…
x
Reference in New Issue
Block a user