Bugfix for translation in merge reports
diff --git a/coverage-tool/coverage-reporting/merge.py b/coverage-tool/coverage-reporting/merge.py
index e3d9d65..3ab46f7 100755
--- a/coverage-tool/coverage-reporting/merge.py
+++ b/coverage-tool/coverage-reporting/merge.py
@@ -129,16 +129,17 @@
info_files_to_merge[i]))
info_lines = info_file.readlines()
info_file.close()
- common_prefix = os.path.normpath(
- os.path.commonprefix([line[3:] for line in info_lines
- if 'SF:' in line]))
temp_file = 'temporary_' + str(i) + '.info'
+ parts = None
with open(temp_file, "w+") as f:
for line in info_lines:
- cf = common_prefix
- if os.path.basename(common_prefix) in file_groups[i]["locations"]:
- cf = os.path.dirname(common_prefix)
- f.write(line.replace(cf, options.local_workspace))
+ if "SF" in line:
+ for location in file_groups[i]["locations"]:
+ if location in line:
+ parts = line[3:].partition(location)
+ line = line.replace(parts[0], options.local_workspace + "/")
+ break
+ f.write(line)
info_files_to_merge[i] = temp_file # Replace info file to be merged
i += 1
diff --git a/coverage-tool/coverage-reporting/merge.sh b/coverage-tool/coverage-reporting/merge.sh
index 354dbc8..8304487 100755
--- a/coverage-tool/coverage-reporting/merge.sh
+++ b/coverage-tool/coverage-reporting/merge.sh
@@ -13,7 +13,7 @@
# files.
#==============================================================================
-set -e
+set +x
#################################################################
# Function to manipulate json objects.
# The json object properties can be accessed through "." separated
@@ -127,7 +127,7 @@
except Exception as ex:
print(ex)
EOT
- cd -
+ cd -
}
#################################################################
@@ -161,7 +161,7 @@
fname="$where.$extension" # Same filename as folder
rm $where/$fname &>/dev/null || true
wget -o error.log $_origin -O $where/$fname || (
- cat error.log && exit -1)
+ cat error.log && exit -1)
cloned_file="$(get_abs_path $where/$fname)"
elif [ "$_type" = '"bundle"' ];then
# Check file exists at origin, i.e. was unbundled before
@@ -170,10 +170,10 @@
cloned_file="$(get_abs_path $where/$fname)"
fi
elif [ "$_type" = '"file"' ];then
- if [[ "$_origin" = http* ]]; then
- echo "$_origin looks like 'http' rather than 'file' please check..."
- exit -1
- fi
+ if [[ "$_origin" = http* ]]; then
+ echo "$_origin looks like 'http' rather than 'file' please check..."
+ exit -1
+ fi
fname="$where.$extension" # Same filename as folder
cp -f $_origin $where/$fname
cloned_file="$(get_abs_path $where/$fname)"
@@ -395,8 +395,8 @@
exit -1
fi
if [ -z "$LOCAL_WORKSPACE" ] && [ $CLONE_SOURCES = true ]; then
- echo "Need to define a local workspace folder to clone/copy sources!"
- exit -1
+ echo "Need to define a local workspace folder to clone/copy sources!"
+ exit -1
fi
# Getting the script folder where other script files must reside, i.e
# merge.py, clone_sources.py
@@ -409,7 +409,7 @@
get_info_json_files
merge_files
if [ $CLONE_SOURCES = true ];then
- clone_repos $output_json_file
+ clone_repos $output_json_file
fi
# Generate branch coverage report
genhtml --branch-coverage $output_coverage_file \