[Coverage] Fix coverage report's version
authorDongju Chae <dongju.chae@samsung.com>
Mon, 7 Jun 2021 10:26:55 +0000 (19:26 +0900)
committer채동주/On-Device Lab(SR)/Staff Engineer/삼성전자 <dongju.chae@samsung.com>
Wed, 9 Jun 2021 01:20:58 +0000 (10:20 +0900)
This patch fixes the version of coverage report.

Signed-off-by: Dongju Chae <dongju.chae@samsung.com>
utils/coverage/coverage.sh

index ef0bfd8..21ceea9 100755 (executable)
@@ -23,6 +23,9 @@ export PKG_CONFIG_PATH=${INSTALL_PREFIX}/lib/pkgconfig
 pushd $UTIL_HOME
 pushd $SOURCE_ROOT
 
+VERSION=`cat packaging/npu-engine.spec | grep Version | awk '{print $2}'`
+COMMIT=`git rev-parse HEAD`
+
 rm -rf build
 
 # 1. build project
@@ -64,7 +67,7 @@ rm -rf sample_models
 if [[ $1 == "gcovr" ]];
 then
   gcovr -r .. --html --html-details \
-    --html-title "NPU SystemService Coverage" \
+    --html-title "npu-engine v${VERSION}-${COMMIT}" \
     --filter ../src/ --exclude ".*\.h" \
     --exclude ../src/core/npu/NPUdrvAPI_triv2.cc \
     -o index.html
@@ -73,7 +76,7 @@ else
   popd
   lcov -t 'NPU-Engine Unit Test Coverage' -o unittest.info -c -d . -b build --no-external
   lcov -r unittest.info "*/tests/*" "*/NPUdrvAPI_triv2.cc" -o unittest-filtered.info
-  genhtml -o coverage_result unittest-filtered.info -t "npu-engine 2.3.8" -p $PWD
+  genhtml -o coverage_result unittest-filtered.info -t "npu-engine v${VERSION}-${COMMIT}" -p $PWD
 fi
 
 popd