[mlpack-git] master: Adding option to set the root in coverage script. (f557792)

gitdub at mlpack.org gitdub at mlpack.org
Fri Aug 26 05:33:45 EDT 2016


Repository : https://github.com/mlpack/mlpack
On branch  : master
Link       : https://github.com/mlpack/mlpack/compare/9e5cd0ac9c5cde9ac141bc84e7327bd11e19d42e...1148f1652e139c9037eb3813550090313d089a30

>---------------------------------------------------------------

commit f5577922d4502bea454e737d50710e4816a5586c
Author: sumedhghaisas <sumedhghaisas at gmail.com>
Date:   Thu Aug 25 12:27:08 2016 +0530

    Adding option to set the root in coverage script.


>---------------------------------------------------------------

f5577922d4502bea454e737d50710e4816a5586c
 CMake/mlpack_coverage.in | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/CMake/mlpack_coverage.in b/CMake/mlpack_coverage.in
index 66aa034..6dc2204 100755
--- a/CMake/mlpack_coverage.in
+++ b/CMake/mlpack_coverage.in
@@ -8,6 +8,9 @@ current_log_file=`date +'%Y.%h.%d:%H:%M:%S-coverage.log'`
 current_coverage_file=`date +'%Y.%h.%d:%H:%M:%S-coverage.info'`
 max_cov_count=50000
 
+# default directories
+root_dir="../"
+
 # Extract arguments.
 for i in "$@"
 do
@@ -23,6 +26,7 @@ case $i in
     echo "    -g|--gcov_tool_location    Gcov location if not default"
     echo "    -t|--token                 Upload to coveralls with given token"
     echo "       --max_cov_count         Max line coverage count (default 50000)"
+    echo "       --root_dir              Set the root directory from which gcov will be called. (default ../)"
     exit 0
     shift
     ;;
@@ -50,6 +54,10 @@ case $i in
     max_cov_count="${i#*=}"
     shift
     ;;
+    --root_dir=*)
+    root_dir="${i#*=}"
+    shift
+    ;;
     *)
             # unknown option
     ;;
@@ -120,6 +128,6 @@ cp .coverage.total ./coveragehistory/$current_coverage_file
 
 # Upload the result to coveralls if token is provided.
 if ! [ "$token" = "" ]; then
-  cpp-coveralls -n -r ../ -b ../ -l ./coveragehistory/$current_coverage_file -t "$token" --max-cov-count $max_cov_count
+  cpp-coveralls -n -r $root_dir -b $root_dir -l ./coveragehistory/$current_coverage_file -t "$token" --max-cov-count $max_cov_count
 fi
 




More information about the mlpack-git mailing list