fix: unit tests
This commit is contained in:
parent
f31fbea817
commit
9f9c7a5dbf
@ -12,23 +12,25 @@
|
|||||||
#
|
#
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
# Check if mbus_parse_hex exists
|
|
||||||
if [ ! -x ./mbus_parse_hex ]; then
|
|
||||||
echo "mbus_parse_hex not found"
|
|
||||||
exit 3
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Check commandline parameter
|
# Check commandline parameter
|
||||||
if [ $# -ne 1 ]; then
|
if [ $# -ne 2 ]; then
|
||||||
echo "usage: $0 directory"
|
echo "usage: $0 directory"
|
||||||
exit 3
|
exit 3
|
||||||
fi
|
fi
|
||||||
|
|
||||||
directory="$1"
|
directory="$1"
|
||||||
|
|
||||||
# Check directory
|
# Check if mbus_parse_hex exists
|
||||||
|
if [ ! -x $2 ]; then
|
||||||
|
echo "mbus_parse_hex not found"
|
||||||
|
exit 3
|
||||||
|
fi
|
||||||
|
|
||||||
|
mbus_parse_hex="$2"
|
||||||
|
|
||||||
|
# # Check directory
|
||||||
if [ ! -d "$directory" ]; then
|
if [ ! -d "$directory" ]; then
|
||||||
echo "usage: $0 directory"
|
echo "$directory not found"
|
||||||
exit 3
|
exit 3
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -40,7 +42,7 @@ for hexfile in "$directory"/*.hex; do
|
|||||||
filename=`basename $hexfile .hex`
|
filename=`basename $hexfile .hex`
|
||||||
|
|
||||||
# Parse hex file and write XML in file
|
# Parse hex file and write XML in file
|
||||||
./mbus_parse_hex "$hexfile" > "$directory/$filename.xml.new"
|
$mbus_parse_hex "$hexfile" > "$directory/$filename.xml.new"
|
||||||
result=$?
|
result=$?
|
||||||
|
|
||||||
# Check parsing result
|
# Check parsing result
|
||||||
@ -74,4 +76,3 @@ for hexfile in "$directory"/*.hex; do
|
|||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user