From: spo Date: Mon, 31 Aug 2015 12:00:17 +0000 (+0300) Subject: Add GCOV to Linux scripts X-Git-Tag: V_1.4.0_beta4~187 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=15b23d4334159675ad65e41022667dafc857839e;p=modules%2Fshaper.git Add GCOV to Linux scripts --- 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