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/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"
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"
218 eval "${exe} ${UNITTEST_XML_REPORT_FLAG}"
225 echo -e "Generating ${GREEN}${module_name}${NO_COLOUR} Reports"
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}"
234 -e "examples.OICMiddle" \
236 -e "extlibs.hippomocks-master.*" \
237 -e "extlibs.rapidxml.*" \
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" \
264 -e "resource.csdk.security.*" \
265 -e "resource.csdk.resource-directory.*" \
266 -e "resource.csdk.routing.*" \
267 ${report_flags} -o ${test_report_file}
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}"
273 echo -e "${RED}${module_name}${NO_COLOUR} Report Generation ${RED}Failed!${NO_COLOUR}"
280 if [ "yes" = ${USE_TIMESTAMP} ]; then
281 report_dir="${module_name}_${time_stamp}"
283 report_dir="${module_name}"
285 report_file="report.${report_format}"
287 test_report_dir="TestReport/${report_format}/${report_dir}"
288 test_report_file="${test_report_dir}/${report_file}"
290 rm -rf "${test_report_dir}"
291 mkdir -p "${test_report_dir}"
293 LD_LIBRARY_PATH="${IOTIVITY_BASE}/out/${IOTIVITY_TARGET_OS}/${IOTIVITY_TARGET_ARCH}/debug"
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}"
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"
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"
313 eval "${exe} ${UNITTEST_XML_REPORT_FLAG}"
320 echo -e "Generating ${GREEN}${module_name}${NO_COLOUR} Reports"
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}"
329 -e "examples.OICMiddle" \
331 -e "extlibs.hippomocks-master.*" \
332 -e "extlibs.rapidxml.*" \
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.*" \
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}
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}"
412 echo -e "${RED}${module_name}${NO_COLOUR} Report Generation ${RED}Failed!${NO_COLOUR}"
419 if [ "yes" = ${USE_TIMESTAMP} ]; then
420 report_dir="${module_name}_${time_stamp}"
422 report_dir="${module_name}"
424 report_file="report.${report_format}"
425 test_report_dir="TestReport/${report_format}/${report_dir}"
426 test_report_file="${test_report_dir}/${report_file}"
428 rm -rf "${test_report_dir}"
429 mkdir -p "${test_report_dir}"
431 LD_LIBRARY_PATH="${IOTIVITY_BASE}/out/${IOTIVITY_TARGET_OS}/${IOTIVITY_TARGET_ARCH}/debug"
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}"
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"
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"
454 eval "${exe} ${UNITTEST_XML_REPORT_FLAG}"
461 echo -e "Generating ${GREEN}${module_name}${NO_COLOUR} Reports"
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}"
470 -e "examples.OICMiddle" \
472 -e "extlibs.hippomocks-master.*" \
473 -e "extlibs.rapidxml.*" \
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.*" \
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}
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}"
552 echo -e "${RED}${module_name}${NO_COLOUR} Report Generation ${RED}Failed!${NO_COLOUR}"
559 if [ "yes" = ${USE_TIMESTAMP} ]; then
560 report_dir="${module_name}_${time_stamp}"
562 report_dir="${module_name}"
564 report_file="report.${report_format}"
565 test_report_dir="TestReport/${report_format}/${report_dir}"
566 test_report_file="${test_report_dir}/${report_file}"
568 rm -rf "${test_report_dir}"
569 mkdir -p "${test_report_dir}"
571 LD_LIBRARY_PATH="${IOTIVITY_BASE}/out/${IOTIVITY_TARGET_OS}/${IOTIVITY_TARGET_ARCH}/debug"
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}"
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"
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"
597 eval "${exe} ${UNITTEST_XML_REPORT_FLAG}"
604 echo -e "Generating ${GREEN}${module_name}${NO_COLOUR} Reports"
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}"
613 -e "examples.OICMiddle" \
615 -e "extlibs.hippomocks-master.*" \
616 -e "extlibs.rapidxml.*" \
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.*" \
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}
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}"
694 echo -e "${RED}${module_name}${NO_COLOUR} Report Generation ${RED}Failed!${NO_COLOUR}"
701 if [ "yes" = ${USE_TIMESTAMP} ]; then
702 report_dir="${module_name}_${time_stamp}"
704 report_dir="${module_name}"
706 report_file="report.${report_format}"
707 test_report_dir="TestReport/${report_format}/${report_dir}"
708 test_report_file="${test_report_dir}/${report_file}"
710 rm -rf "${test_report_dir}"
711 mkdir -p "${test_report_dir}"
713 LD_LIBRARY_PATH="${IOTIVITY_BASE}/out/${IOTIVITY_TARGET_OS}/${IOTIVITY_TARGET_ARCH}/debug"
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}"
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"
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"
735 eval "${exe} ${UNITTEST_XML_REPORT_FLAG}"
742 echo -e "Generating ${GREEN}${module_name}${NO_COLOUR} Reports"
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}"
751 -e "examples.OICMiddle" \
753 -e "extlibs.hippomocks-master.*" \
754 -e "extlibs.rapidxml.*" \
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.*" \
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}
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}"
834 echo -e "${RED}${module_name}${NO_COLOUR} Report Generation ${RED}Failed!${NO_COLOUR}"
838 generate_report_CHP()
841 if [ "yes" = ${USE_TIMESTAMP} ]; then
842 report_dir="${module_name}_${time_stamp}"
844 report_dir="${module_name}"
847 report_file="report.${report_format}"
848 test_report_dir="TestReport/${report_format}/${report_dir}"
849 test_report_file="${test_report_dir}/${report_file}"
851 rm -rf "${test_report_dir}"
852 mkdir -p "${test_report_dir}"
854 LD_LIBRARY_PATH="${IOTIVITY_BASE}/out/${IOTIVITY_TARGET_OS}/${IOTIVITY_TARGET_ARCH}/debug"
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}"
865 "${IOTIVITY_BASE}/out/${IOTIVITY_TARGET_OS}/${IOTIVITY_TARGET_ARCH}/debug/service/coap-http-proxy/unittests/CoAP_unit_test"
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"
873 eval "${exe} ${UNITTEST_XML_REPORT_FLAG}"
880 echo -e "Generating ${GREEN}${module_name}${NO_COLOUR} Reports"
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}"
889 -e "examples.OICMiddle" \
891 -e "extlibs.hippomocks-master.*" \
892 -e "extlibs.rapidxml.*" \
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.*" \
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}
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}"
970 echo -e "${RED}${module_name}${NO_COLOUR} Report Generation ${RED}Failed!${NO_COLOUR}"
976 case ${module_name} in
1012 process_cmd_args "$@"