chore: make path to tests optional

This commit is contained in:
Carlos Gomes Martinho 2020-04-24 09:55:01 +02:00
parent 716fe0358c
commit f569816788
3 changed files with 25 additions and 16 deletions

View File

@ -12,7 +12,7 @@ jobs:
run: rm -rf build || true && mkdir build && cd build && cmake .. -DLIBMBUS_BUILD_EXAMPLES=ON -DLIBMBUS_BUILD_TESTS=ON -DLIBMBUS_ENABLE_COVERAGE=ON && cmake --build . -j && cd ..
- name: generate test frames
run: ./test/generate-xml.sh test/test-frames build/bin/mbus_parse_hex
run: ./test/generate-xml.sh test/test-frames
- name: install and run gcovr
run: sudo pip install gcovr && gcovr build/.

View File

@ -1,17 +1,17 @@
#!/bin/sh
rm -rf _build
mkdir _build
cd _build
rm -rf build
mkdir build
cd build
cmake .. -DLIBMBUS_BUILD_EXAMPLES=ON -DLIBMBUS_BUILD_TESTS=ON
cmake --build .
# build deb
# rm -rf _build
# mkdir _build
# cd _build
# rm -rf build
# mkdir build
# cd build
# cmake .. -DLIBMBUS_PACKAGE_DEB=ON
# cpack ..
# dpkg -i *.deb

View File

@ -13,27 +13,36 @@
#------------------------------------------------------------------------------
# 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"
exit 3
fi
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
if [ ! -d "$directory" ]; then
echo "$directory not found"
exit 3
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
if [ ! -f "$hexfile" ]; then
continue