M enabled_unittests => enabled_unittests +36 -5
@@ 9,6 9,10 @@
# each test is in separate line
# to disable test just rem it by putting # in front of it
#
+# folowing caracters have to be escaped:
+# [],
+# \[ \] \,
+
declare -A TESTS_LIST
TESTS_LIST["catch2-audio-test"]="
@@ 29,7 33,14 @@ TESTS_LIST["catch2-cellular-datatransfer"]="
Quectel AT DataTransfer commands;
"
#---------
-TESTS_LIST["catch2-cellular-mmi"]="
+TESTS_LIST["catch2-cellular-parse-result"]="
+ CSCA parser test;
+ CSCA set data;
+ QECCNUM parser;
+"
+#---------
+TESTS_LIST["catch2-cellular-request-factory"]="
+ Emergency handling;
MMI requests;
"
#---------
@@ 77,7 88,6 @@ TESTS_LIST["catch2-db"]="
Contacts Ringtones Table tests;
Contacts address Table tests;
Contact Groups tests;
- [Groups];
Alarms Table tests;
SMS Templates Table tests;
Calllog Table tests;
@@ 139,7 149,7 @@ TESTS_LIST["catch2-gui-text"]="
Text block - get width;
Text BlockCursor Ctor/Dtor ;
TextDocument <-> BlockCursor fencing tests;
- TextDocument <-> BlockCursor operators: +, ++, -, -- tests;
+ TextDocument <-> BlockCursor operators: +\, ++\, -\, -- tests;
add Char to empty;
add Char;
remove Char in empty;
@@ 186,6 196,20 @@ TESTS_LIST["catch2-service-evtmgr"]="
ScreenLightControlFunctions;
"
#---------
+TESTS_LIST["catch2-StatefulController-tests"]="
+ Given StatefulController when turn on then turned on;
+ Given StatefulController when error during device registration then turned off;
+ Given StatefulController when error during driver init then turned off;
+ Given StatefulController when error during driver run then turned off;
+ Given StatefulController when restart then don't init twice;
+ Given StatefulController when turn off in off state then turned off;
+ Given StatefulController when turn off in on state then turned off;
+ Given StatefulController when shutdown in off state then terminated;
+ Given StatefulController when shutdown in on state then terminated;
+ Given StatefulController when process command successfully then turned on;
+ Given StatefulController when processing command failed then restarted and turned on;
+"
+#---------
TESTS_LIST["catch2-unittest_parse_CSCA"]="
CSCA parser test;
CSCA set data;
@@ 234,6 258,10 @@ TESTS_LIST["catch2-utils-phonenumber"]="
Number matcher - match incoming (loose);
"
#---------
+TESTS_LIST["catch2-utils-time_display"]="
+ Time display parser;
+"
+#---------
TESTS_LIST["catch2-utils-ucs2"]="
UCS2 to UTF8 conversion;
UCS2 from UTF8 emoji 😁;
@@ 276,8 304,11 @@ TESTS_LIST["catch2-utils-utf8"]="
UTF8: removeChar returns propper string;
UTF8: getChar;
UTF8: encode / decode / how it works;
- UTF8 bad case scenario - operator[] returns;
+ UTF8 bad case scenario - operator\[\] returns;
U8char && UTF8: encode;
+ UTF8: insert whole string which doesn't work;
+ UTF8: Convert to ascii if is ascii combination;
+ UTF8: Not ASCII combination;
"
#---------
TESTS_LIST["catch2-vfs"]="
@@ 290,7 321,7 @@ TESTS_LIST["catch2-vfs"]="
TESTS_LIST["catch2-vfs-core-fs"]="
Corefs: Registering and unregistering block device;
Corefs: Basic API test;
- Corefs: Create new file, write, read from it;
+ Corefs: Create new file\, write\, read from it;
Corefs: Register null filesystem;
Corefs: Mount empty strings;
Corefs: Write to not valid file descriptor;
M module-db/tests/ContactGroups_tests.cpp => module-db/tests/ContactGroups_tests.cpp +2 -2
@@ 1,4 1,4 @@
-// Copyright (c) 2017-2020, Mudita Sp. z.o.o. All rights reserved.
+// Copyright (c) 2017-2021, Mudita Sp. z.o.o. All rights reserved.
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
#include <catch2/catch.hpp>
@@ 24,7 24,7 @@ namespace consts
void addSomeContacts(ContactsDB &contactsDb);
-TEST_CASE("Contact Groups tests", "[Groups]")
+TEST_CASE("Contact Groups tests")
{
vfs.Init();
INFO("sqlite Init");
M tools/get_unittests.sh => tools/get_unittests.sh +19 -3
@@ 34,6 34,10 @@ cat <<- EOF
# each test is in separate line
# to disable test just rem it by putting # in front of it
#
+ # folowing caracters have to be escaped:
+ # [],
+ # \[ \] \,
+
declare -A ${TESTS_LIST_VAR}
EOF
@@ 46,12 50,24 @@ for TEST_BINARY in catch2-*
do
echo "${TEST_BINARY}"
echo "${TESTS_LIST_VAR}[\"${TEST_BINARY}\"]=\"" >> ${TESTS_FILE}
-
- readarray -t TESTS_LIST < <(./${TEST_BINARY} -l | grep -e "^ " | xargs -i{} echo {} )
+
+ #sed explaind
+ #:a - lablel 'a' current pattern space to jump to
+ #N - append next line to pattern space (wiht \n)
+ #/\n / - search for this pattern
+ #s/\n // - delete "\n " (can be "replace")
+ #ta - if we changed something, jump to lable 'a'
+ #P - print part until new line
+ #D - delete part until new line
+ TESTS_LIST_STR=$(./${TEST_BINARY} -l | grep -E "^ .*" | cut -f3- -d\ | sed -e ':a;N;/\n /s/\n //;ta;P;D' )
+
+ readarray -t TESTS_LIST < <( echo -e "$TESTS_LIST_STR" | tr "\n" "\0" | xargs -0 -i{} echo {} )
+
I=0
while [[ $I -lt ${#TESTS_LIST[@]} ]]
do
- echo -e " ${TESTS_LIST[$I]};" >> ${TESTS_FILE}
+ #sed cannot search for single ] to search for it we use ][ patter (and also look for closing ])
+ echo -e " ${TESTS_LIST[$I]};" | sed -e 's#[][,]#\\&#g' >> ${TESTS_FILE}
I=$(( $I + 1 ))
done
echo "\"" >> ${TESTS_FILE}
M tools/run_unittests.sh => tools/run_unittests.sh +8 -1
@@ 5,6 5,7 @@
root_dir="$(realpath $(dirname $(realpath $0))/..)"
build_dir="${root_dir}/build-linux-Debug"
+run_logs=${build_dir}/ut_run_logs
function help() {
cat <<- EOF
@@ 50,7 51,13 @@ do
CUR_TEST=$( trim ${TESTS[$I]})
if [[ -n "${CUR_TEST}" ]]; then
echo ${TEST_BINARY} \"${CUR_TEST}\"
- ./${TEST_BINARY} "${CUR_TEST}"
+ ./${TEST_BINARY} "${CUR_TEST}" | tee ${run_logs}
+ CHK_IF_RUN=`cat ${run_logs} | grep "No tests ran" || true`
+ echo "---$CHK_IF_RUN---"
+ if [[ -n "${CHK_IF_RUN}" ]]; then
+ echo "no such test: ${TEST_BINARY} ${CUR_TEST}"
+ exit 1
+ fi
fi
I=$(( $I + 1 ))
done