From b543f37a11fb9e1e29bd972542df0a23e0f65508 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20M=C3=A4kel=C3=A4?= Date: Wed, 27 Dec 2017 17:02:57 +0200 Subject: [PATCH] Run unit tests for each build The unit tests must pass for the build to successfully continue. --- BUILD/build_deb_local.sh | 6 ++++++ BUILD/build_rpm_local.sh | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/BUILD/build_deb_local.sh b/BUILD/build_deb_local.sh index 2a3cc8352..13b8bab1d 100755 --- a/BUILD/build_deb_local.sh +++ b/BUILD/build_deb_local.sh @@ -14,6 +14,12 @@ cmake .. $cmake_flags export LD_LIBRARY_PATH=$PWD/log_manager:$PWD/query_classifier make +if [[ "$cmake_flags" =~ "BUILD_TESTS" ]] +then + # All tests must pass otherwise the build is considered a failure + make test || exit 1 +fi + export LD_LIBRARY_PATH=$(for i in `find $PWD/ -name '*.so*'`; do echo $(dirname $i); done|sort|uniq|xargs|sed -e 's/[[:space:]]/:/g') make package res=$? diff --git a/BUILD/build_rpm_local.sh b/BUILD/build_rpm_local.sh index ae78b6698..ab28f06e0 100755 --- a/BUILD/build_rpm_local.sh +++ b/BUILD/build_rpm_local.sh @@ -12,6 +12,12 @@ cd _build cmake .. $cmake_flags make +if [[ "$cmake_flags" =~ "BUILD_TESTS" ]] +then + # All tests must pass otherwise the build is considered a failure + make test || exit 1 +fi + if [ $remove_strip == "yes" ] ; then sudo rm -rf /usr/bin/strip sudo touch /usr/bin/strip