chore: make path to tests optional
This commit is contained in:
2
.github/workflows/ccpp.yml
vendored
2
.github/workflows/ccpp.yml
vendored
@ -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 ..
|
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
|
- 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
|
- name: install and run gcovr
|
||||||
run: sudo pip install gcovr && gcovr build/.
|
run: sudo pip install gcovr && gcovr build/.
|
||||||
|
12
build.sh
12
build.sh
@ -1,17 +1,17 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
|
|
||||||
rm -rf _build
|
rm -rf build
|
||||||
mkdir _build
|
mkdir build
|
||||||
cd _build
|
cd build
|
||||||
cmake .. -DLIBMBUS_BUILD_EXAMPLES=ON -DLIBMBUS_BUILD_TESTS=ON
|
cmake .. -DLIBMBUS_BUILD_EXAMPLES=ON -DLIBMBUS_BUILD_TESTS=ON
|
||||||
cmake --build .
|
cmake --build .
|
||||||
|
|
||||||
# build deb
|
# build deb
|
||||||
|
|
||||||
# rm -rf _build
|
# rm -rf build
|
||||||
# mkdir _build
|
# mkdir build
|
||||||
# cd _build
|
# cd build
|
||||||
# cmake .. -DLIBMBUS_PACKAGE_DEB=ON
|
# cmake .. -DLIBMBUS_PACKAGE_DEB=ON
|
||||||
# cpack ..
|
# cpack ..
|
||||||
# dpkg -i *.deb
|
# dpkg -i *.deb
|
||||||
|
@ -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