11 time_stamp=$(date -u +%Y-%b-%d)
14 report_flags="--html --html-details";
17 IOTIVITY_BASE="${PWD}"
18 IOTIVITY_TARGET_OS="linux"
19 IOTIVITY_TARGET_ARCH="$(uname -m)"
21 UNITTEST_XML_REPORT="yes"
23 case $IOTIVITY_TARGET_ARCH in
25 IOTIVITY_TARGET_ARCH=x86
31 echo "Usage: tools/generate_report.sh <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."
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"
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}"
58 while [ "$#" -gt 0 ]; do
67 if [ "gcov" != ${report_format} -a "html" != ${report_format} -a "xml" != ${report_format} ]; then
70 case "$report_format" in
72 report_flags="--html --html-details";
85 report_format="${1#*=}";
86 if [ "gcov" != ${report_format} -a "html" != ${report_format} -a "xml" != ${report_format} ]; then
89 case "$report_format" in
91 report_flags="--html --html-details";
97 report_flags="--xml --xml-pretty";
104 echo "$1 requires an argument [gcov|html|xml]" >&2;
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
118 USE_TIMESTAMP="${1#*=}";
119 if [ "yes" != ${USE_TIMESTAMP} -a "no" != ${USE_TIMESTAMP} ]; then
125 echo "$1 requires an argument [yes|no]" >&2;
131 UNITTEST_XML_REPORT="${1#*=}";
132 if [ "yes" != ${UNITTEST_XML_REPORT} -a "no" != ${UNITTEST_XML_REPORT} ]; then
138 echo "$1 requires an argument [yes|no]" >&2;
144 IOTIVITY_TARGET_ARCH="${1#*=}";
145 if [ "x86" != ${IOTIVITY_TARGET_ARCH} -a "x86_64" != ${IOTIVITY_TARGET_ARCH} ]; then
151 echo "$1 requires an argument" >&2;
166 echo "unknown option: $1" >&2;
177 if [ "yes" = ${USE_TIMESTAMP} ]; then
178 report_dir="${module_name}_${time_stamp}"
180 report_dir="${module_name}"
183 report_file="report.${report_format}"
185 test_report_dir="TestReport/${report_format}/${report_dir}"
186 test_report_file="${test_report_dir}/${report_file}"
188 rm -rf "${test_report_dir}"
189 mkdir -p "${test_report_dir}"
191 LD_LIBRARY_PATH="${IOTIVITY_BASE}/out/${IOTIVITY_TARGET_OS}/${IOTIVITY_TARGET_ARCH}/debug"
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}"
202 "${IOTIVITY_BASE}/out/${IOTIVITY_TARGET_OS}/${IOTIVITY_TARGET_ARCH}/debug/resource/csdk/connectivity/test/catests"
203 "${IOTIVITY_BASE}/out/${IOTIVITY_TARGET_OS}/${IOTIVITY_TARGET_ARCH}/debug/resource/csdk/stack/test/cbortests"
204 "${IOTIVITY_BASE}/out/${IOTIVITY_TARGET_OS}/${IOTIVITY_TARGET_ARCH}/debug/resource/csdk/stack/test/keepalivetests"
205 "${IOTIVITY_BASE}/out/${IOTIVITY_TARGET_OS}/${IOTIVITY_TARGET_ARCH}/debug/resource/csdk/stack/test/oicgrouptests"
206 "${IOTIVITY_BASE}/out/${IOTIVITY_TARGET_OS}/${IOTIVITY_TARGET_ARCH}/debug/resource/unittests/unittests"
207 "${IOTIVITY_BASE}/out/${IOTIVITY_TARGET_OS}/${IOTIVITY_TARGET_ARCH}/debug/resource/c_common/ocrandom/test/randomtests"
208 "${IOTIVITY_BASE}/out/${IOTIVITY_TARGET_OS}/${IOTIVITY_TARGET_ARCH}/debug/resource/c_common/oic_malloc/test/malloctests"
209 "${IOTIVITY_BASE}/out/${IOTIVITY_TARGET_OS}/${IOTIVITY_TARGET_ARCH}/debug/resource/c_common/oic_string/test/stringtests"
210 "${IOTIVITY_BASE}/out/${IOTIVITY_TARGET_OS}/${IOTIVITY_TARGET_ARCH}/debug/resource/c_common/oic_time/test/timetests"
211 "${IOTIVITY_BASE}/out/${IOTIVITY_TARGET_OS}/${IOTIVITY_TARGET_ARCH}/debug/resource/csdk/stack/test/stacktests"
212 "${IOTIVITY_BASE}/out/${IOTIVITY_TARGET_OS}/${IOTIVITY_TARGET_ARCH}/debug/resource/c_common/ocevent/test/eventtests"
215 for exe in ${tests_list[@]}; do
216 filename=$(basename -- "${exe}")
217 if [ -n "${UNITTEST_XML_REPORT_FLAG_PREFIX}" ]; then
218 UNITTEST_XML_REPORT_FLAG="${UNITTEST_XML_REPORT_FLAG_PREFIX}/${filename}.xml"
220 eval "${exe} ${UNITTEST_XML_REPORT_FLAG}"
227 echo -e "Generating ${GREEN}${module_name}${NO_COLOUR} Reports"
229 # Printing Unit Test Report Location
230 if [ "yes" = ${UNITTEST_XML_REPORT} ]; then
231 echo -e "${GREEN}${module_name}${NO_COLOUR} UnitTest Report Location: ${BLUE}${unittest_report_dir}${NO_COLOUR}"
236 -e "examples.OICMiddle" \
238 -e "extlibs.hippomocks-master.*" \
239 -e "extlibs.rapidxml.*" \
243 -e "resource.csdk.connectivity.lib.*" \
244 -e "resource.csdk.connectivity.samples.linux.*" \
245 -e "resource.csdk.connectivity.scr.bt_edr_adapter.*" \
246 -e "resource.csdk.connectivity.src.bt_le_adapter.*" \
247 -e "resource.csdk.connectivity.test.*" \
248 -e "resource.csdk.logger.*" \
249 -e "resource.csdk.stack.samples.*" \
250 -e "resource.csdk.stack.test.*" \
251 -e "resource.examples.*" \
252 -e "resource.unittests.*" \
253 -e "resource.oc_logger.*" \
254 -e "resource.provisioning.*" \
255 -e "resource.csdk.connectivity.common.src.logger.c.*" \
256 -e "resource.csdk.connectivity.common.src.oic_console_logger.c.*" \
257 -e "resource.csdk.connectivity.common.src.oic_logger.c.*" \
258 -e "resource.c_common.oic_string.test.*" \
259 -e "resource.c_common.ocevent.test.*" \
260 -e "resource.c_common.ocrandom.test.*" \
261 -e "resource.c_common.oic_malloc.test.*" \
262 -e "resource.c_common.oic_time.test.*" \
263 -e "resource.csdk.connectivity.src.adapter_util.pkix.*" \
264 -e "resource.csdk.connectivity.src.adapter_util.caadapternetdtls.c" \
266 -e "resource.csdk.security.*" \
267 -e "resource.csdk.resource-directory.*" \
268 -e "resource.csdk.routing.*" \
269 ${report_flags} -o ${test_report_file}
271 if [ $? -eq 0 ]; then
272 echo -e "${GREEN}${module_name}${NO_COLOUR} Coverage Report Location: ${BLUE}${test_report_file}${NO_COLOUR}"
273 echo -e "${GREEN}${module_name}${NO_COLOUR} Report Generated ${GREEN}Successfully!${NO_COLOUR}"
275 echo -e "${RED}${module_name}${NO_COLOUR} Report Generation ${RED}Failed!${NO_COLOUR}"
282 if [ "yes" = ${USE_TIMESTAMP} ]; then
283 report_dir="${module_name}_${time_stamp}"
285 report_dir="${module_name}"
287 report_file="report.${report_format}"
289 test_report_dir="TestReport/${report_format}/${report_dir}"
290 test_report_file="${test_report_dir}/${report_file}"
292 rm -rf "${test_report_dir}"
293 mkdir -p "${test_report_dir}"
295 LD_LIBRARY_PATH="${IOTIVITY_BASE}/out/${IOTIVITY_TARGET_OS}/${IOTIVITY_TARGET_ARCH}/debug"
297 #Setting Proper Location for UnitTest XML report generation
298 unittest_report_dir="UnitTestReport/${report_dir}"
299 if [ "yes" = ${UNITTEST_XML_REPORT} ]; then
300 rm -rf "${unittest_report_dir}"
301 mkdir -p "${unittest_report_dir}"
302 UNITTEST_XML_REPORT_FLAG_PREFIX="--gtest_output=xml:${unittest_report_dir}"
306 "${IOTIVITY_BASE}/out/${IOTIVITY_TARGET_OS}/${IOTIVITY_TARGET_ARCH}/debug/service/easy-setup/enrollee/unittests/easysetup_enrollee_test"
307 "${IOTIVITY_BASE}/out/${IOTIVITY_TARGET_OS}/${IOTIVITY_TARGET_ARCH}/debug/service/easy-setup/mediator/richsdk/unittests/easysetup_mediator_test"
310 for exe in ${tests_list[@]}; do
311 filename=$(basename -- "${exe}")
312 if [ -n "${UNITTEST_XML_REPORT_FLAG_PREFIX}" ]; then
313 UNITTEST_XML_REPORT_FLAG="${UNITTEST_XML_REPORT_FLAG_PREFIX}/${filename}.xml"
315 eval "${exe} ${UNITTEST_XML_REPORT_FLAG}"
322 echo -e "Generating ${GREEN}${module_name}${NO_COLOUR} Reports"
324 # Printing Unit Test Report Location
325 if [ "yes" = ${UNITTEST_XML_REPORT} ]; then
326 echo -e "${GREEN}${module_name}${NO_COLOUR} UnitTest Report Location: ${BLUE}${unittest_report_dir}${NO_COLOUR}"
331 -e "examples.OICMiddle" \
333 -e "extlibs.hippomocks-master.*" \
334 -e "extlibs.rapidxml.*" \
338 -e "resource.csdk.connectivity.lib.*" \
339 -e "resource.csdk.connectivity.samples.linux.*" \
340 -e "resource.csdk.security.provisioning.ck_manager.sample.*" \
341 -e "resource.csdk.security.provisioning.ck_manager.unittest.*" \
342 -e "resource.csdk.connectivity.scr.bt_edr_adapter.*" \
343 -e "resource.csdk.connectivity.src.bt_le_adapter.*" \
344 -e "resource.csdk.connectivity.src.bt_edr_adapter.*" \
345 -e "resource.csdk.connectivity.test.*" \
346 -e "resource.csdk.logger.*" \
347 -e "resource.src.*" \
348 -e "resource.csdk.security.provisioning.include.*" \
349 -e "resource.csdk.security.provisioning.sample.*" \
350 -e "resource.csdk.security.provisioning.src.cloud.*" \
351 -e "resource.csdk.security.provisioning.unittest.*" \
352 -e "resource.csdk.security.unittest.*" \
353 -e "resource.csdk.stack.*" \
354 -e "resource.examples.*" \
355 -e "resource.unittests.*" \
356 -e "resource.include.*" \
357 -e "resource.oc_logger.*" \
358 -e "resource.provisioning.examples.*" \
359 -e "resource.provisioning.unittests.*" \
360 -e "resource.csdk.connectivity.common.src.logger.c.*" \
361 -e "resource.csdk.connectivity.common.src.oic_console_logger.c.*" \
362 -e "resource.csdk.connectivity.common.src.oic_logger.c.*" \
363 -e "service.resource-encapsulation.include.*" \
364 -e "service.resource-encapsulation.src.common.expiryTimer.*" \
365 -e "service.resource-encapsulation.src.common.primitiveResource.unittests.*" \
366 -e "service.resource-encapsulation.src.resourceBroker.unittest.*" \
367 -e "service.resource-encapsulation.src.resourceCache.unittest.*" \
368 -e "service.resource-encapsulation.src.serverBuilder.unittest.*" \
369 -e "service.resource-encapsulation.unittest.*" \
370 -e "service.resource-hosting.src.unittest.*" \
371 -e "service.resource-hosting.SampleApp.*" \
372 -e "service.things-manager.*" \
373 -e "service.notification.unittest.*" \
374 -e "service.easy-setup.unittest.*" \
375 -e "service.easy-setup.sample.*" \
376 -e "service.easy-setup.mediator.csdk.unittests.*" \
377 -e "service.easy-setup.mediator.richsdk.unittests.*" \
378 -e "service.easy-setup.enrollee.unittest.*" \
379 -e "service.easy-setup.mediator.richsdk.src.EnrolleeSecurity.cpp" \
380 -e "service.resource-container.examples.*" \
381 -e "service.resource-container.unittests." \
382 -e "service.resource-container.bundle-api." \
383 -e "service.resource-encapsulation.examples.*" \
384 -e "service.resource-encapsulation.src.common.primitiveResource.unittests." \
385 -e "service.resource-encapsulation.src.resourceBroker.unittest." \
386 -e "service.resource-encapsulation.src.resourceCache.unittest." \
387 -e "service.resource-encapsulation.src.serverBuilder.unittest." \
388 -e "service.resource-encapsulation.unittest." \
389 -e "service.resource-encapsulation.src.common.utils.*" \
390 -e "service.things-manager.sampleapp.*" \
391 -e "service.resource-hosting.unittest" \
392 -e "resource.c_common.oic_string.test.*" \
393 -e "service.notification.unittests.*" \
394 -e "service.notification.cpp-wrapper.unittest.*" \
395 -e "resource.c_common.*" \
396 -e "service.resource-directory.samples.*" \
397 -e "resource.csdk.security.src.*" \
398 -e "resource.csdk.connectivity.src.adapter_util.pkix.*" \
399 -e "resource.csdk.connectivity.src.adapter_util.caadapternetdtls.c" \
400 -e "service.scene-manager.sampleapp.*" \
401 -e "service.scene-manager.unittests.*" \
402 -e "service.coap-http-proxy.unittests.*" \
404 -e "service.notification.*" \
405 -e "service.resource-encapsulation.*" \
406 -e "service.scene-manager.*" \
407 -e "service.coap-http-proxy.*" \
408 ${report_flags} -o ${test_report_file}
410 if [ $? -eq 0 ]; then
411 echo -e "${GREEN}${module_name}${NO_COLOUR} Coverage Report Location: ${BLUE}${test_report_file}${NO_COLOUR}"
412 echo -e "${GREEN}${module_name}${NO_COLOUR} Report Generated ${GREEN}Successfully!${NO_COLOUR}"
414 echo -e "${RED}${module_name}${NO_COLOUR} Report Generation ${RED}Failed!${NO_COLOUR}"
421 if [ "yes" = ${USE_TIMESTAMP} ]; then
422 report_dir="${module_name}_${time_stamp}"
424 report_dir="${module_name}"
426 report_file="report.${report_format}"
427 test_report_dir="TestReport/${report_format}/${report_dir}"
428 test_report_file="${test_report_dir}/${report_file}"
430 rm -rf "${test_report_dir}"
431 mkdir -p "${test_report_dir}"
433 LD_LIBRARY_PATH="${IOTIVITY_BASE}/out/${IOTIVITY_TARGET_OS}/${IOTIVITY_TARGET_ARCH}/debug"
435 #Setting Proper Location for UnitTest XML report generation
436 unittest_report_dir="UnitTestReport/${report_dir}"
437 if [ "yes" = ${UNITTEST_XML_REPORT} ]; then
438 rm -rf "${unittest_report_dir}"
439 mkdir -p "${unittest_report_dir}"
440 UNITTEST_XML_REPORT_FLAG_PREFIX="--gtest_output=xml:${unittest_report_dir}"
444 "${IOTIVITY_BASE}/out/${IOTIVITY_TARGET_OS}/${IOTIVITY_TARGET_ARCH}/debug/service/resource-encapsulation/src/serverBuilder/rcs_server_test"
445 "${IOTIVITY_BASE}/out/${IOTIVITY_TARGET_OS}/${IOTIVITY_TARGET_ARCH}/debug/service/resource-encapsulation/src/common/rcs_common_test"
446 "${IOTIVITY_BASE}/out/${IOTIVITY_TARGET_OS}/${IOTIVITY_TARGET_ARCH}/debug/service/resource-encapsulation/unittests/rcs_client_test"
447 "${IOTIVITY_BASE}/out/${IOTIVITY_TARGET_OS}/${IOTIVITY_TARGET_ARCH}/debug/service/resource-encapsulation/src/resourceCache/unittests/cache_test"
448 "${IOTIVITY_BASE}/out/${IOTIVITY_TARGET_OS}/${IOTIVITY_TARGET_ARCH}/debug/service/resource-encapsulation/src/resourceBroker/unittest/broker_test"
451 for exe in ${tests_list[@]}; do
452 filename=$(basename -- "${exe}")
453 if [ -n "${UNITTEST_XML_REPORT_FLAG_PREFIX}" ]; then
454 UNITTEST_XML_REPORT_FLAG="${UNITTEST_XML_REPORT_FLAG_PREFIX}/${filename}.xml"
456 eval "${exe} ${UNITTEST_XML_REPORT_FLAG}"
463 echo -e "Generating ${GREEN}${module_name}${NO_COLOUR} Reports"
465 # Printing Unit Test Report Location
466 if [ "yes" = ${UNITTEST_XML_REPORT} ]; then
467 echo -e "${GREEN}${module_name}${NO_COLOUR} UnitTest Report Location: ${BLUE}${unittest_report_dir}${NO_COLOUR}"
472 -e "examples.OICMiddle" \
474 -e "extlibs.hippomocks-master.*" \
475 -e "extlibs.rapidxml.*" \
479 -e "resource.csdk.connectivity.lib.*" \
480 -e "resource.csdk.connectivity.samples.linux.*" \
481 -e "resource.csdk.security.provisioning.ck_manager.sample.*" \
482 -e "resource.csdk.security.provisioning.ck_manager.unittest.*" \
483 -e "resource.csdk.connectivity.scr.bt_edr_adapter.*" \
484 -e "resource.csdk.connectivity.src.bt_le_adapter.*" \
485 -e "resource.csdk.connectivity.src.bt_edr_adapter.*" \
486 -e "resource.csdk.connectivity.test.*" \
487 -e "resource.csdk.logger.*" \
488 -e "resource.src.*" \
489 -e "resource.csdk.security.provisioning.include.*" \
490 -e "resource.csdk.security.provisioning.sample.*" \
491 -e "resource.csdk.security.provisioning.src.cloud.*" \
492 -e "resource.csdk.security.provisioning.unittest.*" \
493 -e "resource.csdk.security.unittest.*" \
494 -e "resource.csdk.stack.*" \
495 -e "resource.examples.*" \
496 -e "resource.unittests.*" \
497 -e "resource.include.*" \
498 -e "resource.oc_logger.*" \
499 -e "resource.provisioning.examples.*" \
500 -e "resource.provisioning.unittests.*" \
501 -e "resource.csdk.connectivity.common.src.logger.c.*" \
502 -e "resource.csdk.connectivity.common.src.oic_console_logger.c.*" \
503 -e "resource.csdk.connectivity.common.src.oic_logger.c.*" \
504 -e "service.resource-encapsulation.include.*" \
505 -e "service.resource-encapsulation.src.common.expiryTimer.*" \
506 -e "service.resource-encapsulation.src.common.primitiveResource.unittests.*" \
507 -e "service.resource-encapsulation.src.resourceBroker.unittest.*" \
508 -e "service.resource-encapsulation.src.resourceCache.unittest.*" \
509 -e "service.resource-encapsulation.src.serverBuilder.unittest.*" \
510 -e "service.resource-encapsulation.unittest.*" \
511 -e "service.resource-hosting.src.unittest.*" \
512 -e "service.resource-hosting.SampleApp.*" \
513 -e "service.things-manager.*" \
514 -e "service.notification.unittest.*" \
515 -e "service.easy-setup.unittest.*" \
516 -e "service.easy-setup.sample.*" \
517 -e "service.easy-setup.mediator.csdk.unittests.*" \
518 -e "service.easy-setup.mediator.richsdk.unittests.*" \
519 -e "service.easy-setup.enrollee.unittest.*" \
520 -e "service.resource-container.examples.*" \
521 -e "service.resource-container.unittests." \
522 -e "service.resource-container.bundle-api." \
523 -e "service.resource-encapsulation.examples.*" \
524 -e "service.resource-encapsulation.src.common.primitiveResource.unittests." \
525 -e "service.resource-encapsulation.src.resourceBroker.unittest." \
526 -e "service.resource-encapsulation.src.resourceCache.unittest." \
527 -e "service.resource-encapsulation.src.serverBuilder.unittest." \
528 -e "service.resource-encapsulation.unittest." \
529 -e "service.resource-encapsulation.src.common.utils.*" \
530 -e "service.things-manager.sampleapp.*" \
531 -e "service.resource-hosting.unittest" \
532 -e "resource.c_common.oic_string.test.*" \
533 -e "service.notification.unittests.*" \
534 -e "service.notification.cpp-wrapper.unittest.*" \
535 -e "resource.c_common.*" \
536 -e "service.resource-directory.samples.*" \
537 -e "resource.csdk.security.src.*" \
538 -e "resource.csdk.connectivity.src.adapter_util.pkix.*" \
539 -e "resource.csdk.connectivity.src.adapter_util.caadapternetdtls.c" \
540 -e "service.scene-manager.sampleapp.*" \
541 -e "service.scene-manager.unittests.*" \
542 -e "service.coap-http-proxy.unittests.*" \
544 -e "service.easy-setup.*" \
545 -e "service.notification.*" \
546 -e "service.scene-manager.*" \
547 -e "service.coap-http-proxy.*" \
548 ${report_flags} -o ${test_report_file}
550 if [ $? -eq 0 ]; then
551 echo -e "${GREEN}${module_name}${NO_COLOUR} Coverage Report Location: ${BLUE}${test_report_file}${NO_COLOUR}"
552 echo -e "${GREEN}${module_name}${NO_COLOUR} Report Generated ${GREEN}Successfully!${NO_COLOUR}"
554 echo -e "${RED}${module_name}${NO_COLOUR} Report Generation ${RED}Failed!${NO_COLOUR}"
561 if [ "yes" = ${USE_TIMESTAMP} ]; then
562 report_dir="${module_name}_${time_stamp}"
564 report_dir="${module_name}"
566 report_file="report.${report_format}"
567 test_report_dir="TestReport/${report_format}/${report_dir}"
568 test_report_file="${test_report_dir}/${report_file}"
570 rm -rf "${test_report_dir}"
571 mkdir -p "${test_report_dir}"
573 LD_LIBRARY_PATH="${IOTIVITY_BASE}/out/${IOTIVITY_TARGET_OS}/${IOTIVITY_TARGET_ARCH}/debug"
575 #Setting Proper Location for UnitTest XML report generation
576 unittest_report_dir="UnitTestReport/${report_dir}"
577 if [ "yes" = ${UNITTEST_XML_REPORT} ]; then
578 rm -rf "${unittest_report_dir}"
579 mkdir -p "${unittest_report_dir}"
580 UNITTEST_XML_REPORT_FLAG_PREFIX="--gtest_output=xml:${unittest_report_dir}"
584 "${IOTIVITY_BASE}/out/${IOTIVITY_TARGET_OS}/${IOTIVITY_TARGET_ARCH}/debug/service/scene-manager/unittests/remote_scene_action_test"
585 "${IOTIVITY_BASE}/out/${IOTIVITY_TARGET_OS}/${IOTIVITY_TARGET_ARCH}/debug/service/scene-manager/unittests/remote_scene_col_test"
586 "${IOTIVITY_BASE}/out/${IOTIVITY_TARGET_OS}/${IOTIVITY_TARGET_ARCH}/debug/service/scene-manager/unittests/remote_scene_list_test"
587 "${IOTIVITY_BASE}/out/${IOTIVITY_TARGET_OS}/${IOTIVITY_TARGET_ARCH}/debug/service/scene-manager/unittests/remote_scene_test"
588 "${IOTIVITY_BASE}/out/${IOTIVITY_TARGET_OS}/${IOTIVITY_TARGET_ARCH}/debug/service/scene-manager/unittests/scene_action_test"
589 "${IOTIVITY_BASE}/out/${IOTIVITY_TARGET_OS}/${IOTIVITY_TARGET_ARCH}/debug/service/scene-manager/unittests/scene_collection_test"
590 "${IOTIVITY_BASE}/out/${IOTIVITY_TARGET_OS}/${IOTIVITY_TARGET_ARCH}/debug/service/scene-manager/unittests/scene_list_test"
591 "${IOTIVITY_BASE}/out/${IOTIVITY_TARGET_OS}/${IOTIVITY_TARGET_ARCH}/debug/service/scene-manager/unittests/scene_test"
594 for exe in ${tests_list[@]}; do
595 filename=$(basename -- "${exe}")
596 if [ -n "${UNITTEST_XML_REPORT_FLAG_PREFIX}" ]; then
597 UNITTEST_XML_REPORT_FLAG="${UNITTEST_XML_REPORT_FLAG_PREFIX}/${filename}.xml"
599 eval "${exe} ${UNITTEST_XML_REPORT_FLAG}"
606 echo -e "Generating ${GREEN}${module_name}${NO_COLOUR} Reports"
608 # Printing Unit Test Report Location
609 if [ "yes" = ${UNITTEST_XML_REPORT} ]; then
610 echo -e "${GREEN}${module_name}${NO_COLOUR} UnitTest Report Location: ${BLUE}${unittest_report_dir}${NO_COLOUR}"
615 -e "examples.OICMiddle" \
617 -e "extlibs.hippomocks-master.*" \
618 -e "extlibs.rapidxml.*" \
621 -e "resource.csdk.connectivity.lib.*" \
622 -e "resource.csdk.connectivity.samples.linux.*" \
623 -e "resource.csdk.security.provisioning.ck_manager.sample.*" \
624 -e "resource.csdk.security.provisioning.ck_manager.unittest.*" \
625 -e "resource.csdk.connectivity.scr.bt_edr_adapter.*" \
626 -e "resource.csdk.connectivity.src.bt_le_adapter.*" \
627 -e "resource.csdk.connectivity.src.bt_edr_adapter.*" \
628 -e "resource.csdk.connectivity.test.*" \
629 -e "resource.csdk.logger.*" \
630 -e "resource.src.*" \
631 -e "resource.csdk.security.provisioning.include.*" \
632 -e "resource.csdk.security.provisioning.sample.*" \
633 -e "resource.csdk.security.provisioning.src.cloud.*" \
634 -e "resource.csdk.security.provisioning.unittest.*" \
635 -e "resource.csdk.security.unittest.*" \
636 -e "resource.csdk.stack.*" \
637 -e "resource.examples.*" \
638 -e "resource.unittests.*" \
639 -e "resource.include.*" \
640 -e "resource.oc_logger.*" \
641 -e "resource.provisioning.examples.*" \
642 -e "resource.provisioning.unittests.*" \
643 -e "resource.csdk.connectivity.common.src.logger.c.*" \
644 -e "resource.csdk.connectivity.common.src.oic_console_logger.c.*" \
645 -e "resource.csdk.connectivity.common.src.oic_logger.c.*" \
646 -e "service.resource-encapsulation.include.*" \
647 -e "service.resource-encapsulation.src.common.expiryTimer.*" \
648 -e "service.resource-encapsulation.src.common.primitiveResource.unittests.*" \
649 -e "service.resource-encapsulation.src.resourceBroker.unittest.*" \
650 -e "service.resource-encapsulation.src.resourceCache.unittest.*" \
651 -e "service.resource-encapsulation.src.serverBuilder.unittest.*" \
652 -e "service.resource-encapsulation.unittest.*" \
653 -e "service.resource-hosting.src.unittest.*" \
654 -e "service.resource-hosting.SampleApp.*" \
655 -e "service.things-manager.*" \
656 -e "service.notification.unittest.*" \
657 -e "service.easy-setup.unittest.*" \
658 -e "service.easy-setup.sample.*" \
659 -e "service.easy-setup.mediator.csdk.unittests.*" \
660 -e "service.easy-setup.mediator.richsdk.unittests.*" \
661 -e "service.easy-setup.enrollee.unittest.*" \
662 -e "service.resource-container.examples.*" \
663 -e "service.resource-container.unittests." \
664 -e "service.resource-container.bundle-api." \
665 -e "service.resource-encapsulation.examples.*" \
666 -e "service.resource-encapsulation.src.common.primitiveResource.unittests." \
667 -e "service.resource-encapsulation.src.resourceBroker.unittest." \
668 -e "service.resource-encapsulation.src.resourceCache.unittest." \
669 -e "service.resource-encapsulation.src.serverBuilder.unittest." \
670 -e "service.resource-encapsulation.unittest." \
671 -e "service.resource-encapsulation.src.common.utils.*" \
672 -e "service.things-manager.sampleapp.*" \
673 -e "service.resource-hosting.unittest" \
674 -e "resource.c_common.oic_string.test.*" \
675 -e "service.notification.unittests.*" \
676 -e "service.notification.cpp-wrapper.unittest.*" \
677 -e "resource.c_common.*" \
678 -e "service.resource-directory.samples.*" \
679 -e "resource.csdk.security.src.*" \
680 -e "resource.csdk.connectivity.src.adapter_util.pkix.*" \
681 -e "resource.csdk.connectivity.src.adapter_util.caadapternetdtls.c" \
682 -e "service.scene-manager.sampleapp.*" \
683 -e "service.scene-manager.unittests.*" \
684 -e "service.coap-http-proxy.unittests.*" \
686 -e "service.easy-setup.*" \
687 -e "service.notification.*" \
688 -e "service.resource-encapsulation.*" \
689 -e "service.coap-http-proxy.*" \
690 ${report_flags} -o ${test_report_file}
692 if [ $? -eq 0 ]; then
693 echo -e "${GREEN}${module_name}${NO_COLOUR} Coverage Report Location: ${BLUE}${test_report_file}${NO_COLOUR}"
694 echo -e "${GREEN}${module_name}${NO_COLOUR} Report Generated ${GREEN}Successfully!${NO_COLOUR}"
696 echo -e "${RED}${module_name}${NO_COLOUR} Report Generation ${RED}Failed!${NO_COLOUR}"
703 if [ "yes" = ${USE_TIMESTAMP} ]; then
704 report_dir="${module_name}_${time_stamp}"
706 report_dir="${module_name}"
708 report_file="report.${report_format}"
709 test_report_dir="TestReport/${report_format}/${report_dir}"
710 test_report_file="${test_report_dir}/${report_file}"
712 rm -rf "${test_report_dir}"
713 mkdir -p "${test_report_dir}"
715 LD_LIBRARY_PATH="${IOTIVITY_BASE}/out/${IOTIVITY_TARGET_OS}/${IOTIVITY_TARGET_ARCH}/debug"
717 #Setting Proper Location for UnitTest XML report generation
718 unittest_report_dir="UnitTestReport/${report_dir}"
719 if [ "yes" = ${UNITTEST_XML_REPORT} ]; then
720 rm -rf "${unittest_report_dir}"
721 mkdir -p "${unittest_report_dir}"
722 UNITTEST_XML_REPORT_FLAG_PREFIX="--gtest_output=xml:${unittest_report_dir}"
726 "${IOTIVITY_BASE}/out/${IOTIVITY_TARGET_OS}/${IOTIVITY_TARGET_ARCH}/debug/service/notification/unittest/notification_consumer_test"
727 "${IOTIVITY_BASE}/out/${IOTIVITY_TARGET_OS}/${IOTIVITY_TARGET_ARCH}/debug/service/notification/cpp-wrapper/unittest/notification_consumer_wrapper_test"
728 # "${IOTIVITY_BASE}/out/${IOTIVITY_TARGET_OS}/${IOTIVITY_TARGET_ARCH}/debug/service/notification/unittest/notification_provider_test"
729 # "${IOTIVITY_BASE}/out/${IOTIVITY_TARGET_OS}/${IOTIVITY_TARGET_ARCH}/debug/service/notification/cpp-wrapper/unittest/notification_provider_wrapper_test"
732 for exe in ${tests_list[@]}; do
733 filename=$(basename -- "${exe}")
734 if [ -n "${UNITTEST_XML_REPORT_FLAG_PREFIX}" ]; then
735 UNITTEST_XML_REPORT_FLAG="${UNITTEST_XML_REPORT_FLAG_PREFIX}/${filename}.xml"
737 eval "${exe} ${UNITTEST_XML_REPORT_FLAG}"
744 echo -e "Generating ${GREEN}${module_name}${NO_COLOUR} Reports"
746 # Printing Unit Test Report Location
747 if [ "yes" = ${UNITTEST_XML_REPORT} ]; then
748 echo -e "${GREEN}${module_name}${NO_COLOUR} UnitTest Report Location: ${BLUE}${unittest_report_dir}${NO_COLOUR}"
753 -e "examples.OICMiddle" \
755 -e "extlibs.hippomocks-master.*" \
756 -e "extlibs.rapidxml.*" \
759 -e "resource.csdk.connectivity.lib.*" \
760 -e "resource.csdk.connectivity.samples.linux.*" \
761 -e "resource.csdk.security.provisioning.ck_manager.sample.*" \
762 -e "resource.csdk.security.provisioning.ck_manager.unittest.*" \
763 -e "resource.csdk.connectivity.scr.bt_edr_adapter.*" \
764 -e "resource.csdk.connectivity.src.bt_le_adapter.*" \
765 -e "resource.csdk.connectivity.src.bt_edr_adapter.*" \
766 -e "resource.csdk.connectivity.test.*" \
767 -e "resource.csdk.logger.*" \
768 -e "resource.src.*" \
769 -e "resource.csdk.security.provisioning.include.*" \
770 -e "resource.csdk.security.provisioning.sample.*" \
771 -e "resource.csdk.security.provisioning.src.cloud.*" \
772 -e "resource.csdk.security.provisioning.unittest.*" \
773 -e "resource.csdk.security.unittest.*" \
774 -e "resource.csdk.stack.*" \
775 -e "resource.examples.*" \
776 -e "resource.unittests.*" \
777 -e "resource.include.*" \
778 -e "resource.oc_logger.*" \
779 -e "resource.provisioning.examples.*" \
780 -e "resource.provisioning.unittests.*" \
781 -e "resource.csdk.connectivity.common.src.logger.c.*" \
782 -e "resource.csdk.connectivity.common.src.oic_console_logger.c.*" \
783 -e "resource.csdk.connectivity.common.src.oic_logger.c.*" \
784 -e "service.resource-encapsulation.include.*" \
785 -e "service.resource-encapsulation.src.common.expiryTimer.*" \
786 -e "service.resource-encapsulation.src.common.primitiveResource.unittests.*" \
787 -e "service.resource-encapsulation.src.resourceBroker.unittest.*" \
788 -e "service.resource-encapsulation.src.resourceCache.unittest.*" \
789 -e "service.resource-encapsulation.src.serverBuilder.unittest.*" \
790 -e "service.resource-encapsulation.unittest.*" \
791 -e "service.resource-hosting.src.unittest.*" \
792 -e "service.resource-hosting.SampleApp.*" \
793 -e "service.things-manager.*" \
794 -e "service.notification.unittest.*" \
795 -e "service.easy-setup.unittest.*" \
796 -e "service.easy-setup.sample.*" \
797 -e "service.easy-setup.mediator.csdk.unittests.*" \
798 -e "service.easy-setup.mediator.richsdk.unittests.*" \
799 -e "service.easy-setup.enrollee.unittest.*" \
800 -e "service.resource-container.examples.*" \
801 -e "service.resource-container.unittests." \
802 -e "service.resource-container.bundle-api." \
803 -e "service.resource-encapsulation.examples.*" \
804 -e "service.resource-encapsulation.src.common.primitiveResource.unittests." \
805 -e "service.resource-encapsulation.src.resourceBroker.unittest." \
806 -e "service.resource-encapsulation.src.resourceCache.unittest." \
807 -e "service.resource-encapsulation.src.serverBuilder.unittest." \
808 -e "service.resource-encapsulation.unittest." \
809 -e "service.resource-encapsulation.src.common.utils.*" \
810 -e "service.things-manager.sampleapp.*" \
811 -e "service.resource-hosting.unittest" \
812 -e "resource.c_common.oic_string.test.*" \
813 -e "service.notification.unittests.*" \
814 -e "service.notification.cpp-wrapper.unittest.*" \
815 -e "resource.c_common.*" \
816 -e "service.resource-directory.samples.*" \
817 -e "resource.csdk.security.src.*" \
818 -e "resource.csdk.connectivity.src.adapter_util.pkix.*" \
819 -e "resource.csdk.connectivity.src.adapter_util.caadapternetdtls.c" \
820 -e "service.scene-manager.sampleapp.*" \
821 -e "service.scene-manager.unittests.*" \
822 -e "service.coap-http-proxy.unittests.*" \
824 -e "service.easy-setup.*" \
825 -e "service.resource-encapsulation.*" \
826 -e "service.scene-manager.*" \
827 -e "service.coap-http-proxy.*" \
828 -e "service.notification.cpp-wrapper.provider.inc.*" \
829 -e "service.notification.cpp-wrapper.consumer.inc.*" \
830 ${report_flags} -o ${test_report_file}
832 if [ $? -eq 0 ]; then
833 echo -e "${GREEN}${module_name}${NO_COLOUR} Coverage Report Location: ${BLUE}${test_report_file}${NO_COLOUR}"
834 echo -e "${GREEN}${module_name}${NO_COLOUR} Report Generated ${GREEN}Successfully!${NO_COLOUR}"
836 echo -e "${RED}${module_name}${NO_COLOUR} Report Generation ${RED}Failed!${NO_COLOUR}"
840 generate_report_CHP()
843 if [ "yes" = ${USE_TIMESTAMP} ]; then
844 report_dir="${module_name}_${time_stamp}"
846 report_dir="${module_name}"
849 report_file="report.${report_format}"
850 test_report_dir="TestReport/${report_format}/${report_dir}"
851 test_report_file="${test_report_dir}/${report_file}"
853 rm -rf "${test_report_dir}"
854 mkdir -p "${test_report_dir}"
856 LD_LIBRARY_PATH="${IOTIVITY_BASE}/out/${IOTIVITY_TARGET_OS}/${IOTIVITY_TARGET_ARCH}/debug"
858 #Setting Proper Location for UnitTest XML report generation
859 unittest_report_dir="UnitTestReport/${report_dir}"
860 if [ "yes" = ${UNITTEST_XML_REPORT} ]; then
861 rm -rf "${unittest_report_dir}"
862 mkdir -p "${unittest_report_dir}"
863 UNITTEST_XML_REPORT_FLAG_PREFIX="--gtest_output=xml:${unittest_report_dir}"
867 "${IOTIVITY_BASE}/out/${IOTIVITY_TARGET_OS}/${IOTIVITY_TARGET_ARCH}/debug/service/coap-http-proxy/unittests/CoAP_unit_test"
870 for exe in ${tests_list[@]}; do
871 filename=$(basename -- "${exe}")
872 if [ -n "${UNITTEST_XML_REPORT_FLAG_PREFIX}" ]; then
873 UNITTEST_XML_REPORT_FLAG="${UNITTEST_XML_REPORT_FLAG_PREFIX}/${filename}.xml"
875 eval "${exe} ${UNITTEST_XML_REPORT_FLAG}"
882 echo -e "Generating ${GREEN}${module_name}${NO_COLOUR} Reports"
884 # Printing Unit Test Report Location
885 if [ "yes" = ${UNITTEST_XML_REPORT} ]; then
886 echo -e "${GREEN}${module_name}${NO_COLOUR} UnitTest Report Location: ${BLUE}${unittest_report_dir}${NO_COLOUR}"
891 -e "examples.OICMiddle" \
893 -e "extlibs.hippomocks-master.*" \
894 -e "extlibs.rapidxml.*" \
897 -e "resource.csdk.connectivity.lib.*" \
898 -e "resource.csdk.connectivity.samples.linux.*" \
899 -e "resource.csdk.security.provisioning.ck_manager.sample.*" \
900 -e "resource.csdk.security.provisioning.ck_manager.unittest.*" \
901 -e "resource.csdk.connectivity.scr.bt_edr_adapter.*" \
902 -e "resource.csdk.connectivity.src.bt_le_adapter.*" \
903 -e "resource.csdk.connectivity.src.bt_edr_adapter.*" \
904 -e "resource.csdk.connectivity.test.*" \
905 -e "resource.csdk.logger.*" \
906 -e "resource.src.*" \
907 -e "resource.csdk.security.provisioning.include.*" \
908 -e "resource.csdk.security.provisioning.sample.*" \
909 -e "resource.csdk.security.provisioning.src.cloud.*" \
910 -e "resource.csdk.security.provisioning.unittest.*" \
911 -e "resource.csdk.security.unittest.*" \
912 -e "resource.csdk.stack.*" \
913 -e "resource.examples.*" \
914 -e "resource.unittests.*" \
915 -e "resource.include.*" \
916 -e "resource.oc_logger.*" \
917 -e "resource.provisioning.examples.*" \
918 -e "resource.provisioning.unittests.*" \
919 -e "resource.csdk.connectivity.common.src.logger.c.*" \
920 -e "resource.csdk.connectivity.common.src.oic_console_logger.c.*" \
921 -e "resource.csdk.connectivity.common.src.oic_logger.c.*" \
922 -e "service.resource-encapsulation.include.*" \
923 -e "service.resource-encapsulation.src.common.expiryTimer.*" \
924 -e "service.resource-encapsulation.src.common.primitiveResource.unittests.*" \
925 -e "service.resource-encapsulation.src.resourceBroker.unittest.*" \
926 -e "service.resource-encapsulation.src.resourceCache.unittest.*" \
927 -e "service.resource-encapsulation.src.serverBuilder.unittest.*" \
928 -e "service.resource-encapsulation.unittest.*" \
929 -e "service.resource-hosting.src.unittest.*" \
930 -e "service.resource-hosting.SampleApp.*" \
931 -e "service.things-manager.*" \
932 -e "service.notification.unittest.*" \
933 -e "service.easy-setup.unittest.*" \
934 -e "service.easy-setup.sample.*" \
935 -e "service.easy-setup.mediator.csdk.unittests.*" \
936 -e "service.easy-setup.mediator.richsdk.unittests.*" \
937 -e "service.easy-setup.enrollee.unittest.*" \
938 -e "service.resource-container.examples.*" \
939 -e "service.resource-container.unittests." \
940 -e "service.resource-container.bundle-api." \
941 -e "service.resource-encapsulation.examples.*" \
942 -e "service.resource-encapsulation.src.common.primitiveResource.unittests." \
943 -e "service.resource-encapsulation.src.resourceBroker.unittest." \
944 -e "service.resource-encapsulation.src.resourceCache.unittest." \
945 -e "service.resource-encapsulation.src.serverBuilder.unittest." \
946 -e "service.resource-encapsulation.unittest." \
947 -e "service.resource-encapsulation.src.common.utils.*" \
948 -e "service.things-manager.sampleapp.*" \
949 -e "service.resource-hosting.unittest" \
950 -e "resource.c_common.oic_string.test.*" \
951 -e "service.notification.unittests.*" \
952 -e "service.notification.cpp-wrapper.unittest.*" \
953 -e "resource.c_common.*" \
954 -e "service.resource-directory.samples.*" \
955 -e "resource.csdk.security.src.*" \
956 -e "resource.csdk.connectivity.src.adapter_util.pkix.*" \
957 -e "resource.csdk.connectivity.src.adapter_util.caadapternetdtls.c" \
958 -e "service.scene-manager.sampleapp.*" \
959 -e "service.scene-manager.unittests.*" \
960 -e "service.coap-http-proxy.unittests.*" \
962 -e "service.easy-setup.*" \
963 -e "service.notification.*" \
964 -e "service.resource-encapsulation.*" \
965 -e "service.scene-manager.*" \
966 ${report_flags} -o ${test_report_file}
968 if [ $? -eq 0 ]; then
969 echo -e "${GREEN}${module_name}${NO_COLOUR} Coverage Report Location: ${BLUE}${test_report_file}${NO_COLOUR}"
970 echo -e "${GREEN}${module_name}${NO_COLOUR} Report Generated ${GREEN}Successfully!${NO_COLOUR}"
972 echo -e "${RED}${module_name}${NO_COLOUR} Report Generation ${RED}Failed!${NO_COLOUR}"
978 case ${module_name} in
1014 process_cmd_args "$@"