Skip to content

Commit

Permalink
chore: make path to tests optional
Browse files Browse the repository at this point in the history
  • Loading branch information
gocarlos committed Apr 24, 2020
1 parent 716fe03 commit f569816
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ccpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/.
Expand Down
12 changes: 6 additions & 6 deletions build.sh
Original file line number Diff line number Diff line change
@@ -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
Expand Down
25 changes: 17 additions & 8 deletions test/generate-xml.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,33 @@
#------------------------------------------------------------------------------

# 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"
# # Check directory
if [ ! -d "$directory" ]; then
echo "$directory not found"
exit 3
fi

mbus_parse_hex="$2"
# Default location is this one
mbus_parse_hex="build/bin/mbus_parse_hex"

# # Check directory
if [ ! -d "$directory" ]; then
echo "$directory not found"
# 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

Expand Down

0 comments on commit f569816

Please sign in to comment.