Skip to content

Commit d9c55f9

Browse files
committed
lcov report
1 parent 35fe001 commit d9c55f9

11 files changed

+124
-105
lines changed

.drone.star

+11-105
Original file line numberDiff line numberDiff line change
@@ -2,117 +2,23 @@
22
# subject to the Boost Software License, Version 1.0. (See accompanying
33
# file LICENSE.txt)
44
#
5-
# Copyright Rene Rivera 2020.
6-
# Copyright Alexander Grund 2022.
5+
# Copyright S. Darwin 2025.
76

87
# For Drone CI we use the Starlark scripting language to reduce duplication.
98
# As the yaml syntax for Drone CI is rather limited.
10-
11-
# Base environment for all jobs
12-
globalenv={'B2_CI_VERSION': '1', 'B2_VARIANT': 'release'}
13-
14-
# Wrapper function to apply the globalenv to all jobs
15-
def job(
16-
# job specific environment options
17-
env={},
18-
**kwargs):
19-
real_env = dict(globalenv)
20-
real_env.update(env)
21-
return job_impl(env=real_env, **kwargs)
9+
#
10+
#
11+
# globalenv={'B2_CI_VERSION': '1', 'B2_VARIANT': 'debug,release', 'B2_FLAGS': 'warnings=extra warnings-as-errors=on'}
12+
globalenv={'B2_CI_VERSION': '1', 'B2_VARIANT': 'release' }
13+
linuxglobalimage="cppalliance/droneubuntu2204:1"
2214

