-name: Minimal meson build in Ubuntu
+name: Minimal meson build in Ubuntu with Valgrind
on:
pull_request:
with:
python-version: '3.x'
- name: install minimal requirements
- run: |
- sudo apt-get update && \
- sudo apt-get install -y libglib2.0-dev libjson-glib-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libunwind-dev googletest \
- gstreamer1.0-plugins-good
+ run: sudo apt-get update && sudo apt-get install -y libglib2.0-dev libjson-glib-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libunwind-dev googletest
+ - name: install additional packages for features
+ run: sudo apt-get install -y liborc-0.4-dev flex bison libopencv-dev pkg-config python3-dev python3-numpy python3
+ - name: install additional package from PPA for testing
+ run: sudo add-apt-repository -y ppa:nnstreamer/ppa && sudo apt-get update && sudo apt-get install -y ssat libpaho-mqtt-dev
+ - name: install additional package from Ubuntu for testing and valgrind
+ run: sudo apt-get install -y valgrind gstreamer1.0-tools gstreamer1.0-plugins-good gstreamer1.0-plugins-base libgtest-dev libpng-dev libc6-dbg binutils-x86-64-linux-gnu-dbg valgrind-dbg
- run: pip install meson ninja
- run: meson setup build/
env:
with:
name: Meson_Testlog
path: build/meson-logs/testlog.txt
+ - name: SSAT run with Valgrind on decoder-bounding-box
+ run: if [ '${{ matrix.os }}' == 'ubuntu-22.04' ]; then export NNSTREAMER_BUILD_ROOT_PATH=`pwd`/build && export NNSTREAMER_FILTERS=`pwd`/build/ext/nnstreamer/tensor_filter && export NNSTREAMER_DECODERS=`pwd`/build/ext/nnstreamer/tensor_decoder && export NNSTREAMER_CONVERTERS=`pwd`/build/ext/nnstreamer/tensor_converter && export GST_PLUGIN_PATH=`pwd`/build/gst && export NNSTREAMER_CONF=`pwd`/build/nnstreamer-test.ini && pushd tests/nnstreamer_decoder_boundingbox && G_SLICE=always-malloc G_DEBUG=gc-friendly ssat -n -p=1 --enable-valgrind --summary summary.txt -cn _n && popd; fi
+ - name: GTEST run with Valgrind on a case
+ run: if [ '${{ matrix.os }}' == 'ubuntu-22.04' ]; then export NNSTREAMER_BUILD_ROOT_PATH=`pwd`/build && export NNSTREAMER_FILTERS=`pwd`/build/ext/nnstreamer/tensor_filter && export NNSTREAMER_DECODERS=`pwd`/build/ext/nnstreamer/tensor_decoder && export NNSTREAMER_CONVERTERS=`pwd`/build/ext/nnstreamer/tensor_converter && export GST_PLUGIN_PATH=`pwd`/build/gst && export NNSTREAMER_CONF=`pwd`/build/nnstreamer-test.ini && G_SLICE=always-malloc G_DEBUG=gc-friendly ./packaging/run_unittests_binaries.sh --valgrind ./tests/ || echo "There are Valgrind errors. Please fix it. As we have a lot of Valgrind errors from different libraries and possible from nnstreamer itself, we are not halting the build with Valgrind errors until we get them all."; fi
# TODO: add more subplugins to be built
# TODO: add unit testing
input=""
skip_tests=""
this_script="$(basename -- $0)"
+VALGRIND=""
while (( "$#" )); do
case "$1" in
-k|--skip)
echo " Skip the test cases whose names are...(valid only if target is a directory)" >&2
exit 0
;;
+ --valgrind)
+ VALGRIND="valgrind"
+ shift 1
+ ;;
-*|--*)
echo "$1: invalid option" >&2
exit 1
popd
fi
- ${entry} --gtest_output="xml:${entry##*/}.xml"
+ if [[ "$VALGRIND" == "valgrind" ]]; then
+ valgrind -v --tool=memcheck --leak-check=full --num-callers=40 --error-exitcode=-1 ${entry} --gtest_output="xml:${entry##*/}.xml"
+ else
+ ${entry} --gtest_output="xml:${entry##*/}.xml"
+ fi
+
retval=$?
export PYTHONPATH=${_PYTHONPATH}