Skip to content

Commit 878f293

Browse files
committed
FIX: geninfo_auto_base = 1
1 parent 3c4dbd6 commit 878f293

File tree

2 files changed

+68
-17
lines changed

2 files changed

+68
-17
lines changed

scripts/coverage/coverage_capture.sh

Lines changed: 54 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,61 @@
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+
################### DEBUG !!!!!!!!!!!!!!!!!!!!!!!
20+
if [ 0 -eq 1 ]; then
21+
# Create the symbolic link $COMMON_UMF_DIR that points to $CURRENT_UMF_DIR:
22+
[ -e $COMMON_UMF_DIR ] && rm -rf $COMMON_UMF_DIR || ( ls -al $COMMON_UMF_DIR && exit 1 ) # remove the old link/directory
23+
sudo mkdir -p $(dirname $COMMON_UMF_DIR) # create all subdirectories
24+
sudo ln -s $CURRENT_UMF_DIR $COMMON_UMF_DIR # create the symbolic link
25+
GROUP=$(groups | cut -d' ' -f1) # get the main group of the current user
26+
sudo chown $USER:$GROUP $COMMON_UMF_DIR # change owner and group to the current user's one
27+
ls -al $COMMON_UMF_DIR # check the link
28+
29+
# Replace $CURRENT_UMF_DIR with $COMMON_UMF_DIR during "lcov --capture" command.
30+
# From the lcovrc(5) manual:
31+
# Adjust path to source files by removing or changing path
32+
# components that match the specified pattern (Perl regular
33+
# expression format)
34+
# geninfo_adjust_src_path = /tmp/build => /usr/src
35+
echo "geninfo_adjust_src_path = \"s#$CURRENT_UMF_DIR#$COMMON_UMF_DIR#g\"" | tee ${HOME}/.lcovrc
36+
else
37+
rm -f ${HOME}/.lcovrc
38+
fi
39+
1040
set -x
1141

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 )
42+
lcov --capture --directory . \
43+
--exclude "/usr/*" \
44+
--exclude "*/build/*" \
45+
--exclude "*/examples/*" \
46+
--exclude "*/test/*" \
47+
--exclude "*/src/critnib/*" \
48+
--exclude "*/src/ravl/*" \
49+
--exclude "*proxy_lib_new_delete.h" \
50+
--output-file $OUTPUT_NAME || \
51+
( echo "RETRY after ERROR !!!:" && \
52+
lcov --capture --directory . \
53+
--exclude "/usr/*" \
54+
--exclude "*/build/*" \
55+
--exclude "*/examples/*" \
56+
--exclude "*/test/*" \
57+
--exclude "*/src/critnib/*" \
58+
--exclude "*/src/ravl/*" \
59+
--exclude "*proxy_lib_new_delete.h" \
60+
--ignore-errors mismatch,unused,negative,corrupt \
61+
--output-file $OUTPUT_NAME )
62+
63+
if [ "$CURRENT_UMF_DIR" != "$COMMON_UMF_DIR" ]; then
64+
sed -i "s#$CURRENT_UMF_DIR#$COMMON_UMF_DIR#g" $OUTPUT_NAME
65+
fi

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)