~aleteoryx/muditaos

ae3118b96af59bedbf6d600d5c1bf58a6462f2a4 — Radoslaw Wicik 4 years ago 5fd602f
[EGD-6875] Fix UT check script

Fix error causing bad tests where passing unnoticed.
3 files changed, 17 insertions(+), 4 deletions(-)

M Jenkinsfile
M enabled_unittests
M tools/run_unittests.sh
M Jenkinsfile => Jenkinsfile +2 -0
@@ 148,7 148,9 @@ export JOBS=${JOBS:-6}
echo "JOBS=${JOBS}"
pushd "${WORKSPACE}"
./tools/run_unittests.sh enabled_unittests
set +e
./tools/check_unittests.sh
set -e
pushd build-linux-Debug
./googletest-gui
popd

M enabled_unittests => enabled_unittests +0 -1
@@ 248,7 248,6 @@ TESTS_LIST["catch2-service-db"]="
    Settings Messages;
    Quotes;
    Factory Settings;
    Factory Settings Init;
"
#---------
TESTS_LIST["catch2-service-db-settings"]="

M tools/run_unittests.sh => tools/run_unittests.sh +15 -3
@@ 1,4 1,4 @@
#!/bin/bash -e
#!/bin/bash
# Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
# For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md



@@ 27,6 27,8 @@ if [[ $# -ne 1 ]]; then
    exit 1
fi

source ${root_dir}/config/common_scripsts_lib

TESTS_FILE=$1

if [[ ! -r ${TESTS_FILE} ]]; then


@@ 50,8 52,18 @@ do
    do
        CUR_TEST=$( trim ${TESTS[$I]}) 
        if [[ -n "${CUR_TEST}" ]]; then
            echo ${TEST_BINARY} \"${CUR_TEST}\"
            ./${TEST_BINARY} "${CUR_TEST}" | tee ${run_logs}
            echo -en "${TEST_BINARY} \"${CUR_TEST}\":"
            ./${TEST_BINARY} "${CUR_TEST}" --use-colour=yes > ${run_logs}
            RESULT=$?

            if [[ ${RESULT} -eq 0 ]]; then
                echo -e "${OK}"
            else
                echo -e "${ERROR}"
                cat ${run_logs}
                exit 1
            fi

            CHK_IF_RUN=`cat ${run_logs} | grep "No tests ran" || true` 
            echo "---$CHK_IF_RUN---"
            if [[ -n "${CHK_IF_RUN}" ]]; then