2315
def main(ctx):
2416
return [
25-
job(compiler='clang-3.5', cxxstd='11', os='ubuntu-16.04'),
26-
job(compiler='clang-3.6', cxxstd='11,14', os='ubuntu-16.04'),
27-
job(compiler='clang-3.8', cxxstd='11,14', os='ubuntu-16.04'),
28-
job(compiler='clang-3.9', cxxstd='11,14', os='ubuntu-18.04'),
29-
job(compiler='clang-4.0', cxxstd='11,14', os='ubuntu-18.04'),
30-
job(compiler='clang-5.0', cxxstd='11,14,1z', os='ubuntu-18.04'),
31-
job(compiler='clang-6.0', cxxstd='11,14,17', os='ubuntu-18.04'),
32-
job(compiler='clang-7', cxxstd='11,14,17', os='ubuntu-18.04'),
33-
job(compiler='clang-8', cxxstd='11,14,17,2a', os='ubuntu-18.04'),
34-
job(compiler='clang-9', cxxstd='11,14,17,2a', os='ubuntu-18.04'),
35-
job(compiler='clang-10', cxxstd='11,14,17,2a', os='ubuntu-18.04'),
36-
job(compiler='clang-11', cxxstd='11,14,17,2a', os='ubuntu-22.04'),
37-
job(compiler='clang-12', cxxstd='11,14,17,20', os='ubuntu-22.04'),
38-
job(compiler='clang-13', cxxstd='11,14,17,20,2b', os='ubuntu-22.04'),
39-
job(compiler='clang-14', cxxstd='11,14,17,20,2b', os='ubuntu-22.04'),
40-
job(compiler='clang-15', cxxstd='11,14,17,20,2b', os='ubuntu-22.04', add_llvm=True),
41-
42-
job(compiler='gcc-4.7', cxxstd='11', os='ubuntu-16.04'),
43-
job(compiler='gcc-4.8', cxxstd='11', os='ubuntu-16.04'),
44-
job(compiler='gcc-4.9', cxxstd='11', os='ubuntu-16.04'),
45-
job(compiler='gcc-5', cxxstd='11,14,1z', os='ubuntu-18.04'),
46-
job(compiler='gcc-6', cxxstd='11,14,1z', os='ubuntu-18.04'),
47-
job(compiler='gcc-7', cxxstd='11,14,1z', os='ubuntu-18.04'),
48-
job(compiler='gcc-8', cxxstd='11,14,17,2a', os='ubuntu-18.04'),
49-
job(compiler='gcc-9', cxxstd='11,14,17,2a', os='ubuntu-18.04'),
50-
job(compiler='gcc-10', cxxstd='11,14,17,20', os='ubuntu-22.04'),
51-
job(compiler='gcc-11', cxxstd='11,14,17,20,2b', os='ubuntu-22.04'),
52-
job(compiler='gcc-12', cxxstd='11,14,17,20,2b', os='ubuntu-22.04'),
53-
54-
job(name='Coverage', buildtype='codecov',
55-
compiler='gcc-8', cxxstd='11,14,17,2a', os='ubuntu-18.04'),
56-
job(name='Coverity Scan', buildtype='coverity',
57-
compiler='clang', cxxstd=None, os='ubuntu-18.04', packages=''),
58-
# Sanitizers
59-
job(name='ASAN', asan=True,
60-
compiler='gcc-12', cxxstd='11,14,17,20', os='ubuntu-22.04'),
61-
job(name='UBSAN', ubsan=True,
62-
compiler='gcc-12', cxxstd='11,14,17,20', os='ubuntu-22.04'),
63-
job(name='TSAN', tsan=True,
64-
compiler='gcc-12', cxxstd='11,14,17,20', os='ubuntu-22.04'),
65-
job(name='Clang 14 w/ sanitizers', asan=True, ubsan=True,
66-
compiler='clang-14', cxxstd='11,14,17,20', os='ubuntu-22.04'),
67-
job(name='Clang 11 libc++ w/ sanitizers', asan=True, ubsan=True, # libc++-11 is the latest working with ASAN: https://github.com/llvm/llvm-project/issues/59432
68-
compiler='clang-11', cxxstd='11,14,17,20', os='ubuntu-20.04', stdlib='libc++', install='libc++-11-dev libc++abi-11-dev'),
69-
job(name='Valgrind', valgrind=True,
70-
compiler='clang-6.0', cxxstd='11,14,1z', os='ubuntu-18.04', install='libc6-dbg libc++-dev libstdc++-8-dev'),
71-
72-
# libc++
73-
job(compiler='clang-6.0', cxxstd='11,14,17,2a', os='ubuntu-18.04', stdlib='libc++', install='libc++-dev libc++abi-dev'),
74-
job(compiler='clang-7', cxxstd='11,14,17,2a', os='ubuntu-20.04', stdlib='libc++', install='libc++-7-dev libc++abi-7-dev'),
75-
job(compiler='clang-8', cxxstd='11,14,17,2a', os='ubuntu-20.04', stdlib='libc++', install='libc++-8-dev libc++abi-8-dev'),
76-
job(compiler='clang-9', cxxstd='11,14,17,2a', os='ubuntu-20.04', stdlib='libc++', install='libc++-9-dev libc++abi-9-dev'),
77-
job(compiler='clang-10', cxxstd='11,14,17,20', os='ubuntu-20.04', stdlib='libc++', install='libc++-10-dev libc++abi-10-dev'),
78-
job(compiler='clang-11', cxxstd='11,14,17,20', os='ubuntu-20.04', stdlib='libc++', install='libc++-11-dev libc++abi-11-dev'),
79-
job(compiler='clang-12', cxxstd='11,14,17,20', os='ubuntu-22.04', stdlib='libc++', install='libc++-12-dev libc++abi-12-dev libunwind-12-dev'),
80-
job(compiler='clang-13', cxxstd='11,14,17,20', os='ubuntu-22.04', stdlib='libc++', install='libc++-13-dev libc++abi-13-dev'),
81-
job(compiler='clang-14', cxxstd='11,14,17,20', os='ubuntu-22.04', stdlib='libc++', install='libc++-14-dev libc++abi-14-dev'),
82-
job(compiler='clang-15', cxxstd='11,14,17,20', os='ubuntu-22.04', stdlib='libc++', install='libc++-15-dev libc++abi-15-dev', add_llvm=True),
83-
84-
# FreeBSD
85-
job(compiler='clang-10', cxxstd='11,14,17,20', os='freebsd-13.1'),
86-
job(compiler='clang-15', cxxstd='11,14,17,20', os='freebsd-13.1'),
87-
job(compiler='gcc-11', cxxstd='11,14,17,20', os='freebsd-13.1', linkflags='-Wl,-rpath=/usr/local/lib/gcc11'),
88-
# OSX
89-
job(compiler='clang', cxxstd='11,14,17,2a', os='osx-xcode-10.1'),
90-
job(compiler='clang', cxxstd='11,14,17,2a', os='osx-xcode-10.3'),
91-
job(compiler='clang', cxxstd='11,14,17,2a', os='osx-xcode-11.1'),
92-
job(compiler='clang', cxxstd='11,14,17,2a', os='osx-xcode-11.7'),
93-
job(compiler='clang', cxxstd='11,14,17,2a', os='osx-xcode-12'),
94-
job(compiler='clang', cxxstd='11,14,17,20', os='osx-xcode-12.5.1'),
95-
job(compiler='clang', cxxstd='11,14,17,20', os='osx-xcode-13.0'),
96-
job(compiler='clang', cxxstd='11,14,17,20', os='osx-xcode-13.4.1'),
97-
job(compiler='clang', cxxstd='11,14,17,20,2b', os='osx-xcode-14.0'),
98-
job(compiler='clang', cxxstd='11,14,17,20,2b', os='osx-xcode-14.3.1'),
99-
job(compiler='clang', cxxstd='11,14,17,20,2b', os='osx-xcode-15.0.1'),
100-
# ARM64
101-
job(compiler='clang-12', cxxstd='11,14,17,20', os='ubuntu-20.04', arch='arm64', add_llvm=True),
102-
job(compiler='gcc-11', cxxstd='11,14,17,20', os='ubuntu-20.04', arch='arm64'),
103-
# S390x
104-
job(compiler='clang-12', cxxstd='11,14,17,20', os='ubuntu-20.04', arch='s390x', add_llvm=True),
105-
job(compiler='gcc-11', cxxstd='11,14,17,20', os='ubuntu-20.04', arch='s390x'),
106-
# Windows
107-
job(compiler='msvc-14.0', cxxstd=None, os='windows', env={'B2_DONT_EMBED_MANIFEST': 1}),
108-
job(compiler='msvc-14.1', cxxstd=None, os='windows'),
109-
job(compiler='msvc-14.2', cxxstd=None, os='windows'),
110-
job(compiler='msvc-14.3', cxxstd=None, os='windows'),
111-
job(compiler='msvc-14.0', cxxstd='14,17,20', os='windows', env={'B2_DONT_EMBED_MANIFEST': 1}),
112-
job(compiler='msvc-14.1', cxxstd='14,17,20', os='windows'),
113-
job(compiler='msvc-14.2', cxxstd='14,17,20', os='windows'),
114-
job(compiler='msvc-14.3', cxxstd='14,17,20,latest', os='windows'),
17+
linux_cxx("lcov report 1", "g++-12", packages="g++-12", buildtype="lcov-report", buildscript="drone", image="cppalliance/droneubuntu2204:1", environment={'LCOV_SKIP_PATTERN': '^[g-z]', 'B2_TOOLSET': 'gcc-12', 'B2_CXXSTD': '20'}, globalenv=globalenv),
18+
linux_cxx("lcov report 2", "g++-12", packages="g++-12", buildtype="lcov-report", buildscript="drone", image="cppalliance/droneubuntu2204:1", environment={'LCOV_SKIP_PATTERN': '^[a-fn-z]', 'B2_TOOLSET': 'gcc-12', 'B2_CXXSTD': '20'}, globalenv=globalenv),
19+
linux_cxx("lcov report 3", "g++-12", packages="g++-12", buildtype="lcov-report", buildscript="drone", image="cppalliance/droneubuntu2204:1", environment={'LCOV_SKIP_PATTERN': '^[a-ms-z]', 'B2_TOOLSET': 'gcc-12', 'B2_CXXSTD': '20'}, globalenv=globalenv),
20+
linux_cxx("lcov report 4", "g++-12", packages="g++-12", buildtype="lcov-report", buildscript="drone", image="cppalliance/droneubuntu2204:1", environment={'LCOV_SKIP_PATTERN': '^[a-r]', 'B2_TOOLSET': 'gcc-12', 'B2_CXXSTD': '20'}, globalenv=globalenv),
11521
]
11622

