From c0ca1cd20cfd61e9199140f0af88b0bc25139534 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=EC=9D=B4=EC=B6=98=EC=84=9D/=EB=8F=99=EC=9E=91=EC=A0=9C?= =?utf8?q?=EC=96=B4Lab=28SR=29/Senior=20Engineer/=EC=82=BC=EC=84=B1?= =?utf8?q?=EC=A0=84=EC=9E=90?= Date: Fri, 11 May 2018 09:37:41 +0900 Subject: [PATCH] Add gcov data pulling (#1155) 1. tizen_xu4_test.sh supports gcov data pulling from xu4 tizen. 2. clean up test dir before testing Signed-off-by: Chunseok Lee --- scripts/command/tizen_xu4_test.sh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/scripts/command/tizen_xu4_test.sh b/scripts/command/tizen_xu4_test.sh index bfebc35..a150071 100755 --- a/scripts/command/tizen_xu4_test.sh +++ b/scripts/command/tizen_xu4_test.sh @@ -15,12 +15,16 @@ function Usage() echo "--unittest : run unittest" echo "--verification : run verification" echo "--framework : run framework" + echo "--gcov-dir : directory to save gcov files" } function prepare_rpm_test() { echo "======= Test with rpm packages(gbs build) =======" + # clean up + $SDB_CMD shell rm -rf $TEST_ROOT + $SDB_CMD shell mkdir -p $TEST_ROOT # install nnfw nnfw-test rpms for file in $RPM_DIR/* do @@ -40,6 +44,10 @@ function prepare_rpm_test() function prepare_suite_test() { echo "======= Test with test-suite(cross build) =======" + # clean up + $SDB_CMD shell rm -rf $TEST_ROOT + $SDB_CMD shell mkdir -p $TEST_ROOT + # install test-suite $SDB_CMD push $TEST_SUITE_PATH $TEST_ROOT/$(basename $TEST_SUITE_PATH) $SDB_CMD shell tar -zxf $TEST_ROOT/$(basename $TEST_SUITE_PATH) -C $TEST_ROOT @@ -77,6 +85,9 @@ do --framework) FRAMEWORK=on ;; + --gcov-dir=*) + GCOV_DIR=${i#*=} + ;; esac shift done @@ -133,3 +144,12 @@ if [ "$VERIFICATION" == "on" ]; then $SDB_CMD shell $TEST_ROOT/tools/test_driver/test_driver.sh --verification --artifactpath=$TEST_ROOT fi +# pull gcov files +if [ -n "$GCOV_DIR" ]; then + $SDB_CMD shell 'rm -rf /home/gcov && mkdir -p /home/gcov' + $SDB_CMD shell 'find / -type f \( -iname "*.gcda" -or -iname "*.gcno" \) -exec cp {} /home/gcov/. \;' + $SDB_CMD shell 'cd /home/ && tar -zcvf gcov.tar.gz ./gcov ' + cd $GCOV_DIR + sdb pull /home/gcov.tar.gz + tar -zxvf gcov.tar.gz +fi -- 2.7.4