mirror of
https://github.com/linux-sunxi/sunxi-tools.git
synced 2024-11-27 03:44:22 +08:00
cd5a0a3303
After all .fex files can be successfully compiled, let's also test the opposite direction by decompiling the resulting .bin. The output then has to pass an automated diff against the source .fex (transformed via some preprocessing with "unify-fex"). Signed-off-by: Bernhard Nortmann <bernhard.nortmann@web.de>
20 lines
420 B
Bash
Executable File
20 lines
420 B
Bash
Executable File
#!/bin/bash
|
|
echo $0 $*
|
|
FEX2BIN=../fex2bin
|
|
BIN2FEX=../bin2fex
|
|
FEX=$1
|
|
BIN=${FEX/%.fex/.bin}
|
|
REVERSE=${FEX/%.fex/.new}
|
|
${FEX2BIN} ${FEX} ${BIN}
|
|
${BIN2FEX} ${BIN} ${REVERSE}
|
|
# preprocess .fex, compare it to the bin2fex output
|
|
if ./unify-fex ${FEX} | diff -uwB - ${REVERSE}; then
|
|
# if successful, clean up the output files
|
|
rm -f ${BIN} ${REVERSE}
|
|
else
|
|
echo '***'
|
|
echo "*** ERROR processing ${FEX}"
|
|
echo '***'
|
|
exit 1
|
|
fi
|