chore: make path to tests optional
This commit is contained in:

committed by
Stefan Wahren

parent
2a66e6a53b
commit
94528ad6f2
@ -13,27 +13,36 @@
|
|||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
# Check commandline parameter
|
# Check commandline parameter
|
||||||
if [ $# -ne 2 ]; then
|
if [ $# -ne 1 ]; then
|
||||||
|
echo "usage: $0 path_to_directory_with_xml_files"
|
||||||
|
echo "or"
|
||||||
echo "usage: $0 path_to_directory_with_xml_files path_to_mbus_parse_hex_with_filename"
|
echo "usage: $0 path_to_directory_with_xml_files path_to_mbus_parse_hex_with_filename"
|
||||||
exit 3
|
exit 3
|
||||||
fi
|
fi
|
||||||
|
|
||||||
directory="$1"
|
directory="$1"
|
||||||
|
|
||||||
# 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
|
# # Check directory
|
||||||
if [ ! -d "$directory" ]; then
|
if [ ! -d "$directory" ]; then
|
||||||
echo "$directory not found"
|
echo "$directory not found"
|
||||||
exit 3
|
exit 3
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Default location is this one
|
||||||
|
mbus_parse_hex="build/bin/mbus_parse_hex"
|
||||||
|
|
||||||
|
# though can be overriten
|
||||||
|
if [ $# -eq 2 ]; then
|
||||||
|
mbus_parse_hex="$2"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Check if mbus_parse_hex exists
|
||||||
|
if [ ! -x $mbus_parse_hex ]; then
|
||||||
|
echo "mbus_parse_hex not found"
|
||||||
|
echo "path to mbus_parse_hex: $mbus_parse_hex"
|
||||||
|
exit 3
|
||||||
|
fi
|
||||||
|
|
||||||
for hexfile in "$directory"/*.hex; do
|
for hexfile in "$directory"/*.hex; do
|
||||||
if [ ! -f "$hexfile" ]; then
|
if [ ! -f "$hexfile" ]; then
|
||||||
continue
|
continue
|
||||||
|
Reference in New Issue
Block a user