11723
# from https://github.com/boostorg/boost-ci
118-
load("@boost_ci//ci/drone/:functions.star", "linux_cxx", "windows_cxx", "osx_cxx", "freebsd_cxx", "job_impl")
24+
load("@boost_ci//ci/drone/:functions.star", "linux_cxx","windows_cxx","osx_cxx","freebsd_cxx")

.drone/after-install.bat

100644100755
File mode changed.

.drone/after-install.sh

100644100755
File mode changed.

.drone/before-install.bat

100644100755
File mode changed.

.drone/before-install.sh

100644100755
File mode changed.

.drone/drone.bat

100644100755
File mode changed.

.drone/drone.sh

+3
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ echo "B2 config: $(env | grep B2_ || true)"
5555
echo "==================================> SCRIPT ($DRONE_JOB_BUILDTYPE)"
5656

5757
case "$DRONE_JOB_BUILDTYPE" in
58+
lcov-report)
59+
$BOOST_CI_SRC_FOLDER/.drone/lcov-report.sh
60+
;;
5861
boost)
5962
$BOOST_CI_SRC_FOLDER/ci/build.sh
6063
;;

.drone/lcov-report.sh

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
#!/bin/bash
2+
3+
set -eu
4+
# set -x
5+
6+
export LCOV_SKIPLIST="math"
7+
8+
: "${LCOV_SKIP_PATTERN:='^[9]'}" # Set default lcov skip pattern
9+
10+
pwd
11+
12+
export CI_DIR=${BOOST_CI_SRC_FOLDER}/ci
13+
export LCOV_VERSION="v2.3"
14+
export LCOV_IGNORE_ERRORS_LEVEL=standard
15+
16+
touch /tmp/failed.txt
17+
touch /tmp/succeeded.txt
18+
19+
cd "$BOOST_ROOT"
20+
git submodule update --init --recursive --jobs 4
21+
./b2 headers
22+
23+
# shellcheck disable=SC2016
24+
git submodule foreach '$CI_DIR/runcodecov.sh $name'
25+
26+
echo " "
27+
echo "The following is a collection of all lcov warnings/errors"
28+
echo " "
29+
cat /tmp/lcov-results.txt
30+
echo " "
31+
echo "The above list is a collection of all lcov warnings/errors"
32+
echo " "
33+
34+
echo " "
35+
echo "The following is a collection of less usual lcov warnings/errors"
36+
echo " "
37+
grep -v mismatch /tmp/lcov-results.txt | grep -v inconsistent | grep -v unused
38+
echo " "
39+
echo "The above list is a collection of less usual lcov warnings/errors"
40+
echo " "
41+
42+
43+
failed=$(wc -l /tmp/failed.txt | cut -d" " -f1)
44+
succeeded=$(wc -l /tmp/succeeded.txt | cut -d" " -f1)
45+
echo "$failed failed, $succeeded succeeded."
46+
echo ""
47+
cat /tmp/failed.txt
48+
49+
sleep 60
50+
51+
echo "Completed"

