[Unit Tests]:Added unit tests for oicgroup.c
[platform/upstream/iotivity.git] / tools / generate_report.sh
1 #!/bin/bash
2
3 set -e
4 #Colors
5 RED="\033[0;31m"
6 GREEN="\033[0;32m"
7 BLUE="\033[0;34m"
8 NO_COLOUR="\033[0m"
9
10 #Defaults
11 time_stamp=$(date -u +%Y-%b-%d)
12 module_name="CA"
13 report_format="html"
14 report_flags="--html --html-details";
15
16 #IOTIVITY Flags
17 IOTIVITY_BASE="${PWD}"
18 IOTIVITY_TARGET_OS="linux"
19 IOTIVITY_TARGET_ARCH="$(uname -m)"
20 USE_TIMESTAMP="yes"
21 UNITTEST_XML_REPORT="yes"
22
23 case $IOTIVITY_TARGET_ARCH in
24 i*86)
25 IOTIVITY_TARGET_ARCH=x86
26 ;;
27 esac
28
29
30 usage() {
31     echo "Usage: tools/generate_report.sh <options>"
32     echo "Options:"
33     echo "      -h / --help                                     :  Display help and exit"
34     echo "      -c                                              :  Clean IoTivity Repository; Should be used to clean existing repository"
35     echo "      -f [html|gcov|xml] (default: html)              :  Report Format."
36     echo "      --format=[html|gcov|xml] (default: html)        :  Report Format."
37     echo "      --module=[CA|ES|RE|SM|NS|CHP|ALL] (default: CA) :  Module for which report needs to be generated."
38     echo "      --timestamp=[yes|no] (default: yes)             :  Remove Time Stamp from the report output. If directory exits, overwrites the report to the same directory"
39     echo "      --ut_report=[yes|no] (default: yes)             :  The unit test report will be generated in xml format (as gtest only supports xml)."
40     echo "      --target_arch=[x86|x86_64] (default: x86)       :  Choose Target Architecture for running test executables."
41     echo "Example:"
42     echo "  $ cd path/to/iotivity "
43     echo "  $ scons TARGET_TRANSPORT=IP LOGGING=0 RELEASE=0 SECURED=0 WITH_TCP=0 TARGET_ARCH=x86 WITH_PROXY=1 TEST=0 "
44     echo "  $ tools/generate_report.sh --format=html --module=ALL --timestamp=yes --ut_report=yes"
45 }
46
47 clean_iotivity() {
48     echo -e "Cleaning ${BLUE}${IOTIVITY_BASE}${NO_COLOUR}"
49     echo -e "Deleting  ${RED}${IOTIVITY_BASE}/out/${IOTIVITY_TARGET_OS}/${IOTIVITY_TARGET_ARCH}/debug${NO_COLOUR}"
50     echo -e "Deleting  ${RED}${IOTIVITY_BASE}/.sconf_temp${NO_COLOUR}"
51     echo -e "Deleting  ${RED}${IOTIVITY_BASE}/.sconsign.dblite${NO_COLOUR}"
52     rm -r "${IOTIVITY_BASE}/out/${IOTIVITY_TARGET_OS}/${IOTIVITY_TARGET_ARCH}/debug" "${IOTIVITY_BASE}/.sconf_temp" "${IOTIVITY_BASE}/.sconsign.dblite"
53     find "${IOTIVITY_BASE}" -name "*.memcheck" -delete -o -name "*.gcno" -delete -o -name "*.gcda" -delete -o -name "*.os" -delete -o -name "*.o" -delete
54     echo -e "Finished Cleaning ${BLUE}${IOTIVITY_BASE}${NO_COLOUR}"
55 }
56
57 process_cmd_args() {
58     while [ "$#" -gt 0  ]; do
59         case "$1" in
60             -c)
61                 clean_iotivity
62                 shift 1; exit 0
63                 ;;
64
65             -f)
66                 report_format="$2";
67                 if [ "gcov" != ${report_format} -a "html" != ${report_format} -a "xml" != ${report_format} ]; then
68                     usage; exit 1;
69                 fi
70                 case "$report_format" in
71                     "html")
72                         report_flags="--html --html-details";
73                         ;;
74                     "gcov")
75                         report_flags="";
76                         ;;
77                     "xml")
78                         report_flags="--xml";
79                         ;;
80                 esac
81                 shift 2
82                 ;;
83
84             --format=*)
85                 report_format="${1#*=}";
86                 if [ "gcov" != ${report_format} -a "html" != ${report_format} -a "xml" != ${report_format} ]; then
87                     usage; exit 1;
88                 fi
89                 case "$report_format" in
90                     "html")
91                         report_flags="--html --html-details";
92                         ;;
93                     "gcov")
94                         report_flags="";
95                         ;;
96                     "xml")
97                         report_flags="--xml --xml-pretty";
98                         ;;
99                 esac
100                 shift 1
101                 ;;
102
103             --format)
104                 echo "$1 requires an argument [gcov|html|xml]" >&2;
105                 usage;
106                 exit 1
107                 ;;
108
109             --module=*)
110                 module_name="${1#*=}";
111                 if [ "CA" != ${module_name} -a "ES" != ${module_name} -a "RE" != ${module_name} -a "SM" != ${module_name} -a "NS" != ${module_name} -a "CHP" != ${module_name} -a "ALL" != ${module_name} ]; then
112                     usage; exit 1;
113                 fi
114                 shift 1
115                 ;;
116
117             --timestamp=*)
118                 USE_TIMESTAMP="${1#*=}";
119                 if [ "yes" != ${USE_TIMESTAMP} -a "no" != ${USE_TIMESTAMP} ]; then
120                     usage; exit 1;
121                 fi
122                 shift 1
123                 ;;
124             --timestamp)
125                 echo "$1 requires an argument [yes|no]" >&2;
126                 usage;
127                 exit 1
128                 ;;
129
130             --ut_report=*)
131                 UNITTEST_XML_REPORT="${1#*=}";
132                 if [ "yes" != ${UNITTEST_XML_REPORT} -a "no" != ${UNITTEST_XML_REPORT} ]; then
133                     usage; exit 1;
134                 fi
135                 shift 1
136                 ;;
137             --ut_report)
138                 echo "$1 requires an argument [yes|no]" >&2;
139                 usage;
140                 exit 1
141                 ;;
142
143             --target_arch=*)
144                 IOTIVITY_TARGET_ARCH="${1#*=}";
145                 if [ "x86" != ${IOTIVITY_TARGET_ARCH} -a "x86_64" != ${IOTIVITY_TARGET_ARCH} ]; then
146                     usage; exit 1;
147                 fi
148                 shift 1
149                 ;;
150             --target_arch)
151                 echo "$1 requires an argument" >&2;
152                 usage;
153                 exit 1
154                 ;;
155
156             -h)
157                 usage;
158                 shift 1; exit 0
159                 ;;
160             --help)
161                 usage;
162                 shift 1; exit 0
163                 ;;
164
165             -*)
166                 echo "unknown option: $1" >&2;
167                 usage;
168                 exit 1
169                 ;;
170         esac
171     done
172 }
173
174 generate_report_CA()
175 {
176     # Setting Parameters
177     if [ "yes" = ${USE_TIMESTAMP} ]; then
178         report_dir="${module_name}_${time_stamp}"
179     else
180         report_dir="${module_name}"
181     fi
182
183     report_file="report.${report_format}"
184
185     test_report_dir="TestReport/${report_format}/${report_dir}"
186     test_report_file="${test_report_dir}/${report_file}"
187
188     rm -rf "${test_report_dir}"
189     mkdir -p "${test_report_dir}"
190
191     LD_LIBRARY_PATH="${IOTIVITY_BASE}/out/${IOTIVITY_TARGET_OS}/${IOTIVITY_TARGET_ARCH}/debug"
192
193     #Setting Proper Location for UnitTest XML report generation
194     unittest_report_dir="UnitTestReport/${report_dir}"
195     if [ "yes" = ${UNITTEST_XML_REPORT} ]; then
196         rm -rf "${unittest_report_dir}"
197         mkdir -p "${unittest_report_dir}"
198         UNITTEST_XML_REPORT_FLAG_PREFIX="--gtest_output=xml:${unittest_report_dir}"
199     fi
200
201     tests_list=(
202                 "${IOTIVITY_BASE}/out/${IOTIVITY_TARGET_OS}/${IOTIVITY_TARGET_ARCH}/debug/resource/csdk/connectivity/test/catests"
203                 "${IOTIVITY_BASE}/out/${IOTIVITY_TARGET_OS}/${IOTIVITY_TARGET_ARCH}/debug/resource/csdk/stack/test/cbortests"
204                 "${IOTIVITY_BASE}/out/${IOTIVITY_TARGET_OS}/${IOTIVITY_TARGET_ARCH}/debug/resource/csdk/stack/test/keepalivetests"
205                 "${IOTIVITY_BASE}/out/${IOTIVITY_TARGET_OS}/${IOTIVITY_TARGET_ARCH}/debug/resource/csdk/stack/test/oicgrouptests"
206                 "${IOTIVITY_BASE}/out/${IOTIVITY_TARGET_OS}/${IOTIVITY_TARGET_ARCH}/debug/resource/unittests/unittests"
207                 "${IOTIVITY_BASE}/out/${IOTIVITY_TARGET_OS}/${IOTIVITY_TARGET_ARCH}/debug/resource/c_common/ocrandom/test/randomtests"
208                 "${IOTIVITY_BASE}/out/${IOTIVITY_TARGET_OS}/${IOTIVITY_TARGET_ARCH}/debug/resource/c_common/oic_malloc/test/malloctests"
209                 "${IOTIVITY_BASE}/out/${IOTIVITY_TARGET_OS}/${IOTIVITY_TARGET_ARCH}/debug/resource/c_common/oic_string/test/stringtests"
210                 "${IOTIVITY_BASE}/out/${IOTIVITY_TARGET_OS}/${IOTIVITY_TARGET_ARCH}/debug/resource/c_common/oic_time/test/timetests"
211                 "${IOTIVITY_BASE}/out/${IOTIVITY_TARGET_OS}/${IOTIVITY_TARGET_ARCH}/debug/resource/csdk/stack/test/stacktests"
212                 "${IOTIVITY_BASE}/out/${IOTIVITY_TARGET_OS}/${IOTIVITY_TARGET_ARCH}/debug/resource/c_common/ocevent/test/eventtests"
213                );
214
215     for exe in ${tests_list[@]}; do
216         filename=$(basename -- "${exe}")
217         if [ -n "${UNITTEST_XML_REPORT_FLAG_PREFIX}" ]; then
218             UNITTEST_XML_REPORT_FLAG="${UNITTEST_XML_REPORT_FLAG_PREFIX}/${filename}.xml"
219         fi
220         eval "${exe} ${UNITTEST_XML_REPORT_FLAG}"
221     done
222
223     unset tests_list
224
225     sleep 1
226
227     echo -e "Generating ${GREEN}${module_name}${NO_COLOUR} Reports"
228
229     # Printing Unit Test Report Location
230     if [  "yes" = ${UNITTEST_XML_REPORT} ]; then
231         echo -e "${GREEN}${module_name}${NO_COLOUR} UnitTest Report Location: ${BLUE}${unittest_report_dir}${NO_COLOUR}"
232     fi
233
234     gcovr -r . \
235         -e ".sconf_temp*" \
236         -e "examples.OICMiddle" \
237         -e "extlibs.*" \
238         -e "extlibs.hippomocks-master.*" \
239         -e "extlibs.rapidxml.*" \
240         -e "out.linux.*" \
241         -e "plugins.*" \
242         -e "cloud.*" \
243         -e "resource.csdk.connectivity.lib.*" \
244         -e "resource.csdk.connectivity.samples.linux.*" \
245         -e "resource.csdk.connectivity.scr.bt_edr_adapter.*" \
246         -e "resource.csdk.connectivity.src.bt_le_adapter.*" \
247         -e "resource.csdk.connectivity.test.*" \
248         -e "resource.csdk.logger.*" \
249         -e "resource.csdk.stack.samples.*" \
250         -e "resource.csdk.stack.test.*" \
251         -e "resource.examples.*" \
252         -e "resource.unittests.*" \
253         -e "resource.oc_logger.*" \
254         -e "resource.provisioning.*" \
255         -e "resource.csdk.connectivity.common.src.logger.c.*" \
256         -e "resource.csdk.connectivity.common.src.oic_console_logger.c.*" \
257         -e "resource.csdk.connectivity.common.src.oic_logger.c.*" \
258         -e "resource.c_common.oic_string.test.*" \
259         -e "resource.c_common.ocevent.test.*" \
260         -e "resource.c_common.ocrandom.test.*" \
261         -e "resource.c_common.oic_malloc.test.*" \
262         -e "resource.c_common.oic_time.test.*" \
263         -e "resource.csdk.connectivity.src.adapter_util.pkix.*" \
264         -e "resource.csdk.connectivity.src.adapter_util.caadapternetdtls.c" \
265         -e "service.*" \
266         -e "resource.csdk.security.*" \
267         -e "resource.csdk.resource-directory.*" \
268         -e "resource.csdk.routing.*" \
269         ${report_flags} -o ${test_report_file}
270
271     if [  $? -eq 0 ]; then
272         echo -e "${GREEN}${module_name}${NO_COLOUR} Coverage Report Location: ${BLUE}${test_report_file}${NO_COLOUR}"
273         echo -e "${GREEN}${module_name}${NO_COLOUR} Report Generated ${GREEN}Successfully!${NO_COLOUR}"
274     else
275         echo -e "${RED}${module_name}${NO_COLOUR} Report Generation ${RED}Failed!${NO_COLOUR}"
276     fi
277 }
278
279 generate_report_ES()
280 {
281     # Setting Parameters
282     if [ "yes" = ${USE_TIMESTAMP} ]; then
283         report_dir="${module_name}_${time_stamp}"
284     else
285         report_dir="${module_name}"
286     fi
287     report_file="report.${report_format}"
288
289     test_report_dir="TestReport/${report_format}/${report_dir}"
290     test_report_file="${test_report_dir}/${report_file}"
291
292     rm -rf "${test_report_dir}"
293     mkdir -p "${test_report_dir}"
294
295     LD_LIBRARY_PATH="${IOTIVITY_BASE}/out/${IOTIVITY_TARGET_OS}/${IOTIVITY_TARGET_ARCH}/debug"
296
297     #Setting Proper Location for UnitTest XML report generation
298     unittest_report_dir="UnitTestReport/${report_dir}"
299     if [ "yes" = ${UNITTEST_XML_REPORT} ]; then
300         rm -rf "${unittest_report_dir}"
301         mkdir -p "${unittest_report_dir}"
302         UNITTEST_XML_REPORT_FLAG_PREFIX="--gtest_output=xml:${unittest_report_dir}"
303     fi
304
305     tests_list=(
306                 "${IOTIVITY_BASE}/out/${IOTIVITY_TARGET_OS}/${IOTIVITY_TARGET_ARCH}/debug/service/easy-setup/enrollee/unittests/easysetup_enrollee_test"
307                 "${IOTIVITY_BASE}/out/${IOTIVITY_TARGET_OS}/${IOTIVITY_TARGET_ARCH}/debug/service/easy-setup/mediator/richsdk/unittests/easysetup_mediator_test"
308                );
309
310     for exe in ${tests_list[@]}; do
311         filename=$(basename -- "${exe}")
312         if [ -n "${UNITTEST_XML_REPORT_FLAG_PREFIX}" ]; then
313             UNITTEST_XML_REPORT_FLAG="${UNITTEST_XML_REPORT_FLAG_PREFIX}/${filename}.xml"
314         fi
315         eval "${exe} ${UNITTEST_XML_REPORT_FLAG}"
316     done
317
318     unset tests_list
319
320     sleep 1
321
322     echo -e "Generating ${GREEN}${module_name}${NO_COLOUR} Reports"
323
324     # Printing Unit Test Report Location
325     if [  "yes" = ${UNITTEST_XML_REPORT} ]; then
326         echo -e "${GREEN}${module_name}${NO_COLOUR} UnitTest Report Location: ${BLUE}${unittest_report_dir}${NO_COLOUR}"
327     fi
328
329     gcovr -r . \
330         -e ".sconf_temp*" \
331         -e "examples.OICMiddle" \
332         -e "extlibs.*" \
333         -e "extlibs.hippomocks-master.*" \
334         -e "extlibs.rapidxml.*" \
335         -e "out.linux.*" \
336         -e "plugins.*" \
337         -e "cloud.*" \
338         -e "resource.csdk.connectivity.lib.*" \
339         -e "resource.csdk.connectivity.samples.linux.*" \
340         -e "resource.csdk.security.provisioning.ck_manager.sample.*" \
341         -e "resource.csdk.security.provisioning.ck_manager.unittest.*" \
342         -e "resource.csdk.connectivity.scr.bt_edr_adapter.*" \
343         -e "resource.csdk.connectivity.src.bt_le_adapter.*" \
344         -e "resource.csdk.connectivity.src.bt_edr_adapter.*" \
345         -e "resource.csdk.connectivity.test.*" \
346         -e "resource.csdk.logger.*" \
347         -e "resource.src.*" \
348         -e "resource.csdk.security.provisioning.include.*" \
349         -e "resource.csdk.security.provisioning.sample.*" \
350         -e "resource.csdk.security.provisioning.src.cloud.*" \
351         -e "resource.csdk.security.provisioning.unittest.*" \
352         -e "resource.csdk.security.unittest.*" \
353         -e "resource.csdk.stack.*" \
354         -e "resource.examples.*" \
355         -e "resource.unittests.*" \
356         -e "resource.include.*" \
357         -e "resource.oc_logger.*" \
358         -e "resource.provisioning.examples.*" \
359         -e "resource.provisioning.unittests.*" \
360         -e "resource.csdk.connectivity.common.src.logger.c.*" \
361         -e "resource.csdk.connectivity.common.src.oic_console_logger.c.*" \
362         -e "resource.csdk.connectivity.common.src.oic_logger.c.*" \
363         -e "service.resource-encapsulation.include.*" \
364         -e "service.resource-encapsulation.src.common.expiryTimer.*" \
365         -e "service.resource-encapsulation.src.common.primitiveResource.unittests.*" \
366         -e "service.resource-encapsulation.src.resourceBroker.unittest.*" \
367         -e "service.resource-encapsulation.src.resourceCache.unittest.*" \
368         -e "service.resource-encapsulation.src.serverBuilder.unittest.*" \
369         -e "service.resource-encapsulation.unittest.*" \
370         -e "service.resource-hosting.src.unittest.*" \
371         -e "service.resource-hosting.SampleApp.*" \
372         -e "service.things-manager.*" \
373         -e "service.notification.unittest.*" \
374         -e "service.easy-setup.unittest.*" \
375         -e "service.easy-setup.sample.*" \
376         -e "service.easy-setup.mediator.csdk.unittests.*" \
377         -e "service.easy-setup.mediator.richsdk.unittests.*" \
378         -e "service.easy-setup.enrollee.unittest.*" \
379         -e "service.easy-setup.mediator.richsdk.src.EnrolleeSecurity.cpp" \
380         -e "service.resource-container.examples.*" \
381         -e "service.resource-container.unittests." \
382         -e "service.resource-container.bundle-api." \
383         -e "service.resource-encapsulation.examples.*" \
384         -e "service.resource-encapsulation.src.common.primitiveResource.unittests." \
385         -e "service.resource-encapsulation.src.resourceBroker.unittest." \
386         -e "service.resource-encapsulation.src.resourceCache.unittest." \
387         -e "service.resource-encapsulation.src.serverBuilder.unittest." \
388         -e "service.resource-encapsulation.unittest." \
389         -e "service.resource-encapsulation.src.common.utils.*" \
390         -e "service.things-manager.sampleapp.*" \
391         -e "service.resource-hosting.unittest" \
392         -e "resource.c_common.oic_string.test.*" \
393         -e "service.notification.unittests.*" \
394         -e "service.notification.cpp-wrapper.unittest.*" \
395         -e "resource.c_common.*" \
396         -e "service.resource-directory.samples.*" \
397         -e "resource.csdk.security.src.*" \
398         -e "resource.csdk.connectivity.src.adapter_util.pkix.*" \
399         -e "resource.csdk.connectivity.src.adapter_util.caadapternetdtls.c" \
400         -e "service.scene-manager.sampleapp.*" \
401         -e "service.scene-manager.unittests.*" \
402         -e "service.coap-http-proxy.unittests.*" \
403         -e "resource.*" \
404         -e "service.notification.*" \
405         -e "service.resource-encapsulation.*" \
406         -e "service.scene-manager.*" \
407         -e "service.coap-http-proxy.*" \
408         ${report_flags} -o ${test_report_file}
409
410     if [  $? -eq 0 ]; then
411         echo -e "${GREEN}${module_name}${NO_COLOUR} Coverage Report Location: ${BLUE}${test_report_file}${NO_COLOUR}"
412         echo -e "${GREEN}${module_name}${NO_COLOUR} Report Generated ${GREEN}Successfully!${NO_COLOUR}"
413     else
414         echo -e "${RED}${module_name}${NO_COLOUR} Report Generation ${RED}Failed!${NO_COLOUR}"
415     fi
416 }
417
418 generate_report_RE()
419 {
420     # Setting Parameters
421     if [ "yes" = ${USE_TIMESTAMP} ]; then
422         report_dir="${module_name}_${time_stamp}"
423     else
424         report_dir="${module_name}"
425     fi
426     report_file="report.${report_format}"
427     test_report_dir="TestReport/${report_format}/${report_dir}"
428     test_report_file="${test_report_dir}/${report_file}"
429
430     rm -rf "${test_report_dir}"
431     mkdir -p "${test_report_dir}"
432
433     LD_LIBRARY_PATH="${IOTIVITY_BASE}/out/${IOTIVITY_TARGET_OS}/${IOTIVITY_TARGET_ARCH}/debug"
434
435     #Setting Proper Location for UnitTest XML report generation
436     unittest_report_dir="UnitTestReport/${report_dir}"
437     if [ "yes" = ${UNITTEST_XML_REPORT} ]; then
438         rm -rf "${unittest_report_dir}"
439         mkdir -p "${unittest_report_dir}"
440         UNITTEST_XML_REPORT_FLAG_PREFIX="--gtest_output=xml:${unittest_report_dir}"
441     fi
442
443     tests_list=(
444                 "${IOTIVITY_BASE}/out/${IOTIVITY_TARGET_OS}/${IOTIVITY_TARGET_ARCH}/debug/service/resource-encapsulation/src/serverBuilder/rcs_server_test"
445                 "${IOTIVITY_BASE}/out/${IOTIVITY_TARGET_OS}/${IOTIVITY_TARGET_ARCH}/debug/service/resource-encapsulation/src/common/rcs_common_test"
446                 "${IOTIVITY_BASE}/out/${IOTIVITY_TARGET_OS}/${IOTIVITY_TARGET_ARCH}/debug/service/resource-encapsulation/unittests/rcs_client_test"
447                 "${IOTIVITY_BASE}/out/${IOTIVITY_TARGET_OS}/${IOTIVITY_TARGET_ARCH}/debug/service/resource-encapsulation/src/resourceCache/unittests/cache_test"
448                 "${IOTIVITY_BASE}/out/${IOTIVITY_TARGET_OS}/${IOTIVITY_TARGET_ARCH}/debug/service/resource-encapsulation/src/resourceBroker/unittest/broker_test"
449                );
450
451     for exe in ${tests_list[@]}; do
452         filename=$(basename -- "${exe}")
453         if [ -n "${UNITTEST_XML_REPORT_FLAG_PREFIX}" ]; then
454             UNITTEST_XML_REPORT_FLAG="${UNITTEST_XML_REPORT_FLAG_PREFIX}/${filename}.xml"
455         fi
456         eval "${exe} ${UNITTEST_XML_REPORT_FLAG}"
457     done
458
459     unset tests_list
460
461     sleep 1
462
463     echo -e "Generating ${GREEN}${module_name}${NO_COLOUR} Reports"
464
465     # Printing Unit Test Report Location
466     if [  "yes" = ${UNITTEST_XML_REPORT} ]; then
467         echo -e "${GREEN}${module_name}${NO_COLOUR} UnitTest Report Location: ${BLUE}${unittest_report_dir}${NO_COLOUR}"
468     fi
469
470     gcovr -r . \
471         -e ".sconf_temp*" \
472         -e "examples.OICMiddle" \
473         -e "extlibs.*" \
474         -e "extlibs.hippomocks-master.*" \
475         -e "extlibs.rapidxml.*" \
476         -e "out.linux.*" \
477         -e "plugins.*" \
478         -e "cloud.*" \
479         -e "resource.csdk.connectivity.lib.*" \
480         -e "resource.csdk.connectivity.samples.linux.*" \
481         -e "resource.csdk.security.provisioning.ck_manager.sample.*" \
482         -e "resource.csdk.security.provisioning.ck_manager.unittest.*" \
483         -e "resource.csdk.connectivity.scr.bt_edr_adapter.*" \
484         -e "resource.csdk.connectivity.src.bt_le_adapter.*" \
485         -e "resource.csdk.connectivity.src.bt_edr_adapter.*" \
486         -e "resource.csdk.connectivity.test.*" \
487         -e "resource.csdk.logger.*" \
488         -e "resource.src.*" \
489         -e "resource.csdk.security.provisioning.include.*" \
490         -e "resource.csdk.security.provisioning.sample.*" \
491         -e "resource.csdk.security.provisioning.src.cloud.*" \
492         -e "resource.csdk.security.provisioning.unittest.*" \
493         -e "resource.csdk.security.unittest.*" \
494         -e "resource.csdk.stack.*" \
495         -e "resource.examples.*" \
496         -e "resource.unittests.*" \
497         -e "resource.include.*" \
498         -e "resource.oc_logger.*" \
499         -e "resource.provisioning.examples.*" \
500         -e "resource.provisioning.unittests.*" \
501         -e "resource.csdk.connectivity.common.src.logger.c.*" \
502         -e "resource.csdk.connectivity.common.src.oic_console_logger.c.*" \
503         -e "resource.csdk.connectivity.common.src.oic_logger.c.*" \
504         -e "service.resource-encapsulation.include.*" \
505         -e "service.resource-encapsulation.src.common.expiryTimer.*" \
506         -e "service.resource-encapsulation.src.common.primitiveResource.unittests.*" \
507         -e "service.resource-encapsulation.src.resourceBroker.unittest.*" \
508         -e "service.resource-encapsulation.src.resourceCache.unittest.*" \
509         -e "service.resource-encapsulation.src.serverBuilder.unittest.*" \
510         -e "service.resource-encapsulation.unittest.*" \
511         -e "service.resource-hosting.src.unittest.*" \
512         -e "service.resource-hosting.SampleApp.*" \
513         -e "service.things-manager.*" \
514         -e "service.notification.unittest.*" \
515         -e "service.easy-setup.unittest.*" \
516         -e "service.easy-setup.sample.*" \
517         -e "service.easy-setup.mediator.csdk.unittests.*" \
518         -e "service.easy-setup.mediator.richsdk.unittests.*" \
519         -e "service.easy-setup.enrollee.unittest.*" \
520         -e "service.resource-container.examples.*" \
521         -e "service.resource-container.unittests." \
522         -e "service.resource-container.bundle-api." \
523         -e "service.resource-encapsulation.examples.*" \
524         -e "service.resource-encapsulation.src.common.primitiveResource.unittests." \
525         -e "service.resource-encapsulation.src.resourceBroker.unittest." \
526         -e "service.resource-encapsulation.src.resourceCache.unittest." \
527         -e "service.resource-encapsulation.src.serverBuilder.unittest." \
528         -e "service.resource-encapsulation.unittest." \
529         -e "service.resource-encapsulation.src.common.utils.*" \
530         -e "service.things-manager.sampleapp.*" \
531         -e "service.resource-hosting.unittest" \
532         -e "resource.c_common.oic_string.test.*" \
533         -e "service.notification.unittests.*" \
534         -e "service.notification.cpp-wrapper.unittest.*" \
535         -e "resource.c_common.*" \
536         -e "service.resource-directory.samples.*" \
537         -e "resource.csdk.security.src.*" \
538         -e "resource.csdk.connectivity.src.adapter_util.pkix.*" \
539         -e "resource.csdk.connectivity.src.adapter_util.caadapternetdtls.c" \
540         -e "service.scene-manager.sampleapp.*" \
541         -e "service.scene-manager.unittests.*" \
542         -e "service.coap-http-proxy.unittests.*" \
543         -e "resource.*" \
544         -e "service.easy-setup.*" \
545         -e "service.notification.*" \
546         -e "service.scene-manager.*" \
547         -e "service.coap-http-proxy.*" \
548         ${report_flags} -o ${test_report_file}
549
550     if [  $? -eq 0 ]; then
551         echo -e "${GREEN}${module_name}${NO_COLOUR} Coverage Report Location: ${BLUE}${test_report_file}${NO_COLOUR}"
552         echo -e "${GREEN}${module_name}${NO_COLOUR} Report Generated ${GREEN}Successfully!${NO_COLOUR}"
553     else
554         echo -e "${RED}${module_name}${NO_COLOUR} Report Generation ${RED}Failed!${NO_COLOUR}"
555     fi
556 }
557
558 generate_report_SM()
559 {
560     # Setting Parameters
561     if [ "yes" = ${USE_TIMESTAMP} ]; then
562         report_dir="${module_name}_${time_stamp}"
563     else
564         report_dir="${module_name}"
565     fi
566     report_file="report.${report_format}"
567     test_report_dir="TestReport/${report_format}/${report_dir}"
568     test_report_file="${test_report_dir}/${report_file}"
569
570     rm -rf "${test_report_dir}"
571     mkdir -p "${test_report_dir}"
572
573     LD_LIBRARY_PATH="${IOTIVITY_BASE}/out/${IOTIVITY_TARGET_OS}/${IOTIVITY_TARGET_ARCH}/debug"
574
575     #Setting Proper Location for UnitTest XML report generation
576     unittest_report_dir="UnitTestReport/${report_dir}"
577     if [ "yes" = ${UNITTEST_XML_REPORT} ]; then
578         rm -rf "${unittest_report_dir}"
579         mkdir -p "${unittest_report_dir}"
580         UNITTEST_XML_REPORT_FLAG_PREFIX="--gtest_output=xml:${unittest_report_dir}"
581     fi
582
583     tests_list=(
584                 "${IOTIVITY_BASE}/out/${IOTIVITY_TARGET_OS}/${IOTIVITY_TARGET_ARCH}/debug/service/scene-manager/unittests/remote_scene_action_test"
585                 "${IOTIVITY_BASE}/out/${IOTIVITY_TARGET_OS}/${IOTIVITY_TARGET_ARCH}/debug/service/scene-manager/unittests/remote_scene_col_test"
586                 "${IOTIVITY_BASE}/out/${IOTIVITY_TARGET_OS}/${IOTIVITY_TARGET_ARCH}/debug/service/scene-manager/unittests/remote_scene_list_test"
587                 "${IOTIVITY_BASE}/out/${IOTIVITY_TARGET_OS}/${IOTIVITY_TARGET_ARCH}/debug/service/scene-manager/unittests/remote_scene_test"
588                 "${IOTIVITY_BASE}/out/${IOTIVITY_TARGET_OS}/${IOTIVITY_TARGET_ARCH}/debug/service/scene-manager/unittests/scene_action_test"
589                 "${IOTIVITY_BASE}/out/${IOTIVITY_TARGET_OS}/${IOTIVITY_TARGET_ARCH}/debug/service/scene-manager/unittests/scene_collection_test"
590                 "${IOTIVITY_BASE}/out/${IOTIVITY_TARGET_OS}/${IOTIVITY_TARGET_ARCH}/debug/service/scene-manager/unittests/scene_list_test"
591                 "${IOTIVITY_BASE}/out/${IOTIVITY_TARGET_OS}/${IOTIVITY_TARGET_ARCH}/debug/service/scene-manager/unittests/scene_test"
592                );
593
594     for exe in ${tests_list[@]}; do
595         filename=$(basename -- "${exe}")
596         if [ -n "${UNITTEST_XML_REPORT_FLAG_PREFIX}" ]; then
597             UNITTEST_XML_REPORT_FLAG="${UNITTEST_XML_REPORT_FLAG_PREFIX}/${filename}.xml"
598         fi
599         eval "${exe} ${UNITTEST_XML_REPORT_FLAG}"
600     done
601
602     unset tests_list
603
604     sleep 1
605
606     echo -e "Generating ${GREEN}${module_name}${NO_COLOUR} Reports"
607
608     # Printing Unit Test Report Location
609     if [  "yes" = ${UNITTEST_XML_REPORT} ]; then
610         echo -e "${GREEN}${module_name}${NO_COLOUR} UnitTest Report Location: ${BLUE}${unittest_report_dir}${NO_COLOUR}"
611     fi
612
613     gcovr -r . \
614         -e ".sconf_temp*" \
615         -e "examples.OICMiddle" \
616         -e "extlibs.*" \
617         -e "extlibs.hippomocks-master.*" \
618         -e "extlibs.rapidxml.*" \
619         -e "out.linux.*" \
620         -e "plugins.*" \
621         -e "resource.csdk.connectivity.lib.*" \
622         -e "resource.csdk.connectivity.samples.linux.*" \
623         -e "resource.csdk.security.provisioning.ck_manager.sample.*" \
624         -e "resource.csdk.security.provisioning.ck_manager.unittest.*" \
625         -e "resource.csdk.connectivity.scr.bt_edr_adapter.*" \
626         -e "resource.csdk.connectivity.src.bt_le_adapter.*" \
627         -e "resource.csdk.connectivity.src.bt_edr_adapter.*" \
628         -e "resource.csdk.connectivity.test.*" \
629         -e "resource.csdk.logger.*" \
630         -e "resource.src.*" \
631         -e "resource.csdk.security.provisioning.include.*" \
632         -e "resource.csdk.security.provisioning.sample.*" \
633         -e "resource.csdk.security.provisioning.src.cloud.*" \
634         -e "resource.csdk.security.provisioning.unittest.*" \
635         -e "resource.csdk.security.unittest.*" \
636         -e "resource.csdk.stack.*" \
637         -e "resource.examples.*" \
638         -e "resource.unittests.*" \
639         -e "resource.include.*" \
640         -e "resource.oc_logger.*" \
641         -e "resource.provisioning.examples.*" \
642         -e "resource.provisioning.unittests.*" \
643         -e "resource.csdk.connectivity.common.src.logger.c.*" \
644         -e "resource.csdk.connectivity.common.src.oic_console_logger.c.*" \
645         -e "resource.csdk.connectivity.common.src.oic_logger.c.*" \
646         -e "service.resource-encapsulation.include.*" \
647         -e "service.resource-encapsulation.src.common.expiryTimer.*" \
648         -e "service.resource-encapsulation.src.common.primitiveResource.unittests.*" \
649         -e "service.resource-encapsulation.src.resourceBroker.unittest.*" \
650         -e "service.resource-encapsulation.src.resourceCache.unittest.*" \
651         -e "service.resource-encapsulation.src.serverBuilder.unittest.*" \
652         -e "service.resource-encapsulation.unittest.*" \
653         -e "service.resource-hosting.src.unittest.*" \
654         -e "service.resource-hosting.SampleApp.*" \
655         -e "service.things-manager.*" \
656         -e "service.notification.unittest.*" \
657         -e "service.easy-setup.unittest.*" \
658         -e "service.easy-setup.sample.*" \
659         -e "service.easy-setup.mediator.csdk.unittests.*" \
660         -e "service.easy-setup.mediator.richsdk.unittests.*" \
661         -e "service.easy-setup.enrollee.unittest.*" \
662         -e "service.resource-container.examples.*" \
663         -e "service.resource-container.unittests." \
664         -e "service.resource-container.bundle-api." \
665         -e "service.resource-encapsulation.examples.*" \
666         -e "service.resource-encapsulation.src.common.primitiveResource.unittests." \
667         -e "service.resource-encapsulation.src.resourceBroker.unittest." \
668         -e "service.resource-encapsulation.src.resourceCache.unittest." \
669         -e "service.resource-encapsulation.src.serverBuilder.unittest." \
670         -e "service.resource-encapsulation.unittest." \
671         -e "service.resource-encapsulation.src.common.utils.*" \
672         -e "service.things-manager.sampleapp.*" \
673         -e "service.resource-hosting.unittest" \
674         -e "resource.c_common.oic_string.test.*" \
675         -e "service.notification.unittests.*" \
676         -e "service.notification.cpp-wrapper.unittest.*" \
677         -e "resource.c_common.*" \
678         -e "service.resource-directory.samples.*" \
679         -e "resource.csdk.security.src.*" \
680         -e "resource.csdk.connectivity.src.adapter_util.pkix.*" \
681         -e "resource.csdk.connectivity.src.adapter_util.caadapternetdtls.c" \
682         -e "service.scene-manager.sampleapp.*" \
683         -e "service.scene-manager.unittests.*" \
684         -e "service.coap-http-proxy.unittests.*" \
685         -e "resource.*" \
686         -e "service.easy-setup.*" \
687         -e "service.notification.*" \
688         -e "service.resource-encapsulation.*" \
689         -e "service.coap-http-proxy.*" \
690         ${report_flags} -o ${test_report_file}
691
692     if [  $? -eq 0 ]; then
693         echo -e "${GREEN}${module_name}${NO_COLOUR} Coverage Report Location: ${BLUE}${test_report_file}${NO_COLOUR}"
694         echo -e "${GREEN}${module_name}${NO_COLOUR} Report Generated ${GREEN}Successfully!${NO_COLOUR}"
695     else
696         echo -e "${RED}${module_name}${NO_COLOUR} Report Generation ${RED}Failed!${NO_COLOUR}"
697     fi
698 }
699
700 generate_report_NS()
701 {
702     # Setting Parameters
703     if [ "yes" = ${USE_TIMESTAMP} ]; then
704         report_dir="${module_name}_${time_stamp}"
705     else
706         report_dir="${module_name}"
707     fi
708     report_file="report.${report_format}"
709     test_report_dir="TestReport/${report_format}/${report_dir}"
710     test_report_file="${test_report_dir}/${report_file}"
711
712     rm -rf "${test_report_dir}"
713     mkdir -p "${test_report_dir}"
714
715     LD_LIBRARY_PATH="${IOTIVITY_BASE}/out/${IOTIVITY_TARGET_OS}/${IOTIVITY_TARGET_ARCH}/debug"
716
717     #Setting Proper Location for UnitTest XML report generation
718     unittest_report_dir="UnitTestReport/${report_dir}"
719     if [ "yes" = ${UNITTEST_XML_REPORT} ]; then
720         rm -rf "${unittest_report_dir}"
721         mkdir -p "${unittest_report_dir}"
722         UNITTEST_XML_REPORT_FLAG_PREFIX="--gtest_output=xml:${unittest_report_dir}"
723     fi
724
725     tests_list=(
726                 "${IOTIVITY_BASE}/out/${IOTIVITY_TARGET_OS}/${IOTIVITY_TARGET_ARCH}/debug/service/notification/unittest/notification_consumer_test"
727                 "${IOTIVITY_BASE}/out/${IOTIVITY_TARGET_OS}/${IOTIVITY_TARGET_ARCH}/debug/service/notification/cpp-wrapper/unittest/notification_consumer_wrapper_test"
728 #               "${IOTIVITY_BASE}/out/${IOTIVITY_TARGET_OS}/${IOTIVITY_TARGET_ARCH}/debug/service/notification/unittest/notification_provider_test"
729 #               "${IOTIVITY_BASE}/out/${IOTIVITY_TARGET_OS}/${IOTIVITY_TARGET_ARCH}/debug/service/notification/cpp-wrapper/unittest/notification_provider_wrapper_test"
730                );
731
732     for exe in ${tests_list[@]}; do
733         filename=$(basename -- "${exe}")
734         if [ -n "${UNITTEST_XML_REPORT_FLAG_PREFIX}" ]; then
735             UNITTEST_XML_REPORT_FLAG="${UNITTEST_XML_REPORT_FLAG_PREFIX}/${filename}.xml"
736         fi
737         eval "${exe} ${UNITTEST_XML_REPORT_FLAG}"
738     done
739
740     unset tests_list
741
742     sleep 1
743
744     echo -e "Generating ${GREEN}${module_name}${NO_COLOUR} Reports"
745
746     # Printing Unit Test Report Location
747     if [  "yes" = ${UNITTEST_XML_REPORT} ]; then
748         echo -e "${GREEN}${module_name}${NO_COLOUR} UnitTest Report Location: ${BLUE}${unittest_report_dir}${NO_COLOUR}"
749     fi
750
751     gcovr -r . \
752         -e ".sconf_temp*" \
753         -e "examples.OICMiddle" \
754         -e "extlibs.*" \
755         -e "extlibs.hippomocks-master.*" \
756         -e "extlibs.rapidxml.*" \
757         -e "out.linux.*" \
758         -e "plugins.*" \
759         -e "resource.csdk.connectivity.lib.*" \
760         -e "resource.csdk.connectivity.samples.linux.*" \
761         -e "resource.csdk.security.provisioning.ck_manager.sample.*" \
762         -e "resource.csdk.security.provisioning.ck_manager.unittest.*" \
763         -e "resource.csdk.connectivity.scr.bt_edr_adapter.*" \
764         -e "resource.csdk.connectivity.src.bt_le_adapter.*" \
765         -e "resource.csdk.connectivity.src.bt_edr_adapter.*" \
766         -e "resource.csdk.connectivity.test.*" \
767         -e "resource.csdk.logger.*" \
768         -e "resource.src.*" \
769         -e "resource.csdk.security.provisioning.include.*" \
770         -e "resource.csdk.security.provisioning.sample.*" \
771         -e "resource.csdk.security.provisioning.src.cloud.*" \
772         -e "resource.csdk.security.provisioning.unittest.*" \
773         -e "resource.csdk.security.unittest.*" \
774         -e "resource.csdk.stack.*" \
775         -e "resource.examples.*" \
776         -e "resource.unittests.*" \
777         -e "resource.include.*" \
778         -e "resource.oc_logger.*" \
779         -e "resource.provisioning.examples.*" \
780         -e "resource.provisioning.unittests.*" \
781         -e "resource.csdk.connectivity.common.src.logger.c.*" \
782         -e "resource.csdk.connectivity.common.src.oic_console_logger.c.*" \
783         -e "resource.csdk.connectivity.common.src.oic_logger.c.*" \
784         -e "service.resource-encapsulation.include.*" \
785         -e "service.resource-encapsulation.src.common.expiryTimer.*" \
786         -e "service.resource-encapsulation.src.common.primitiveResource.unittests.*" \
787         -e "service.resource-encapsulation.src.resourceBroker.unittest.*" \
788         -e "service.resource-encapsulation.src.resourceCache.unittest.*" \
789         -e "service.resource-encapsulation.src.serverBuilder.unittest.*" \
790         -e "service.resource-encapsulation.unittest.*" \
791         -e "service.resource-hosting.src.unittest.*" \
792         -e "service.resource-hosting.SampleApp.*" \
793         -e "service.things-manager.*" \
794         -e "service.notification.unittest.*" \
795         -e "service.easy-setup.unittest.*" \
796         -e "service.easy-setup.sample.*" \
797         -e "service.easy-setup.mediator.csdk.unittests.*" \
798         -e "service.easy-setup.mediator.richsdk.unittests.*" \
799         -e "service.easy-setup.enrollee.unittest.*" \
800         -e "service.resource-container.examples.*" \
801         -e "service.resource-container.unittests." \
802         -e "service.resource-container.bundle-api." \
803         -e "service.resource-encapsulation.examples.*" \
804         -e "service.resource-encapsulation.src.common.primitiveResource.unittests." \
805         -e "service.resource-encapsulation.src.resourceBroker.unittest." \
806         -e "service.resource-encapsulation.src.resourceCache.unittest." \
807         -e "service.resource-encapsulation.src.serverBuilder.unittest." \
808         -e "service.resource-encapsulation.unittest." \
809         -e "service.resource-encapsulation.src.common.utils.*" \
810         -e "service.things-manager.sampleapp.*" \
811         -e "service.resource-hosting.unittest" \
812         -e "resource.c_common.oic_string.test.*" \
813         -e "service.notification.unittests.*" \
814         -e "service.notification.cpp-wrapper.unittest.*" \
815         -e "resource.c_common.*" \
816         -e "service.resource-directory.samples.*" \
817         -e "resource.csdk.security.src.*" \
818         -e "resource.csdk.connectivity.src.adapter_util.pkix.*" \
819         -e "resource.csdk.connectivity.src.adapter_util.caadapternetdtls.c" \
820         -e "service.scene-manager.sampleapp.*" \
821         -e "service.scene-manager.unittests.*" \
822         -e "service.coap-http-proxy.unittests.*" \
823         -e "resource.*" \
824         -e "service.easy-setup.*" \
825         -e "service.resource-encapsulation.*" \
826         -e "service.scene-manager.*" \
827         -e "service.coap-http-proxy.*" \
828         -e "service.notification.cpp-wrapper.provider.inc.*" \
829         -e "service.notification.cpp-wrapper.consumer.inc.*" \
830         ${report_flags} -o ${test_report_file}
831
832     if [  $? -eq 0 ]; then
833         echo -e "${GREEN}${module_name}${NO_COLOUR} Coverage Report Location: ${BLUE}${test_report_file}${NO_COLOUR}"
834         echo -e "${GREEN}${module_name}${NO_COLOUR} Report Generated ${GREEN}Successfully!${NO_COLOUR}"
835     else
836         echo -e "${RED}${module_name}${NO_COLOUR} Report Generation ${RED}Failed!${NO_COLOUR}"
837     fi
838 }
839
840 generate_report_CHP()
841 {
842     # Setting Parameters
843     if [ "yes" = ${USE_TIMESTAMP} ]; then
844         report_dir="${module_name}_${time_stamp}"
845     else
846         report_dir="${module_name}"
847     fi
848
849     report_file="report.${report_format}"
850     test_report_dir="TestReport/${report_format}/${report_dir}"
851     test_report_file="${test_report_dir}/${report_file}"
852
853     rm -rf "${test_report_dir}"
854     mkdir -p "${test_report_dir}"
855
856     LD_LIBRARY_PATH="${IOTIVITY_BASE}/out/${IOTIVITY_TARGET_OS}/${IOTIVITY_TARGET_ARCH}/debug"
857
858     #Setting Proper Location for UnitTest XML report generation
859     unittest_report_dir="UnitTestReport/${report_dir}"
860     if [ "yes" = ${UNITTEST_XML_REPORT} ]; then
861         rm -rf "${unittest_report_dir}"
862         mkdir -p "${unittest_report_dir}"
863         UNITTEST_XML_REPORT_FLAG_PREFIX="--gtest_output=xml:${unittest_report_dir}"
864     fi
865
866     tests_list=(
867                "${IOTIVITY_BASE}/out/${IOTIVITY_TARGET_OS}/${IOTIVITY_TARGET_ARCH}/debug/service/coap-http-proxy/unittests/CoAP_unit_test"
868                );
869
870     for exe in ${tests_list[@]}; do
871         filename=$(basename -- "${exe}")
872         if [ -n "${UNITTEST_XML_REPORT_FLAG_PREFIX}" ]; then
873             UNITTEST_XML_REPORT_FLAG="${UNITTEST_XML_REPORT_FLAG_PREFIX}/${filename}.xml"
874         fi
875         eval "${exe} ${UNITTEST_XML_REPORT_FLAG}"
876     done
877
878     unset tests_list
879
880     sleep 1
881
882     echo -e "Generating ${GREEN}${module_name}${NO_COLOUR} Reports"
883
884     # Printing Unit Test Report Location
885     if [  "yes" = ${UNITTEST_XML_REPORT} ]; then
886         echo -e "${GREEN}${module_name}${NO_COLOUR} UnitTest Report Location: ${BLUE}${unittest_report_dir}${NO_COLOUR}"
887     fi
888
889     gcovr -r . \
890         -e ".sconf_temp*" \
891         -e "examples.OICMiddle" \
892         -e "extlibs.*" \
893         -e "extlibs.hippomocks-master.*" \
894         -e "extlibs.rapidxml.*" \
895         -e "out.linux.*" \
896         -e "plugins.*" \
897         -e "resource.csdk.connectivity.lib.*" \
898         -e "resource.csdk.connectivity.samples.linux.*" \
899         -e "resource.csdk.security.provisioning.ck_manager.sample.*" \
900         -e "resource.csdk.security.provisioning.ck_manager.unittest.*" \
901         -e "resource.csdk.connectivity.scr.bt_edr_adapter.*" \
902         -e "resource.csdk.connectivity.src.bt_le_adapter.*" \
903         -e "resource.csdk.connectivity.src.bt_edr_adapter.*" \
904         -e "resource.csdk.connectivity.test.*" \
905         -e "resource.csdk.logger.*" \
906         -e "resource.src.*" \
907         -e "resource.csdk.security.provisioning.include.*" \
908         -e "resource.csdk.security.provisioning.sample.*" \
909         -e "resource.csdk.security.provisioning.src.cloud.*" \
910         -e "resource.csdk.security.provisioning.unittest.*" \
911         -e "resource.csdk.security.unittest.*" \
912         -e "resource.csdk.stack.*" \
913         -e "resource.examples.*" \
914         -e "resource.unittests.*" \
915         -e "resource.include.*" \
916         -e "resource.oc_logger.*" \
917         -e "resource.provisioning.examples.*" \
918         -e "resource.provisioning.unittests.*" \
919         -e "resource.csdk.connectivity.common.src.logger.c.*" \
920         -e "resource.csdk.connectivity.common.src.oic_console_logger.c.*" \
921         -e "resource.csdk.connectivity.common.src.oic_logger.c.*" \
922         -e "service.resource-encapsulation.include.*" \
923         -e "service.resource-encapsulation.src.common.expiryTimer.*" \
924         -e "service.resource-encapsulation.src.common.primitiveResource.unittests.*" \
925         -e "service.resource-encapsulation.src.resourceBroker.unittest.*" \
926         -e "service.resource-encapsulation.src.resourceCache.unittest.*" \
927         -e "service.resource-encapsulation.src.serverBuilder.unittest.*" \
928         -e "service.resource-encapsulation.unittest.*" \
929         -e "service.resource-hosting.src.unittest.*" \
930         -e "service.resource-hosting.SampleApp.*" \
931         -e "service.things-manager.*" \
932         -e "service.notification.unittest.*" \
933         -e "service.easy-setup.unittest.*" \
934         -e "service.easy-setup.sample.*" \
935         -e "service.easy-setup.mediator.csdk.unittests.*" \
936         -e "service.easy-setup.mediator.richsdk.unittests.*" \
937         -e "service.easy-setup.enrollee.unittest.*" \
938         -e "service.resource-container.examples.*" \
939         -e "service.resource-container.unittests." \
940         -e "service.resource-container.bundle-api." \
941         -e "service.resource-encapsulation.examples.*" \
942         -e "service.resource-encapsulation.src.common.primitiveResource.unittests." \
943         -e "service.resource-encapsulation.src.resourceBroker.unittest." \
944         -e "service.resource-encapsulation.src.resourceCache.unittest." \
945         -e "service.resource-encapsulation.src.serverBuilder.unittest." \
946         -e "service.resource-encapsulation.unittest." \
947         -e "service.resource-encapsulation.src.common.utils.*" \
948         -e "service.things-manager.sampleapp.*" \
949         -e "service.resource-hosting.unittest" \
950         -e "resource.c_common.oic_string.test.*" \
951         -e "service.notification.unittests.*" \
952         -e "service.notification.cpp-wrapper.unittest.*" \
953         -e "resource.c_common.*" \
954         -e "service.resource-directory.samples.*" \
955         -e "resource.csdk.security.src.*" \
956         -e "resource.csdk.connectivity.src.adapter_util.pkix.*" \
957         -e "resource.csdk.connectivity.src.adapter_util.caadapternetdtls.c" \
958         -e "service.scene-manager.sampleapp.*" \
959         -e "service.scene-manager.unittests.*" \
960         -e "service.coap-http-proxy.unittests.*" \
961         -e "resource.*" \
962         -e "service.easy-setup.*" \
963         -e "service.notification.*" \
964         -e "service.resource-encapsulation.*" \
965         -e "service.scene-manager.*" \
966         ${report_flags} -o ${test_report_file}
967
968     if [  $? -eq 0 ]; then
969         echo -e "${GREEN}${module_name}${NO_COLOUR} Coverage Report Location: ${BLUE}${test_report_file}${NO_COLOUR}"
970         echo -e "${GREEN}${module_name}${NO_COLOUR} Report Generated ${GREEN}Successfully!${NO_COLOUR}"
971     else
972         echo -e "${RED}${module_name}${NO_COLOUR} Report Generation ${RED}Failed!${NO_COLOUR}"
973     fi
974 }
975
976 generate_report()
977 {
978     case ${module_name} in
979         CA)
980             generate_report_CA
981             ;;
982         ES)
983             generate_report_ES
984             ;;
985         RE)
986             generate_report_RE
987             ;;
988         SM)
989             generate_report_SM
990             ;;
991         NS)
992             generate_report_NS
993             ;;
994         CHP)
995             generate_report_CHP
996             ;;
997         ALL)
998             module_name="ES"
999             generate_report_ES
1000             module_name="RE"
1001             generate_report_RE
1002             module_name="SM"
1003             generate_report_SM
1004             module_name="NS"
1005             generate_report_NS
1006             module_name="CHP"
1007             generate_report_CHP
1008             module_name="CA"
1009             generate_report_CA
1010             ;;
1011     esac
1012 }
1013
1014 process_cmd_args "$@"
1015 generate_report