From 15b23d4334159675ad65e41022667dafc857839e Mon Sep 17 00:00:00 2001 From: spo Date: Mon, 31 Aug 2015 15:00:17 +0300 Subject: [PATCH] Add GCOV to Linux scripts --- env_lcov.sh | 6 ++++++ lcov-run.sh | 10 ++++++++++ linux_run.sh | 2 +- make.sh | 15 +++++++++++---- 4 files changed, 28 insertions(+), 5 deletions(-) create mode 100644 env_lcov.sh create mode 100755 lcov-run.sh diff --git a/env_lcov.sh b/env_lcov.sh new file mode 100644 index 000000000..e12a0db92 --- /dev/null +++ b/env_lcov.sh @@ -0,0 +1,6 @@ +#!/bin/bash -e + +LCOV_DIR=/dn48/newgeom/common/products/lcov-1.11 +export PATH=${LCOV_DIR}/bin:${PATH} + +echo "Use LCOV in ${LCOV_DIR}..." \ No newline at end of file diff --git a/lcov-run.sh b/lcov-run.sh new file mode 100755 index 000000000..17f390068 --- /dev/null +++ b/lcov-run.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +source env_lcov.sh + +echo "Collect coverage data..." +lcov --capture --directory ../ --output-file coverage.info + +echo "Generate HTML for coverage data..." +genhtml coverage.info --output-directory lcov_html + diff --git a/linux_run.sh b/linux_run.sh index 2afb8078b..9ec642567 100755 --- a/linux_run.sh +++ b/linux_run.sh @@ -11,7 +11,7 @@ if [ -f GDB ]; then ${INSTALL_DIR}/bin/GeomApp & APP_PID=$! echo "Connecting GDB to PID ${APP_PID}..." - gdb --command=./commands.gdb - ${APP_PID} + gdb --command=./commands.gdb - ${APP_PID} >>gdb.log 2>>gdb.err else ${INSTALL_DIR}/bin/GeomApp fi diff --git a/make.sh b/make.sh index d076d44e1..0909eb960 100755 --- a/make.sh +++ b/make.sh @@ -3,13 +3,20 @@ source env.sh source env_standalone.sh -mkdir -p ${BUILD_DIR} -cd ${BUILD_DIR} - CMAKE_ARGS="" -CMAKE_ARGS="${CMAKE_ARGS} -DCMAKE_BUILD_TYPE=Release" +if [ -f GCOV ]; then + echo "Use GCOV..." + source env_lcov.sh + CMAKE_ARGS="${CMAKE_ARGS} -DCMAKE_BUILD_TYPE=Debug" + CMAKE_ARGS="${CMAKE_ARGS} -DUSE_TEST_COVERAGE=ON" +else + CMAKE_ARGS="${CMAKE_ARGS} -DCMAKE_BUILD_TYPE=Release" +fi CMAKE_ARGS="${CMAKE_ARGS} -DCMAKE_INSTALL_PREFIX:PATH=${INSTALL_DIR}" CMAKE_ARGS="${CMAKE_ARGS} ${SOURCES_DIR}" +mkdir -p ${BUILD_DIR} +cd ${BUILD_DIR} + cmake -G "Unix Makefiles" ${CMAKE_ARGS} make -j$(nproc) install -- 2.39.2