Skip to content

Commit

Permalink
Adding option to set the root in coverage script.
Browse files Browse the repository at this point in the history
  • Loading branch information
sumedhghaisas committed Aug 26, 2016
1 parent bd6a79a commit f557792
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion CMake/mlpack_coverage.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
;;
Expand Down Expand Up @@ -50,6 +54,10 @@ case $i in
max_cov_count="${i#*=}"
shift
;;
--root_dir=*)
root_dir="${i#*=}"
shift
;;
*)
# unknown option
;;
Expand Down Expand Up @@ -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

0 comments on commit f557792

Please sign in to comment.