Skip to content

Commit 9afa303

Browse files
committed
FIX: geninfo_auto_base = 1
1 parent 3c4dbd6 commit 9afa303

File tree

2 files changed

+63
-17
lines changed

2 files changed

+63
-17
lines changed

scripts/coverage/coverage_capture.sh

Lines changed: 49 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,56 @@
55

66
set -e
77

8+
set -x ################### DEBUG !!!!!!!!!!!!!!!!!!!!!!!
9+
810
[ "$1" != "" ] && OUTPUT_NAME="$1" || OUTPUT_NAME="total_coverage"
911

12+
# Most common UMF source code directory on most GH CI runners
13+
COMMON_UMF_DIR=/home/runner/work/unified-memory-framework/unified-memory-framework
14+
15+
# Get the current UMF source code directory
16+
# This is ${CURRENT_UMF_DIR}/scripts/coverage/coverage_capture.sh file, so
17+
CURRENT_UMF_DIR=$(realpath $(dirname $0)/../..)
18+
19+
if [ "$CURRENT_UMF_DIR" != "$COMMON_UMF_DIR" ]; then
20+
# Create the symbolic link $COMMON_UMF_DIR that points to $CURRENT_UMF_DIR:
21+
sudo rm -rf $COMMON_UMF_DIR # remove the old link/directory
22+
sudo mkdir -p $(dirname $COMMON_UMF_DIR) # create all subdirectories
23+
sudo ln -s $CURRENT_UMF_DIR $COMMON_UMF_DIR # create the symbolic link
24+
GROUP=$(groups | cut -d' ' -f1) # get the main group of the current user
25+
sudo chown $USER:$GROUP $COMMON_UMF_DIR # change owner and group to the current user's one
26+
ls -al $COMMON_UMF_DIR # check the link
27+
28+
# Replace $CURRENT_UMF_DIR with $COMMON_UMF_DIR during "lcov --capture" command.
29+
# From the lcovrc(5) manual:
30+
# Adjust path to source files by removing or changing path
31+
# components that match the specified pattern (Perl regular
32+
# expression format)
33+
# geninfo_adjust_src_path = /tmp/build => /usr/src
34+
echo "geninfo_adjust_src_path = \"s#$CURRENT_UMF_DIR#$COMMON_UMF_DIR#g\"" | tee ${HOME}/.lcovrc
35+
else
36+
rm -f ${HOME}/.lcovrc
37+
fi
38+
1039
set -x
1140

12-
# --exclude "*proxy_lib_new_delete.h*"
13-
lcov --capture --directory . --exclude "/usr/*" --exclude "*/build/_deps/*" --exclude "*/examples/*" --exclude "*/test/*" --exclude "*/src/critnib/*" --exclude "*/src/ravl/*" --output-file $OUTPUT_NAME || \
14-
( echo && lcov --capture --directory . --exclude "/usr/*" --exclude "*/build/_deps/*" --exclude "*/examples/*" --exclude "*/test/*" --exclude "*/src/critnib/*" --exclude "*/src/ravl/*" --ignore-errors mismatch,unused --output-file $OUTPUT_NAME )
41+
lcov --capture --directory . \
42+
--exclude "/usr/*" \
43+
--exclude "*/build/*" \
44+
--exclude "*/examples/*" \
45+
--exclude "*/test/*" \
46+
--exclude "*/src/critnib/*" \
47+
--exclude "*/src/ravl/*" \
48+
--exclude "*proxy_lib_new_delete.h" \
49+
--output-file $OUTPUT_NAME || \
50+
( echo "RETRY after ERROR !!!:" && \
51+
lcov --capture --directory . \
52+
--exclude "/usr/*" \
53+
--exclude "*/build/*" \
54+
--exclude "*/examples/*" \
55+
--exclude "*/test/*" \
56+
--exclude "*/src/critnib/*" \
57+
--exclude "*/src/ravl/*" \
58+
--exclude "*proxy_lib_new_delete.h" \
59+
--ignore-errors mismatch,unused,negative,corrupt \
60+
--output-file $OUTPUT_NAME )

scripts/coverage/merge_coverage_files.sh

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
[ "$1" != "" ] && PREFIX="$1" || PREFIX="exports-coverage"
77
[ "$2" != "" ] && OUTPUT_NAME="$2" || OUTPUT_NAME="total_coverage"
88

9-
GROUP=$(groups | cut -d' ' -f1)
9+
# GROUP=$(groups | cut -d' ' -f1)
1010

1111
# The source code of UMF is located in /home/runner/work/unified-memory-framework/unified-memory-framework.
12-
UMF_DIR=/home/runner/work/unified-memory-framework/unified-memory-framework
12+
# UMF_DIR=/home/runner/work/unified-memory-framework/unified-memory-framework
1313

1414
# Create required links:
1515
# LINKS="
@@ -18,17 +18,17 @@ UMF_DIR=/home/runner/work/unified-memory-framework/unified-memory-framework
1818
# /home/test-user/shared-action-runner/_work/unified-memory-framework/unified-memory-framework
1919
# /home/test-user/shared-actions-runner/_work/unified-memory-framework/unified-memory-framework
2020
# /opt/actions-runner/_work/unified-memory-framework/unified-memory-framework"
21-
cat ./path-* | sort | uniq
22-
LINKS=$(cat ./path-* | sort | uniq | xargs)
23-
24-
for link in $LINKS; do
25-
[ -e $link ] && continue # continue if already exists
26-
sudo mkdir -p $link # create all subdirectories
27-
sudo rm -r $link # remove the last directory
28-
sudo ln -s $UMF_DIR $link # create the link
29-
sudo chown $USER:$GROUP $link # set permissions
30-
ls -al $link # check the link
31-
done
21+
# cat ./path-* | sort | uniq
22+
# LINKS=$(cat ./path-* | sort | uniq | xargs)
23+
24+
# for link in $LINKS; do
25+
# [ -e $link ] && continue # continue if already exists
26+
# sudo mkdir -p $link # create all subdirectories
27+
# sudo rm -r $link # remove the last directory
28+
# sudo ln -s $UMF_DIR $link # create the link
29+
# sudo chown $USER:$GROUP $link # set permissions
30+
# ls -al $link # check the link
31+
# done
3232

3333
OPTS=""
3434
for file in $(ls -1 ${PREFIX}-*); do
@@ -37,4 +37,4 @@ done
3737

3838
set -x
3939

40-
lcov -o $OUTPUT_NAME $OPTS
40+
lcov $OPTS -o $OUTPUT_NAME

0 commit comments

Comments
 (0)