diff --git a/.github/workflows/ccpp.yml b/.github/workflows/ccpp.yml index f7922e1..b942801 100644 --- a/.github/workflows/ccpp.yml +++ b/.github/workflows/ccpp.yml @@ -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/. diff --git a/build.sh b/build.sh index e815272..04ea869 100755 --- a/build.sh +++ b/build.sh @@ -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 diff --git a/test/generate-xml.sh b/test/generate-xml.sh index 84e52bd..6a3231f 100755 --- a/test/generate-xml.sh +++ b/test/generate-xml.sh @@ -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