From 4a7fc7ade67b71fc73baba9ab294a450fbe2a6e2 Mon Sep 17 00:00:00 2001 From: gichan Date: Wed, 21 Dec 2022 19:35:15 +0900 Subject: [PATCH] [lcov] Change directory before generate html result. After gcno files path was changed from the absolute path to the relative path, the codes of coverage were not properly displayed. Change the build directory before generating the html result. Signed-off-by: gichan --- packaging/machine-learning-api.spec | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packaging/machine-learning-api.spec b/packaging/machine-learning-api.spec index 8be83af..8347ca7 100644 --- a/packaging/machine-learning-api.spec +++ b/packaging/machine-learning-api.spec @@ -404,6 +404,7 @@ find . -name "CMakeCXXCompilerId*.gcda" -delete # Generate report # TODO: the --no-external option is removed to include machine-learning-agent related source files. # Restore this option when there is proper way to include those source files. +pushd build lcov -t 'ML API unittest coverage' -o unittest.info -c -d . -b $(pwd) # Exclude generated files (e.g., Orc, Protobuf) and device-dependent files. # Exclude files which are generated by gdbus-codegen and external files in /usr/*. @@ -413,6 +414,7 @@ genhtml -o result unittest-filtered.info -t "ML API %{version}-%{release} ${VCS} mkdir -p %{buildroot}%{_datadir}/ml-api/unittest/ cp -r result %{buildroot}%{_datadir}/ml-api/unittest/ +popd %if 0%{?gcov:1} builddir=$(basename $PWD) -- 2.7.4