Update generate coverage report script
[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/unittests/unittests"
205                 "${IOTIVITY_BASE}/out/${IOTIVITY_TARGET_OS}/${IOTIVITY_TARGET_ARCH}/debug/resource/c_common/ocrandom/test/randomtests"
206                 "${IOTIVITY_BASE}/out/${IOTIVITY_TARGET_OS}/${IOTIVITY_TARGET_ARCH}/debug/resource/c_common/oic_malloc/test/malloctests"
207                 "${IOTIVITY_BASE}/out/${IOTIVITY_TARGET_OS}/${IOTIVITY_TARGET_ARCH}/debug/resource/c_common/oic_string/test/stringtests"
208                 "${IOTIVITY_BASE}/out/${IOTIVITY_TARGET_OS}/${IOTIVITY_TARGET_ARCH}/debug/resource/c_common/oic_time/test/timetests"
209                 "${IOTIVITY_BASE}/out/${IOTIVITY_TARGET_OS}/${IOTIVITY_TARGET_ARCH}/debug/resource/csdk/stack/test/stacktests"
210                 "${IOTIVITY_BASE}/out/${IOTIVITY_TARGET_OS}/${IOTIVITY_TARGET_ARCH}/debug/resource/c_common/ocevent/test/eventtests"
211                );
212
213     for exe in ${tests_list[@]}; do
214         filename=$(basename -- "${exe}")
215         if [ -n "${UNITTEST_XML_REPORT_FLAG_PREFIX}" ]; then
216             UNITTEST_XML_REPORT_FLAG="${UNITTEST_XML_REPORT_FLAG_PREFIX}/${filename}.xml"
217         fi
218         eval "${exe} ${UNITTEST_XML_REPORT_FLAG}"
219     done
220
221     unset tests_list
222
223     sleep 1
224
225     echo -e "Generating ${GREEN}${module_name}${NO_COLOUR} Reports"
226
227     # Printing Unit Test Report Location
228     if [  "yes" = ${UNITTEST_XML_REPORT} ]; then
229         echo -e "${GREEN}${module_name}${NO_COLOUR} UnitTest Report Location: ${BLUE}${unittest_report_dir}${NO_COLOUR}"
230     fi
231
232     gcovr -r . \
233         -e ".sconf_temp*" \
234         -e "examples.OICMiddle" \
235         -e "extlibs.*" \
236         -e "extlibs.hippomocks-master.*" \
237         -e "extlibs.rapidxml.*" \
238         -e "out.linux.*" \
239         -e "plugins.*" \
240         -e "cloud.*" \
241         -e "resource.csdk.connectivity.lib.*" \
242         -e "resource.csdk.connectivity.samples.linux.*" \
243         -e "resource.csdk.connectivity.scr.bt_edr_adapter.*" \
244         -e "resource.csdk.connectivity.src.bt_le_adapter.*" \
245         -e "resource.csdk.connectivity.test.*" \
246         -e "resource.csdk.logger.*" \
247         -e "resource.csdk.stack.samples.*" \
248         -e "resource.csdk.stack.test.*" \
249         -e "resource.examples.*" \
250         -e "resource.unittests.*" \
251         -e "resource.oc_logger.*" \
252         -e "resource.provisioning.*" \
253         -e "resource.csdk.connectivity.common.src.logger.c.*" \
254         -e "resource.csdk.connectivity.common.src.oic_console_logger.c.*" \
255         -e "resource.csdk.connectivity.common.src.oic_logger.c.*" \
256         -e "resource.c_common.oic_string.test.*" \
257         -e "resource.c_common.ocevent.test.*" \
258         -e "resource.c_common.ocrandom.test.*" \
259         -e "resource.c_common.oic_malloc.test.*" \
260         -e "resource.c_common.oic_time.test.*" \
261         -e "resource.csdk.connectivity.src.adapter_util.pkix.*" \
262         -e "resource.csdk.connectivity.src.adapter_util.caadapternetdtls.c" \
263         -e "service.*" \
264         -e "resource.csdk.security.*" \
265         -e "resource.csdk.resource-directory.*" \
266         -e "resource.csdk.routing.*" \
267         ${report_flags} -o ${test_report_file}
268
269     if [  $? -eq 0 ]; then
270         echo -e "${GREEN}${module_name}${NO_COLOUR} Coverage Report Location: ${BLUE}${test_report_file}${NO_COLOUR}"
271         echo -e "${GREEN}${module_name}${NO_COLOUR} Report Generated ${GREEN}Successfully!${NO_COLOUR}"
272     else
273         echo -e "${RED}${module_name}${NO_COLOUR} Report Generation ${RED}Failed!${NO_COLOUR}"
274     fi
275 }
276
277 generate_report_ES()
278 {
279     # Setting Parameters
280     if [ "yes" = ${USE_TIMESTAMP} ]; then
281         report_dir="${module_name}_${time_stamp}"
282     else
283         report_dir="${module_name}"
284     fi
285     report_file="report.${report_format}"
286
287     test_report_dir="TestReport/${report_format}/${report_dir}"
288     test_report_file="${test_report_dir}/${report_file}"
289
290     rm -rf "${test_report_dir}"
291     mkdir -p "${test_report_dir}"
292
293     LD_LIBRARY_PATH="${IOTIVITY_BASE}/out/${IOTIVITY_TARGET_OS}/${IOTIVITY_TARGET_ARCH}/debug"
294
295     #Setting Proper Location for UnitTest XML report generation
296     unittest_report_dir="UnitTestReport/${report_dir}"
297     if [ "yes" = ${UNITTEST_XML_REPORT} ]; then
298         rm -rf "${unittest_report_dir}"
299         mkdir -p "${unittest_report_dir}"
300         UNITTEST_XML_REPORT_FLAG_PREFIX="--gtest_output=xml:${unittest_report_dir}"
301     fi
302
303     tests_list=(
304                 "${IOTIVITY_BASE}/out/${IOTIVITY_TARGET_OS}/${IOTIVITY_TARGET_ARCH}/debug/service/easy-setup/enrollee/unittests/easysetup_enrollee_test"
305                 "${IOTIVITY_BASE}/out/${IOTIVITY_TARGET_OS}/${IOTIVITY_TARGET_ARCH}/debug/service/easy-setup/mediator/richsdk/unittests/easysetup_mediator_test"
306                );
307
308     for exe in ${tests_list[@]}; do
309         filename=$(basename -- "${exe}")
310         if [ -n "${UNITTEST_XML_REPORT_FLAG_PREFIX}" ]; then
311             UNITTEST_XML_REPORT_FLAG="${UNITTEST_XML_REPORT_FLAG_PREFIX}/${filename}.xml"
312         fi
313         eval "${exe} ${UNITTEST_XML_REPORT_FLAG}"
314     done
315
316     unset tests_list
317
318     sleep 1
319
320     echo -e "Generating ${GREEN}${module_name}${NO_COLOUR} Reports"
321
322     # Printing Unit Test Report Location
323     if [  "yes" = ${UNITTEST_XML_REPORT} ]; then
324         echo -e "${GREEN}${module_name}${NO_COLOUR} UnitTest Report Location: ${BLUE}${unittest_report_dir}${NO_COLOUR}"
325     fi
326
327     gcovr -r . \
328         -e ".sconf_temp*" \
329         -e "examples.OICMiddle" \
330         -e "extlibs.*" \
331         -e "extlibs.hippomocks-master.*" \
332         -e "extlibs.rapidxml.*" \
333         -e "out.linux.*" \
334         -e "plugins.*" \
335         -e "cloud.*" \
336         -e "resource.csdk.connectivity.lib.*" \
337         -e "resource.csdk.connectivity.samples.linux.*" \
338         -e "resource.csdk.security.provisioning.ck_manager.sample.*" \
339         -e "resource.csdk.security.provisioning.ck_manager.unittest.*" \
340         -e "resource.csdk.connectivity.scr.bt_edr_adapter.*" \
341         -e "resource.csdk.connectivity.src.bt_le_adapter.*" \
342         -e "resource.csdk.connectivity.src.bt_edr_adapter.*" \
343         -e "resource.csdk.connectivity.test.*" \
344         -e "resource.csdk.logger.*" \
345         -e "resource.src.*" \
346         -e "resource.csdk.security.provisioning.include.*" \
347         -e "resource.csdk.security.provisioning.sample.*" \
348         -e "resource.csdk.security.provisioning.src.cloud.*" \
349         -e "resource.csdk.security.provisioning.unittest.*" \
350         -e "resource.csdk.security.unittest.*" \
351         -e "resource.csdk.stack.*" \
352         -e "resource.examples.*" \
353         -e "resource.unittests.*" \
354         -e "resource.include.*" \
355         -e "resource.oc_logger.*" \
356         -e "resource.provisioning.examples.*" \
357         -e "resource.provisioning.unittests.*" \
358         -e "resource.csdk.connectivity.common.src.logger.c.*" \
359         -e "resource.csdk.connectivity.common.src.oic_console_logger.c.*" \
360         -e "resource.csdk.connectivity.common.src.oic_logger.c.*" \
361         -e "service.resource-encapsulation.include.*" \
362         -e "service.resource-encapsulation.src.common.expiryTimer.*" \
363         -e "service.resource-encapsulation.src.common.primitiveResource.unittests.*" \
364         -e "service.resource-encapsulation.src.resourceBroker.unittest.*" \
365         -e "service.resource-encapsulation.src.resourceCache.unittest.*" \
366         -e "service.resource-encapsulation.src.serverBuilder.unittest.*" \
367         -e "service.resource-encapsulation.unittest.*" \
368         -e "service.resource-hosting.src.unittest.*" \
369         -e "service.resource-hosting.SampleApp.*" \
370         -e "service.things-manager.*" \
371         -e "service.notification.unittest.*" \
372         -e "service.easy-setup.unittest.*" \
373         -e "service.easy-setup.sample.*" \
374         -e "service.easy-setup.mediator.csdk.unittests.*" \
375         -e "service.easy-setup.mediator.richsdk.unittests.*" \
376         -e "service.easy-setup.enrollee.unittest.*" \
377         -e "service.easy-setup.mediator.richsdk.src.EnrolleeSecurity.cpp" \
378         -e "service.resource-container.examples.*" \
379         -e "service.resource-container.unittests." \
380         -e "service.resource-container.bundle-api." \
381         -e "service.resource-encapsulation.examples.*" \
382         -e "service.resource-encapsulation.src.common.primitiveResource.unittests." \
383         -e "service.resource-encapsulation.src.resourceBroker.unittest." \
384         -e "service.resource-encapsulation.src.resourceCache.unittest." \
385         -e "service.resource-encapsulation.src.serverBuilder.unittest." \
386         -e "service.resource-encapsulation.unittest." \
387         -e "service.resource-encapsulation.src.common.utils.*" \
388         -e "service.things-manager.sampleapp.*" \
389         -e "service.resource-hosting.unittest" \
390         -e "resource.c_common.oic_string.test.*" \
391         -e "service.notification.unittests.*" \
392         -e "service.notification.cpp-wrapper.unittest.*" \
393         -e "resource.c_common.*" \
394         -e "service.resource-directory.samples.*" \
395         -e "resource.csdk.security.src.*" \
396         -e "resource.csdk.connectivity.src.adapter_util.pkix.*" \
397         -e "resource.csdk.connectivity.src.adapter_util.caadapternetdtls.c" \
398         -e "service.scene-manager.sampleapp.*" \
399         -e "service.scene-manager.unittests.*" \
400         -e "service.coap-http-proxy.unittests.*" \
401         -e "resource.*" \
402         -e "service.notification.*" \
403         -e "service.resource-encapsulation.*" \
404         -e "service.scene-manager.*" \
405         -e "service.coap-http-proxy.*" \
406         ${report_flags} -o ${test_report_file}
407
408     if [  $? -eq 0 ]; then
409         echo -e "${GREEN}${module_name}${NO_COLOUR} Coverage Report Location: ${BLUE}${test_report_file}${NO_COLOUR}"
410         echo -e "${GREEN}${module_name}${NO_COLOUR} Report Generated ${GREEN}Successfully!${NO_COLOUR}"
411     else
412         echo -e "${RED}${module_name}${NO_COLOUR} Report Generation ${RED}Failed!${NO_COLOUR}"
413     fi
414 }
415
416 generate_report_RE()
417 {
418     # Setting Parameters
419     if [ "yes" = ${USE_TIMESTAMP} ]; then
420         report_dir="${module_name}_${time_stamp}"
421     else
422         report_dir="${module_name}"
423     fi
424     report_file="report.${report_format}"
425     test_report_dir="TestReport/${report_format}/${report_dir}"
426     test_report_file="${test_report_dir}/${report_file}"
427
428     rm -rf "${test_report_dir}"
429     mkdir -p "${test_report_dir}"
430
431     LD_LIBRARY_PATH="${IOTIVITY_BASE}/out/${IOTIVITY_TARGET_OS}/${IOTIVITY_TARGET_ARCH}/debug"
432
433     #Setting Proper Location for UnitTest XML report generation
434     unittest_report_dir="UnitTestReport/${report_dir}"
435     if [ "yes" = ${UNITTEST_XML_REPORT} ]; then
436         rm -rf "${unittest_report_dir}"
437         mkdir -p "${unittest_report_dir}"
438         UNITTEST_XML_REPORT_FLAG_PREFIX="--gtest_output=xml:${unittest_report_dir}"
439     fi
440
441     tests_list=(
442                 "${IOTIVITY_BASE}/out/${IOTIVITY_TARGET_OS}/${IOTIVITY_TARGET_ARCH}/debug/service/resource-encapsulation/src/serverBuilder/rcs_server_test"
443                 "${IOTIVITY_BASE}/out/${IOTIVITY_TARGET_OS}/${IOTIVITY_TARGET_ARCH}/debug/service/resource-encapsulation/src/common/rcs_common_test"
444                 "${IOTIVITY_BASE}/out/${IOTIVITY_TARGET_OS}/${IOTIVITY_TARGET_ARCH}/debug/service/resource-encapsulation/unittests/rcs_client_test"
445                 "${IOTIVITY_BASE}/out/${IOTIVITY_TARGET_OS}/${IOTIVITY_TARGET_ARCH}/debug/service/resource-encapsulation/src/resourceCache/unittests/cache_test"
446                 "${IOTIVITY_BASE}/out/${IOTIVITY_TARGET_OS}/${IOTIVITY_TARGET_ARCH}/debug/service/resource-encapsulation/src/resourceBroker/unittest/broker_test"
447                );
448
449     for exe in ${tests_list[@]}; do
450         filename=$(basename -- "${exe}")
451         if [ -n "${UNITTEST_XML_REPORT_FLAG_PREFIX}" ]; then
452             UNITTEST_XML_REPORT_FLAG="${UNITTEST_XML_REPORT_FLAG_PREFIX}/${filename}.xml"
453         fi
454         eval "${exe} ${UNITTEST_XML_REPORT_FLAG}"
455     done
456
457     unset tests_list
458
459     sleep 1
460
461     echo -e "Generating ${GREEN}${module_name}${NO_COLOUR} Reports"
462
463     # Printing Unit Test Report Location
464     if [  "yes" = ${UNITTEST_XML_REPORT} ]; then
465         echo -e "${GREEN}${module_name}${NO_COLOUR} UnitTest Report Location: ${BLUE}${unittest_report_dir}${NO_COLOUR}"
466     fi
467
468     gcovr -r . \
469         -e ".sconf_temp*" \
470         -e "examples.OICMiddle" \
471         -e "extlibs.*" \
472         -e "extlibs.hippomocks-master.*" \
473         -e "extlibs.rapidxml.*" \
474         -e "out.linux.*" \
475         -e "plugins.*" \
476         -e "cloud.*" \
477         -e "resource.csdk.connectivity.lib.*" \
478         -e "resource.csdk.connectivity.samples.linux.*" \
479         -e "resource.csdk.security.provisioning.ck_manager.sample.*" \
480         -e "resource.csdk.security.provisioning.ck_manager.unittest.*" \
481         -e "resource.csdk.connectivity.scr.bt_edr_adapter.*" \
482         -e "resource.csdk.connectivity.src.bt_le_adapter.*" \
483         -e "resource.csdk.connectivity.src.bt_edr_adapter.*" \
484         -e "resource.csdk.connectivity.test.*" \
485         -e "resource.csdk.logger.*" \
486         -e "resource.src.*" \
487         -e "resource.csdk.security.provisioning.include.*" \
488         -e "resource.csdk.security.provisioning.sample.*" \
489         -e "resource.csdk.security.provisioning.src.cloud.*" \
490         -e "resource.csdk.security.provisioning.unittest.*" \
491         -e "resource.csdk.security.unittest.*" \
492         -e "resource.csdk.stack.*" \
493         -e "resource.examples.*" \
494         -e "resource.unittests.*" \
495         -e "resource.include.*" \
496         -e "resource.oc_logger.*" \
497         -e "resource.provisioning.examples.*" \
498         -e "resource.provisioning.unittests.*" \
499         -e "resource.csdk.connectivity.common.src.logger.c.*" \
500         -e "resource.csdk.connectivity.common.src.oic_console_logger.c.*" \
501         -e "resource.csdk.connectivity.common.src.oic_logger.c.*" \
502         -e "service.resource-encapsulation.include.*" \
503         -e "service.resource-encapsulation.src.common.expiryTimer.*" \
504         -e "service.resource-encapsulation.src.common.primitiveResource.unittests.*" \
505         -e "service.resource-encapsulation.src.resourceBroker.unittest.*" \
506         -e "service.resource-encapsulation.src.resourceCache.unittest.*" \
507         -e "service.resource-encapsulation.src.serverBuilder.unittest.*" \
508         -e "service.resource-encapsulation.unittest.*" \
509         -e "service.resource-hosting.src.unittest.*" \
510         -e "service.resource-hosting.SampleApp.*" \
511         -e "service.things-manager.*" \
512         -e "service.notification.unittest.*" \
513         -e "service.easy-setup.unittest.*" \
514         -e "service.easy-setup.sample.*" \
515         -e "service.easy-setup.mediator.csdk.unittests.*" \
516         -e "service.easy-setup.mediator.richsdk.unittests.*" \
517         -e "service.easy-setup.enrollee.unittest.*" \
518         -e "service.resource-container.examples.*" \
519         -e "service.resource-container.unittests." \
520         -e "service.resource-container.bundle-api." \
521         -e "service.resource-encapsulation.examples.*" \
522         -e "service.resource-encapsulation.src.common.primitiveResource.unittests." \
523         -e "service.resource-encapsulation.src.resourceBroker.unittest." \
524         -e "service.resource-encapsulation.src.resourceCache.unittest." \
525         -e "service.resource-encapsulation.src.serverBuilder.unittest." \
526         -e "service.resource-encapsulation.unittest." \
527         -e "service.resource-encapsulation.src.common.utils.*" \
528         -e "service.things-manager.sampleapp.*" \
529         -e "service.resource-hosting.unittest" \
530         -e "resource.c_common.oic_string.test.*" \
531         -e "service.notification.unittests.*" \
532         -e "service.notification.cpp-wrapper.unittest.*" \
533         -e "resource.c_common.*" \
534         -e "service.resource-directory.samples.*" \
535         -e "resource.csdk.security.src.*" \
536         -e "resource.csdk.connectivity.src.adapter_util.pkix.*" \
537         -e "resource.csdk.connectivity.src.adapter_util.caadapternetdtls.c" \
538         -e "service.scene-manager.sampleapp.*" \
539         -e "service.scene-manager.unittests.*" \
540         -e "service.coap-http-proxy.unittests.*" \
541         -e "resource.*" \
542         -e "service.easy-setup.*" \
543         -e "service.notification.*" \
544         -e "service.scene-manager.*" \
545         -e "service.coap-http-proxy.*" \
546         ${report_flags} -o ${test_report_file}
547
548     if [  $? -eq 0 ]; then
549         echo -e "${GREEN}${module_name}${NO_COLOUR} Coverage Report Location: ${BLUE}${test_report_file}${NO_COLOUR}"
550         echo -e "${GREEN}${module_name}${NO_COLOUR} Report Generated ${GREEN}Successfully!${NO_COLOUR}"
551     else
552         echo -e "${RED}${module_name}${NO_COLOUR} Report Generation ${RED}Failed!${NO_COLOUR}"
553     fi
554 }
555
556 generate_report_SM()
557 {
558     # Setting Parameters
559     if [ "yes" = ${USE_TIMESTAMP} ]; then
560         report_dir="${module_name}_${time_stamp}"
561     else
562         report_dir="${module_name}"
563     fi
564     report_file="report.${report_format}"
565     test_report_dir="TestReport/${report_format}/${report_dir}"
566     test_report_file="${test_report_dir}/${report_file}"
567
568     rm -rf "${test_report_dir}"
569     mkdir -p "${test_report_dir}"
570
571     LD_LIBRARY_PATH="${IOTIVITY_BASE}/out/${IOTIVITY_TARGET_OS}/${IOTIVITY_TARGET_ARCH}/debug"
572
573     #Setting Proper Location for UnitTest XML report generation
574     unittest_report_dir="UnitTestReport/${report_dir}"
575     if [ "yes" = ${UNITTEST_XML_REPORT} ]; then
576         rm -rf "${unittest_report_dir}"
577         mkdir -p "${unittest_report_dir}"
578         UNITTEST_XML_REPORT_FLAG_PREFIX="--gtest_output=xml:${unittest_report_dir}"
579     fi
580
581     tests_list=(
582                 "${IOTIVITY_BASE}/out/${IOTIVITY_TARGET_OS}/${IOTIVITY_TARGET_ARCH}/debug/service/scene-manager/unittests/remote_scene_action_test"
583                 "${IOTIVITY_BASE}/out/${IOTIVITY_TARGET_OS}/${IOTIVITY_TARGET_ARCH}/debug/service/scene-manager/unittests/remote_scene_col_test"
584                 "${IOTIVITY_BASE}/out/${IOTIVITY_TARGET_OS}/${IOTIVITY_TARGET_ARCH}/debug/service/scene-manager/unittests/remote_scene_list_test"
585                 "${IOTIVITY_BASE}/out/${IOTIVITY_TARGET_OS}/${IOTIVITY_TARGET_ARCH}/debug/service/scene-manager/unittests/remote_scene_test"
586                 "${IOTIVITY_BASE}/out/${IOTIVITY_TARGET_OS}/${IOTIVITY_TARGET_ARCH}/debug/service/scene-manager/unittests/scene_action_test"
587                 "${IOTIVITY_BASE}/out/${IOTIVITY_TARGET_OS}/${IOTIVITY_TARGET_ARCH}/debug/service/scene-manager/unittests/scene_collection_test"
588                 "${IOTIVITY_BASE}/out/${IOTIVITY_TARGET_OS}/${IOTIVITY_TARGET_ARCH}/debug/service/scene-manager/unittests/scene_list_test"
589                 "${IOTIVITY_BASE}/out/${IOTIVITY_TARGET_OS}/${IOTIVITY_TARGET_ARCH}/debug/service/scene-manager/unittests/scene_test"
590                );
591
592     for exe in ${tests_list[@]}; do
593         filename=$(basename -- "${exe}")
594         if [ -n "${UNITTEST_XML_REPORT_FLAG_PREFIX}" ]; then
595             UNITTEST_XML_REPORT_FLAG="${UNITTEST_XML_REPORT_FLAG_PREFIX}/${filename}.xml"
596         fi
597         eval "${exe} ${UNITTEST_XML_REPORT_FLAG}"
598     done
599
600     unset tests_list
601
602     sleep 1
603
604     echo -e "Generating ${GREEN}${module_name}${NO_COLOUR} Reports"
605
606     # Printing Unit Test Report Location
607     if [  "yes" = ${UNITTEST_XML_REPORT} ]; then
608         echo -e "${GREEN}${module_name}${NO_COLOUR} UnitTest Report Location: ${BLUE}${unittest_report_dir}${NO_COLOUR}"
609     fi
610
611     gcovr -r . \
612         -e ".sconf_temp*" \
613         -e "examples.OICMiddle" \
614         -e "extlibs.*" \
615         -e "extlibs.hippomocks-master.*" \
616         -e "extlibs.rapidxml.*" \
617         -e "out.linux.*" \
618         -e "plugins.*" \
619         -e "resource.csdk.connectivity.lib.*" \
620         -e "resource.csdk.connectivity.samples.linux.*" \
621         -e "resource.csdk.security.provisioning.ck_manager.sample.*" \
622         -e "resource.csdk.security.provisioning.ck_manager.unittest.*" \
623         -e "resource.csdk.connectivity.scr.bt_edr_adapter.*" \
624         -e "resource.csdk.connectivity.src.bt_le_adapter.*" \
625         -e "resource.csdk.connectivity.src.bt_edr_adapter.*" \
626         -e "resource.csdk.connectivity.test.*" \
627         -e "resource.csdk.logger.*" \
628         -e "resource.src.*" \
629         -e "resource.csdk.security.provisioning.include.*" \
630         -e "resource.csdk.security.provisioning.sample.*" \
631         -e "resource.csdk.security.provisioning.src.cloud.*" \
632         -e "resource.csdk.security.provisioning.unittest.*" \
633         -e "resource.csdk.security.unittest.*" \
634         -e "resource.csdk.stack.*" \
635         -e "resource.examples.*" \
636         -e "resource.unittests.*" \
637         -e "resource.include.*" \
638         -e "resource.oc_logger.*" \
639         -e "resource.provisioning.examples.*" \
640         -e "resource.provisioning.unittests.*" \
641         -e "resource.csdk.connectivity.common.src.logger.c.*" \
642         -e "resource.csdk.connectivity.common.src.oic_console_logger.c.*" \
643         -e "resource.csdk.connectivity.common.src.oic_logger.c.*" \
644         -e "service.resource-encapsulation.include.*" \
645         -e "service.resource-encapsulation.src.common.expiryTimer.*" \
646         -e "service.resource-encapsulation.src.common.primitiveResource.unittests.*" \
647         -e "service.resource-encapsulation.src.resourceBroker.unittest.*" \
648         -e "service.resource-encapsulation.src.resourceCache.unittest.*" \
649         -e "service.resource-encapsulation.src.serverBuilder.unittest.*" \
650         -e "service.resource-encapsulation.unittest.*" \
651         -e "service.resource-hosting.src.unittest.*" \
652         -e "service.resource-hosting.SampleApp.*" \
653         -e "service.things-manager.*" \
654         -e "service.notification.unittest.*" \
655         -e "service.easy-setup.unittest.*" \
656         -e "service.easy-setup.sample.*" \
657         -e "service.easy-setup.mediator.csdk.unittests.*" \
658         -e "service.easy-setup.mediator.richsdk.unittests.*" \
659         -e "service.easy-setup.enrollee.unittest.*" \
660         -e "service.resource-container.examples.*" \
661         -e "service.resource-container.unittests." \
662         -e "service.resource-container.bundle-api." \
663         -e "service.resource-encapsulation.examples.*" \
664         -e "service.resource-encapsulation.src.common.primitiveResource.unittests." \
665         -e "service.resource-encapsulation.src.resourceBroker.unittest." \
666         -e "service.resource-encapsulation.src.resourceCache.unittest." \
667         -e "service.resource-encapsulation.src.serverBuilder.unittest." \
668         -e "service.resource-encapsulation.unittest." \
669         -e "service.resource-encapsulation.src.common.utils.*" \
670         -e "service.things-manager.sampleapp.*" \
671         -e "service.resource-hosting.unittest" \
672         -e "resource.c_common.oic_string.test.*" \
673         -e "service.notification.unittests.*" \
674         -e "service.notification.cpp-wrapper.unittest.*" \
675         -e "resource.c_common.*" \
676         -e "service.resource-directory.samples.*" \
677         -e "resource.csdk.security.src.*" \
678         -e "resource.csdk.connectivity.src.adapter_util.pkix.*" \
679         -e "resource.csdk.connectivity.src.adapter_util.caadapternetdtls.c" \
680         -e "service.scene-manager.sampleapp.*" \
681         -e "service.scene-manager.unittests.*" \
682         -e "service.coap-http-proxy.unittests.*" \
683         -e "resource.*" \
684         -e "service.easy-setup.*" \
685         -e "service.notification.*" \
686         -e "service.resource-encapsulation.*" \
687         -e "service.coap-http-proxy.*" \
688         ${report_flags} -o ${test_report_file}
689
690     if [  $? -eq 0 ]; then
691         echo -e "${GREEN}${module_name}${NO_COLOUR} Coverage Report Location: ${BLUE}${test_report_file}${NO_COLOUR}"
692         echo -e "${GREEN}${module_name}${NO_COLOUR} Report Generated ${GREEN}Successfully!${NO_COLOUR}"
693     else
694         echo -e "${RED}${module_name}${NO_COLOUR} Report Generation ${RED}Failed!${NO_COLOUR}"
695     fi
696 }
697
698 generate_report_NS()
699 {
700     # Setting Parameters
701     if [ "yes" = ${USE_TIMESTAMP} ]; then
702         report_dir="${module_name}_${time_stamp}"
703     else
704         report_dir="${module_name}"
705     fi
706     report_file="report.${report_format}"
707     test_report_dir="TestReport/${report_format}/${report_dir}"
708     test_report_file="${test_report_dir}/${report_file}"
709
710     rm -rf "${test_report_dir}"
711     mkdir -p "${test_report_dir}"
712
713     LD_LIBRARY_PATH="${IOTIVITY_BASE}/out/${IOTIVITY_TARGET_OS}/${IOTIVITY_TARGET_ARCH}/debug"
714
715     #Setting Proper Location for UnitTest XML report generation
716     unittest_report_dir="UnitTestReport/${report_dir}"
717     if [ "yes" = ${UNITTEST_XML_REPORT} ]; then
718         rm -rf "${unittest_report_dir}"
719         mkdir -p "${unittest_report_dir}"
720         UNITTEST_XML_REPORT_FLAG_PREFIX="--gtest_output=xml:${unittest_report_dir}"
721     fi
722
723     tests_list=(
724                 "${IOTIVITY_BASE}/out/${IOTIVITY_TARGET_OS}/${IOTIVITY_TARGET_ARCH}/debug/service/notification/unittest/notification_consumer_test"
725                 "${IOTIVITY_BASE}/out/${IOTIVITY_TARGET_OS}/${IOTIVITY_TARGET_ARCH}/debug/service/notification/cpp-wrapper/unittest/notification_consumer_wrapper_test"
726 #               "${IOTIVITY_BASE}/out/${IOTIVITY_TARGET_OS}/${IOTIVITY_TARGET_ARCH}/debug/service/notification/unittest/notification_provider_test"
727 #               "${IOTIVITY_BASE}/out/${IOTIVITY_TARGET_OS}/${IOTIVITY_TARGET_ARCH}/debug/service/notification/cpp-wrapper/unittest/notification_provider_wrapper_test"
728                );
729
730     for exe in ${tests_list[@]}; do
731         filename=$(basename -- "${exe}")
732         if [ -n "${UNITTEST_XML_REPORT_FLAG_PREFIX}" ]; then
733             UNITTEST_XML_REPORT_FLAG="${UNITTEST_XML_REPORT_FLAG_PREFIX}/${filename}.xml"
734         fi
735         eval "${exe} ${UNITTEST_XML_REPORT_FLAG}"
736     done
737
738     unset tests_list
739
740     sleep 1
741
742     echo -e "Generating ${GREEN}${module_name}${NO_COLOUR} Reports"
743
744     # Printing Unit Test Report Location
745     if [  "yes" = ${UNITTEST_XML_REPORT} ]; then
746         echo -e "${GREEN}${module_name}${NO_COLOUR} UnitTest Report Location: ${BLUE}${unittest_report_dir}${NO_COLOUR}"
747     fi
748
749     gcovr -r . \
750         -e ".sconf_temp*" \
751         -e "examples.OICMiddle" \
752         -e "extlibs.*" \
753         -e "extlibs.hippomocks-master.*" \
754         -e "extlibs.rapidxml.*" \
755         -e "out.linux.*" \
756         -e "plugins.*" \
757         -e "resource.csdk.connectivity.lib.*" \
758         -e "resource.csdk.connectivity.samples.linux.*" \
759         -e "resource.csdk.security.provisioning.ck_manager.sample.*" \
760         -e "resource.csdk.security.provisioning.ck_manager.unittest.*" \
761         -e "resource.csdk.connectivity.scr.bt_edr_adapter.*" \
762         -e "resource.csdk.connectivity.src.bt_le_adapter.*" \
763         -e "resource.csdk.connectivity.src.bt_edr_adapter.*" \
764         -e "resource.csdk.connectivity.test.*" \
765         -e "resource.csdk.logger.*" \
766         -e "resource.src.*" \
767         -e "resource.csdk.security.provisioning.include.*" \
768         -e "resource.csdk.security.provisioning.sample.*" \
769         -e "resource.csdk.security.provisioning.src.cloud.*" \
770         -e "resource.csdk.security.provisioning.unittest.*" \
771         -e "resource.csdk.security.unittest.*" \
772         -e "resource.csdk.stack.*" \
773         -e "resource.examples.*" \
774         -e "resource.unittests.*" \
775         -e "resource.include.*" \
776         -e "resource.oc_logger.*" \
777         -e "resource.provisioning.examples.*" \
778         -e "resource.provisioning.unittests.*" \
779         -e "resource.csdk.connectivity.common.src.logger.c.*" \
780         -e "resource.csdk.connectivity.common.src.oic_console_logger.c.*" \
781         -e "resource.csdk.connectivity.common.src.oic_logger.c.*" \
782         -e "service.resource-encapsulation.include.*" \
783         -e "service.resource-encapsulation.src.common.expiryTimer.*" \
784         -e "service.resource-encapsulation.src.common.primitiveResource.unittests.*" \
785         -e "service.resource-encapsulation.src.resourceBroker.unittest.*" \
786         -e "service.resource-encapsulation.src.resourceCache.unittest.*" \
787         -e "service.resource-encapsulation.src.serverBuilder.unittest.*" \
788         -e "service.resource-encapsulation.unittest.*" \
789         -e "service.resource-hosting.src.unittest.*" \
790         -e "service.resource-hosting.SampleApp.*" \
791         -e "service.things-manager.*" \
792         -e "service.notification.unittest.*" \
793         -e "service.easy-setup.unittest.*" \
794         -e "service.easy-setup.sample.*" \
795         -e "service.easy-setup.mediator.csdk.unittests.*" \
796         -e "service.easy-setup.mediator.richsdk.unittests.*" \
797         -e "service.easy-setup.enrollee.unittest.*" \
798         -e "service.resource-container.examples.*" \
799         -e "service.resource-container.unittests." \
800         -e "service.resource-container.bundle-api." \
801         -e "service.resource-encapsulation.examples.*" \
802         -e "service.resource-encapsulation.src.common.primitiveResource.unittests." \
803         -e "service.resource-encapsulation.src.resourceBroker.unittest." \
804         -e "service.resource-encapsulation.src.resourceCache.unittest." \
805         -e "service.resource-encapsulation.src.serverBuilder.unittest." \
806         -e "service.resource-encapsulation.unittest." \
807         -e "service.resource-encapsulation.src.common.utils.*" \
808         -e "service.things-manager.sampleapp.*" \
809         -e "service.resource-hosting.unittest" \
810         -e "resource.c_common.oic_string.test.*" \
811         -e "service.notification.unittests.*" \
812         -e "service.notification.cpp-wrapper.unittest.*" \
813         -e "resource.c_common.*" \
814         -e "service.resource-directory.samples.*" \
815         -e "resource.csdk.security.src.*" \
816         -e "resource.csdk.connectivity.src.adapter_util.pkix.*" \
817         -e "resource.csdk.connectivity.src.adapter_util.caadapternetdtls.c" \
818         -e "service.scene-manager.sampleapp.*" \
819         -e "service.scene-manager.unittests.*" \
820         -e "service.coap-http-proxy.unittests.*" \
821         -e "resource.*" \
822         -e "service.easy-setup.*" \
823         -e "service.resource-encapsulation.*" \
824         -e "service.scene-manager.*" \
825         -e "service.coap-http-proxy.*" \
826         -e "service.notification.cpp-wrapper.provider.inc.*" \
827         -e "service.notification.cpp-wrapper.consumer.inc.*" \
828         ${report_flags} -o ${test_report_file}
829
830     if [  $? -eq 0 ]; then
831         echo -e "${GREEN}${module_name}${NO_COLOUR} Coverage Report Location: ${BLUE}${test_report_file}${NO_COLOUR}"
832         echo -e "${GREEN}${module_name}${NO_COLOUR} Report Generated ${GREEN}Successfully!${NO_COLOUR}"
833     else
834         echo -e "${RED}${module_name}${NO_COLOUR} Report Generation ${RED}Failed!${NO_COLOUR}"
835     fi
836 }
837
838 generate_report_CHP()
839 {
840     # Setting Parameters
841     if [ "yes" = ${USE_TIMESTAMP} ]; then
842         report_dir="${module_name}_${time_stamp}"
843     else
844         report_dir="${module_name}"
845     fi
846
847     report_file="report.${report_format}"
848     test_report_dir="TestReport/${report_format}/${report_dir}"
849     test_report_file="${test_report_dir}/${report_file}"
850
851     rm -rf "${test_report_dir}"
852     mkdir -p "${test_report_dir}"
853
854     LD_LIBRARY_PATH="${IOTIVITY_BASE}/out/${IOTIVITY_TARGET_OS}/${IOTIVITY_TARGET_ARCH}/debug"
855
856     #Setting Proper Location for UnitTest XML report generation
857     unittest_report_dir="UnitTestReport/${report_dir}"
858     if [ "yes" = ${UNITTEST_XML_REPORT} ]; then
859         rm -rf "${unittest_report_dir}"
860         mkdir -p "${unittest_report_dir}"
861         UNITTEST_XML_REPORT_FLAG_PREFIX="--gtest_output=xml:${unittest_report_dir}"
862     fi
863
864     tests_list=(
865                "${IOTIVITY_BASE}/out/${IOTIVITY_TARGET_OS}/${IOTIVITY_TARGET_ARCH}/debug/service/coap-http-proxy/unittests/CoAP_unit_test"
866                );
867
868     for exe in ${tests_list[@]}; do
869         filename=$(basename -- "${exe}")
870         if [ -n "${UNITTEST_XML_REPORT_FLAG_PREFIX}" ]; then
871             UNITTEST_XML_REPORT_FLAG="${UNITTEST_XML_REPORT_FLAG_PREFIX}/${filename}.xml"
872         fi
873         eval "${exe} ${UNITTEST_XML_REPORT_FLAG}"
874     done
875
876     unset tests_list
877
878     sleep 1
879
880     echo -e "Generating ${GREEN}${module_name}${NO_COLOUR} Reports"
881
882     # Printing Unit Test Report Location
883     if [  "yes" = ${UNITTEST_XML_REPORT} ]; then
884         echo -e "${GREEN}${module_name}${NO_COLOUR} UnitTest Report Location: ${BLUE}${unittest_report_dir}${NO_COLOUR}"
885     fi
886
887     gcovr -r . \
888         -e ".sconf_temp*" \
889         -e "examples.OICMiddle" \
890         -e "extlibs.*" \
891         -e "extlibs.hippomocks-master.*" \
892         -e "extlibs.rapidxml.*" \
893         -e "out.linux.*" \
894         -e "plugins.*" \
895         -e "resource.csdk.connectivity.lib.*" \
896         -e "resource.csdk.connectivity.samples.linux.*" \
897         -e "resource.csdk.security.provisioning.ck_manager.sample.*" \
898         -e "resource.csdk.security.provisioning.ck_manager.unittest.*" \
899         -e "resource.csdk.connectivity.scr.bt_edr_adapter.*" \
900         -e "resource.csdk.connectivity.src.bt_le_adapter.*" \
901         -e "resource.csdk.connectivity.src.bt_edr_adapter.*" \
902         -e "resource.csdk.connectivity.test.*" \
903         -e "resource.csdk.logger.*" \
904         -e "resource.src.*" \
905         -e "resource.csdk.security.provisioning.include.*" \
906         -e "resource.csdk.security.provisioning.sample.*" \
907         -e "resource.csdk.security.provisioning.src.cloud.*" \
908         -e "resource.csdk.security.provisioning.unittest.*" \
909         -e "resource.csdk.security.unittest.*" \
910         -e "resource.csdk.stack.*" \
911         -e "resource.examples.*" \
912         -e "resource.unittests.*" \
913         -e "resource.include.*" \
914         -e "resource.oc_logger.*" \
915         -e "resource.provisioning.examples.*" \
916         -e "resource.provisioning.unittests.*" \
917         -e "resource.csdk.connectivity.common.src.logger.c.*" \
918         -e "resource.csdk.connectivity.common.src.oic_console_logger.c.*" \
919         -e "resource.csdk.connectivity.common.src.oic_logger.c.*" \
920         -e "service.resource-encapsulation.include.*" \
921         -e "service.resource-encapsulation.src.common.expiryTimer.*" \
922         -e "service.resource-encapsulation.src.common.primitiveResource.unittests.*" \
923         -e "service.resource-encapsulation.src.resourceBroker.unittest.*" \
924         -e "service.resource-encapsulation.src.resourceCache.unittest.*" \
925         -e "service.resource-encapsulation.src.serverBuilder.unittest.*" \
926         -e "service.resource-encapsulation.unittest.*" \
927         -e "service.resource-hosting.src.unittest.*" \
928         -e "service.resource-hosting.SampleApp.*" \
929         -e "service.things-manager.*" \
930         -e "service.notification.unittest.*" \
931         -e "service.easy-setup.unittest.*" \
932         -e "service.easy-setup.sample.*" \
933         -e "service.easy-setup.mediator.csdk.unittests.*" \
934         -e "service.easy-setup.mediator.richsdk.unittests.*" \
935         -e "service.easy-setup.enrollee.unittest.*" \
936         -e "service.resource-container.examples.*" \
937         -e "service.resource-container.unittests." \
938         -e "service.resource-container.bundle-api." \
939         -e "service.resource-encapsulation.examples.*" \
940         -e "service.resource-encapsulation.src.common.primitiveResource.unittests." \
941         -e "service.resource-encapsulation.src.resourceBroker.unittest." \
942         -e "service.resource-encapsulation.src.resourceCache.unittest." \
943         -e "service.resource-encapsulation.src.serverBuilder.unittest." \
944         -e "service.resource-encapsulation.unittest." \
945         -e "service.resource-encapsulation.src.common.utils.*" \
946         -e "service.things-manager.sampleapp.*" \
947         -e "service.resource-hosting.unittest" \
948         -e "resource.c_common.oic_string.test.*" \
949         -e "service.notification.unittests.*" \
950         -e "service.notification.cpp-wrapper.unittest.*" \
951         -e "resource.c_common.*" \
952         -e "service.resource-directory.samples.*" \
953         -e "resource.csdk.security.src.*" \
954         -e "resource.csdk.connectivity.src.adapter_util.pkix.*" \
955         -e "resource.csdk.connectivity.src.adapter_util.caadapternetdtls.c" \
956         -e "service.scene-manager.sampleapp.*" \
957         -e "service.scene-manager.unittests.*" \
958         -e "service.coap-http-proxy.unittests.*" \
959         -e "resource.*" \
960         -e "service.easy-setup.*" \
961         -e "service.notification.*" \
962         -e "service.resource-encapsulation.*" \
963         -e "service.scene-manager.*" \
964         ${report_flags} -o ${test_report_file}
965
966     if [  $? -eq 0 ]; then
967         echo -e "${GREEN}${module_name}${NO_COLOUR} Coverage Report Location: ${BLUE}${test_report_file}${NO_COLOUR}"
968         echo -e "${GREEN}${module_name}${NO_COLOUR} Report Generated ${GREEN}Successfully!${NO_COLOUR}"
969     else
970         echo -e "${RED}${module_name}${NO_COLOUR} Report Generation ${RED}Failed!${NO_COLOUR}"
971     fi
972 }
973
974 generate_report()
975 {
976     case ${module_name} in
977         CA)
978             generate_report_CA
979             ;;
980         ES)
981             generate_report_ES
982             ;;
983         RE)
984             generate_report_RE
985             ;;
986         SM)
987             generate_report_SM
988             ;;
989         NS)
990             generate_report_NS
991             ;;
992         CHP)
993             generate_report_CHP
994             ;;
995         ALL)
996             module_name="ES"
997             generate_report_ES
998             module_name="RE"
999             generate_report_RE
1000             module_name="SM"
1001             generate_report_SM
1002             module_name="NS"
1003             generate_report_NS
1004             module_name="CHP"
1005             generate_report_CHP
1006             module_name="CA"
1007             generate_report_CA
1008             ;;
1009     esac
1010 }
1011
1012 process_cmd_args "$@"
1013 generate_report