mirror of
https://github.com/znc/znc.git
synced 2026-07-06 01:41:12 +02:00
5974d0ff3b
Skip failing tests on cygwin: we'll just have to mark the unix socket feature as "experimental", but shouldn't block merging it due to cygwin being weird
56 lines
1.9 KiB
Bash
56 lines
1.9 KiB
Bash
set -x
|
|
|
|
pwd
|
|
ls -la
|
|
|
|
cpanm --local-lib=~/perl5 local::lib
|
|
eval $(perl -I ~/perl5/lib/perl5/ -Mlocal::lib)
|
|
cpanm --notest Devel::Cover::Report::Clover
|
|
pip3 install --user --break-system-packages coverage
|
|
export ZNC_MODPERL_COVERAGE=1
|
|
#export ZNC_MODPYTHON_COVERAGE=1
|
|
|
|
case "${CC:-gcc}" in
|
|
gcc)
|
|
export CXXFLAGS="$CXXFLAGS --coverage"
|
|
export LDFLAGS="$LDFLAGS --coverage"
|
|
;;
|
|
clang)
|
|
export CXXFLAGS="$CXXFLAGS -fprofile-instr-generate -fcoverage-mapping"
|
|
export LDFLAGS="$LDFLAGS -fprofile-instr-generate"
|
|
;;
|
|
esac
|
|
|
|
mkdir build
|
|
cd build
|
|
../configure --enable-debug --enable-perl --enable-python --enable-tcl --enable-cyrus --enable-charset --enable-argon $CFGFLAGS
|
|
cmake --system-information
|
|
|
|
make -j2 VERBOSE=1
|
|
env LLVM_PROFILE_FILE="$PWD/unittest.profraw" make VERBOSE=1 unittest
|
|
sudo make install
|
|
/usr/local/bin/znc --version
|
|
|
|
# TODO: use DEVEL_COVER_OPTIONS for https://metacpan.org/pod/Devel::Cover
|
|
env LLVM_PROFILE_FILE="$PWD/inttest.profraw" ZNC_MODPERL_COVERAGE_OPTS="-db,$PWD/cover_db" PYTHONWARNINGS=error make VERBOSE=1 inttest
|
|
ls -lRa
|
|
|
|
~/perl5/bin/cover --no-gcov --report=clover
|
|
|
|
case "${CC:-gcc}" in
|
|
gcc)
|
|
lcov --directory . --capture --output-file lcov-coverage.txt --ignore-errors mismatch
|
|
lcov --list lcov-coverage.txt
|
|
;;
|
|
clang)
|
|
if [[ x$(uname) == xDarwin ]]; then
|
|
export PATH=$PATH:/Library/Developer/CommandLineTools/usr/bin
|
|
fi
|
|
llvm-profdata merge unittest.profraw -o unittest.profdata
|
|
llvm-profdata merge inttest.profraw* -o inttest.profdata
|
|
llvm-cov show -show-line-counts-or-regions -instr-profile=unittest.profdata test/unittest_bin > unittest-cmake-coverage.txt
|
|
llvm-cov show -show-line-counts-or-regions -instr-profile=inttest.profdata /usr/local/bin/znc > inttest-znc-coverage.txt
|
|
find /usr/local/lib/znc -name '*.so' -or -name '*.bundle' | while read f; do llvm-cov show -show-line-counts-or-regions -instr-profile=inttest.profdata $f > inttest-$(basename $f)-coverage.txt; done
|
|
;;
|
|
esac
|