.github/workflows/ci.yml

+4
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ jobs:
116116

117117
timeout-minutes: 120
118118
runs-on: ${{matrix.os}}
119+
if: false
119120
container:
120121
image: ${{matrix.container}}
121122
volumes:
@@ -301,6 +302,7 @@ jobs:
301302
- { toolset: gcc, cxxstd: '11,14,17,2a', addrmd: '64', os: windows-2019 }
302303

303304
runs-on: ${{matrix.os}}
305+
if: false
304306

305307
steps:
306308
- uses: actions/checkout@v4
@@ -365,6 +367,7 @@ jobs:
365367
- { sys: MINGW64, compiler: gcc, cxxstd: '11,17,20' }
366368

367369
runs-on: windows-latest
370+
if: false
368371

369372
steps:
370373
- uses: actions/checkout@v4
@@ -428,6 +431,7 @@ jobs:
428431

429432
timeout-minutes: 120
430433
runs-on: ${{matrix.os}}
434+
if: false
431435

432436
steps:
433437
- uses: actions/checkout@v4

.github/workflows/old_ci.yml

+1
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ jobs:
104104
name: ${{matrix.name}}
105105
timeout-minutes: 120
106106
runs-on: ${{matrix.os}}
107+
if: false
107108
env: ${{matrix.env}}
108109

