]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Add GCOV to Linux scripts
authorspo <sergey.pokhodenko@opencascade.com>
Mon, 31 Aug 2015 12:00:17 +0000 (15:00 +0300)
committerspo <sergey.pokhodenko@opencascade.com>
Mon, 31 Aug 2015 12:00:58 +0000 (15:00 +0300)
env_lcov.sh [new file with mode: 0644]
lcov-run.sh [new file with mode: 0755]
linux_run.sh
make.sh

diff --git a/env_lcov.sh b/env_lcov.sh
new file mode 100644 (file)
index 0000000..e12a0db
--- /dev/null
@@ -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 (executable)
index 0000000..17f3900
--- /dev/null
@@ -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
+
index 2afb8078b1ca38d1efd8d92fb773ab8a10f0b8da..9ec6425671b2f595895aaa13f2cc31453ebdeb3d 100755 (executable)
@@ -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 d076d44e1fe24b4f6cda466f9ece4e2918a48a06..0909eb96051617b7e436d68a8b55d0e0897633f0 100755 (executable)
--- 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