/doxygen-doc/
/run-tests.sh
/testrunner
+*.gcov
+*.gcda
+*.gcno
.tox
docs/_build/
*.log
test: testrunner
./run-tests.sh
+if ENABLE_GCOV
+AM_CXXFLAGS= -O0 --coverage
+AM_LDFLAGS= --coverage
+
+test_gcov: test
+ @for p in src/.libs/*.o src/redis/.libs/*.o; do \
+ gcov -abcfru $$p 1>/dev/null; \
+ done
+ mkdir -p @GCOV_REPORT_DIR@
+ mv *.gcov @GCOV_REPORT_DIR@
+ ls -la @GCOV_REPORT_DIR@
+endif
+
clean-local:
rm -f libsdl.pc
+if ENABLE_GCOV
+ rm -rf @GCOV_REPORT_DIR@
+ @find . -name '*.gcno' -o -name '*.gcda'| xargs -r rm
+endif
@DX_RULES@
make testrunner
./testrunner --help
+## Running unit tests with gcov
+
+Enable unit test gcov code coverage analysis by configuring gcov reporting
+directory:
+
+ configure --with-gcov-report-dir=DIR
+
+Directory can be an absolute path or a relative path to an SDL source root.
+Unit test build creates directory if it does not exist.
+
+Build and run unit tests with code coverage analysis:
+
+ make test_gcov
+
+After successful unit test run code coverage (.gcov) result files are in
+a directory, what was defined by '--with-gcov-report-dir' configure option.
+
+In addition, graphical gcov front-ends such as lcov can be used for coverage
+analysis:
+
+ lcov --directory tst/ --directory src --capture --output-file coverage.info
+ genhtml coverage.info --output-directory out
+
+Open the out/index.html using any web browser.
+
## Using SDL in application pod
SDL is not yet available in O-RAN-SC PackageCloud.io repository.
AC_DEFINE(HAVE_HIREDIS_VIP, [0], [Have hiredis-vip])
AM_CONDITIONAL([HIREDIS_VIP], [test "xyes" = "xno"])
+AC_ARG_WITH([gcov-report-dir],
+ AS_HELP_STRING([--with-gcov-report-dir=DIR],
+ [Directory for GCOV report files]),
+ [],
+ [with_gcov_report_dir=no])
+AC_MSG_CHECKING([gcov])
+if test "x$with_gcov_report_dir" = "xno"; then
+ AC_MSG_RESULT([no])
+ GCOV_REPORT_DIR="gcov_report"
+else
+ AC_MSG_RESULT([yes])
+ AC_MSG_NOTICE([gcov report directory: $with_gcov_report_dir])
+ GCOV_REPORT_DIR="$with_gcov_report_dir"
+fi
+AC_SUBST(GCOV_REPORT_DIR)
+AM_CONDITIONAL([ENABLE_GCOV],[test "x$with_gcov_report_dir" != "xno"])
+
DX_DOT_FEATURE(ON)
DX_INIT_DOXYGEN([shareddatalayer], [Doxyfile], [doxygen-doc])
SDL_LT_VERSION=m4_format("%d:%d:%d", SDL_CURRENT, SDL_REVISION, SDL_AGE)
+sdl (1.1.1-1) UNRELEASED; urgency=low
+
+ * Add unit test code coverage (gcov) make target.
+
+ -- Timo Tietavainen <timo.tietavainen@nokia.com> Mon, 11 May 2020 11:35:53 +0300
+
sdl (1.1.0-1) unstable; urgency=medium
* Add public helper classes for UT mocking.
./testrunner
./testrunner --gtest_filter=AsyncStorageTest*
+To get unit test code coverage analysis enable unit test gcov code coverage
+analysis by configuring gcov reporting directory:
+
+ configure --with-gcov-report-dir=DIR
+
+Directory can be an absolute path or a relative path to an SDL source root.
+Unit test build creates directory if it does not exist.
+
+Build and run unit tests with code coverage analysis:
+
+ make test_gcov
+
+After successful unit test run code coverage (.gcov) result files are in
+a directory, what was defined by '--with-gcov-report-dir' configure option.
+
+In addition, graphical gcov front-ends such as lcov can be used for coverage
+analysis:
+
+ lcov --directory tst/ --directory src --capture --output-file coverage.info
+ genhtml coverage.info --output-directory out
+
+Open the out/index.html using any web browser.
+
Functional Tests
================
Version history
---------------
+[1.1.1] - 2020-05-11
+
+* Add unit test code coverage (gcov) make target.
+
[1.1.0] - 2020-01-09
* Add public helper classes for UT mocking.
Name: sdl
-Version: 1.1.0
+Version: 1.1.1
Release: 1%{?dist}
Summary: C++ API library for Shared Data Layer clients
%{_includedir}/sdl
%changelog
+* Mon May 11 2020 Timo Tietavainen <timo.tietavainen@nokia.com> - 1.1.1-1
+- Add unit test code coverage (gcov) make target.
+
* Thu Jan 09 2020 Timo Tietavainen <timo.tietavainen@nokia.com> - 1.1.0-1
- Add public helper classes for UT mocking.