109110
steps:

ci/runcodecov.sh

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
#!/bin/bash
2+
3+
set -eu
4+
# set -x
5+
6+
reponame=$1
7+
echo "reponame is $reponame"
8+
echo "date is $(date)"
9+
mkdir -p /tmp/lcov-repo-results || true
10+
11+
# Filters.
12+
# jump ahead to continue testing
13+
if [[ "$reponame" =~ ${LCOV_SKIP_PATTERN} ]]; then
14+
echo "skipping ahead X letters"
15+
elif [[ "$LCOV_SKIPLIST" =~ $reponame ]]; then
16+
echo "repo in skiplist"
17+
else
18+
# required vars for codecov.sh:
19+
# BOOST_ROOT is already set
20+
BOOST_CI_SRC_FOLDER=$(pwd)
21+
export BOOST_CI_SRC_FOLDER
22+
if ! SELF=$(python3 "$CI_DIR/get_libname.py"); then
23+
echo "..failed to determine SELF name of lib"
24+
echo "$reponame failed to determine SELF variable. May be expected. Continuing." >> /tmp/failed.txt
25+
exit 0
26+
fi
27+
export SELF
28+
29+
# clean disk space
30+
rm -rf "$BOOST_ROOT/bin.v2/libs"
31+
32+
# Run the parts of travis/codecov.sh separately:
33+
# shellcheck disable=SC1091
34+
source "$CI_DIR"/codecov.sh "setup"
35+
set +e
36+
if ! "$CI_DIR"/build.sh ; then
37+
echo "..failed. CODECOV FAILED at build.sh. LIBRARY $reponame"
38+
echo "$reponame failed build.sh" >> /tmp/failed.txt
39+
fi
40+
echo "After build.sh"
41+
echo "Running codecov.sh collect"
42+
set -o pipefail
43+
if ! "$CI_DIR"/codecov.sh "collect" 2>&1 | tee "/tmp/lcov-repo-results/$reponame" ; then
44+
echo "..failed. CODECOV FAILED coverage. LIBRARY $reponame"
45+
echo "$reponame failed coverage" >> /tmp/failed.txt
46+
else
47+
echo "LIBRARY $reponame SUCCEEDED."
48+
echo "$reponame" >> /tmp/succeeded.txt
49+
fi
50+
51+
echo "LIBRARY $reponame RESULTS:" >> /tmp/lcov-results.txt
52+
grep "lcov: ERROR" "/tmp/lcov-repo-results/$reponame" >> /tmp/lcov-results.txt || true
53+
grep "lcov: WARNING" "/tmp/lcov-repo-results/$reponame" >> /tmp/lcov-results.txt || true
54+
fi

0 commit comments

Comments
 (0)