File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33# Output file for the merged result
44MERGED_FILE=" merged-lcov.info"
55
6- # Create or empty the merged file
7- mkdir -p coverage
6+ # Ensure output directory exists and clear previous file
87> " $MERGED_FILE "
98
10- # Process each package
9+ # Handle packages/*
1110for pkg in packages/* ; do
1211 LCOV_IN=" $pkg /coverage/lcov.info"
13- LCOV_FIXED=" $pkg /coverage/lcov-fixed.info"
1412
1513 if [ -f " $LCOV_IN " ]; then
16- echo " Fixing paths in $pkg "
17- # Prefix SF paths with the package path and save to fixed file
18- sed " s|^SF:|SF:$pkg /|" " $LCOV_IN " > " $LCOV_FIXED "
19-
20- # Append to the merged file
21- cat " $LCOV_FIXED " >> " $MERGED_FILE "
14+ echo " Merging $LCOV_IN "
15+ sed " s|^SF:|SF:$pkg /|" " $LCOV_IN " >> " $MERGED_FILE "
2216 fi
2317done
2418
19+ # Handle contracts/lcov.info
20+ CONTRACTS_LCOV=" contracts/lcov.info"
21+
22+ if [ -f " $CONTRACTS_LCOV " ]; then
23+ echo " Merging $CONTRACTS_LCOV "
24+ sed " s|^SF:|SF:contracts/|" " $CONTRACTS_LCOV " >> " $MERGED_FILE "
25+ fi
26+
2527echo " ✅ Merged LCOV written to $MERGED_FILE "
You can’t perform that action at this time.
0 commit comments