Commit b93ba483 authored by Thomas Haller's avatar Thomas Haller

gitlab-ci: run unit tests under valgrind in gitlab-ci

parent 6c1c59d5
......@@ -12,17 +12,19 @@ stages:
before_script:
- date '+%Y%m%d-%H%M%S'; NM_INSTALL="dnf install -y" ./contrib/fedora/REQUIRED_PACKAGES
- date '+%Y%m%d-%H%M%S'; dnf install -y glibc-langpack-pl ccache clang
- date '+%Y%m%d-%H%M%S'; dnf install -y python3-dnf-plugins-core
- date '+%Y%m%d-%H%M%S'; dnf debuginfo-install -y glib2
- date '+%Y%m%d-%H%M%S'; locale -a
- date '+%Y%m%d-%H%M%S'; contrib/scripts/nm-ci-patch-gtkdoc.sh || true
.fedora_script: &fedora_script
stage: test
script:
- date '+%Y%m%d-%H%M%S'; git clean -fdx ; CI=gitlab BUILD_TYPE=autotools CC=gcc WITH_DOCS=1 contrib/scripts/nm-ci-run.sh
- date '+%Y%m%d-%H%M%S'; git clean -fdx ; CI=gitlab BUILD_TYPE=autotools CC=gcc WITH_DOCS=1 WITH_VALGRIND=1 contrib/scripts/nm-ci-run.sh
- date '+%Y%m%d-%H%M%S'; rm -rf /tmp/nm-docs-html; mv build/INST/share/gtk-doc/html /tmp/nm-docs-html
- date '+%Y%m%d-%H%M%S'; git clean -fdx ; CI=gitlab BUILD_TYPE=meson CC=gcc WITH_DOCS=1 contrib/scripts/nm-ci-run.sh
- date '+%Y%m%d-%H%M%S'; git clean -fdx ; CI=gitlab BUILD_TYPE=autotools CC=clang WITH_DOCS=0 contrib/scripts/nm-ci-run.sh
- date '+%Y%m%d-%H%M%S'; git clean -fdx ; CI=gitlab BUILD_TYPE=meson CC=clang WITH_DOCS=0 contrib/scripts/nm-ci-run.sh
- date '+%Y%m%d-%H%M%S'; git clean -fdx ; CI=gitlab BUILD_TYPE=meson CC=gcc WITH_DOCS=1 WITH_VALGRIND=0 contrib/scripts/nm-ci-run.sh
- date '+%Y%m%d-%H%M%S'; git clean -fdx ; CI=gitlab BUILD_TYPE=autotools CC=clang WITH_DOCS=0 WITH_VALGRIND=0 contrib/scripts/nm-ci-run.sh
- date '+%Y%m%d-%H%M%S'; git clean -fdx ; CI=gitlab BUILD_TYPE=meson CC=clang WITH_DOCS=0 WITH_VALGRIND=1 contrib/scripts/nm-ci-run.sh
- date '+%Y%m%d-%H%M%S'; ./contrib/fedora/rpm/build_clean.sh -g -w crypto_gnutls -w debug -w iwd -w test
- date '+%Y%m%d-%H%M%S'; ./contrib/fedora/rpm/build_clean.sh -g -w crypto_gnutls -w debug -w iwd -w test -w meson
- date '+%Y%m%d-%H%M%S'; mv /tmp/nm-docs-html ./docs-html
......
......@@ -22,6 +22,12 @@ _is_true() {
0|n|no|NO|No|off)
return 1
;;
"")
if [ "$2" == "" ]; then
die "not a boolean argument \"$1\""
fi
return "$2"
;;
*)
die "not a boolean argument \"$1\""
;;
......@@ -138,6 +144,10 @@ run_autotools() {
_autotools_test_print_logs "second-test"
die "test failed"
fi
if _is_true "$WITH_VALGRIND" 1; then
NMTST_USE_VALGRIND=1 make check -j 3
fi
popd
}
......@@ -187,6 +197,10 @@ run_meson() {
ninja -C build
ninja -C build test
if _is_true "$WITH_VALGRIND" 1; then
NMTST_USE_VALGRIND=1 ninja -C build test
fi
}
###############################################################################
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment