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