1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-02-13 03:41:55 +00:00
srs/trunk/auto/coverage.sh

26 lines
929 B
Bash
Raw Normal View History

2019-02-02 13:42:03 +00:00
#!/bin/bash
# In .circleci/config.yml, generate *.gcno with
2019-02-02 13:51:08 +00:00
# ./configure --gcov --without-research --without-librtmp
# and generate *.gcda by
# ./objs/srs_utest
2019-02-02 13:42:03 +00:00
# Collect all *.gcno and *.gcda to objs/cover.
(mkdir -p objs/cover && cd objs/cover &&
cp -R ../../src . &&
for file in `find ../src -name "*.gcno"`; do cp $file .; done &&
for file in `find ../src -name "*.gcda"`; do cp $file .; done)
ret=$?; if [[ $ret -ne 0 ]]; then echo "Collect *.gcno and *.gcda failed, ret=$ret"; exit $ret; fi
# Generate *.gcov to objs/cover
for file in `find src -name "*.cpp"`; do
(mkdir -p objs/cover && cd objs/cover && gcov ../../$file -o .)
ret=$?; if [[ $ret -ne 0 ]]; then echo "Collect $file failed, ret=$ret"; exit $ret; fi
done
# Upload report with *.gcov
export CODECOV_TOKEN="493bba46-c468-4e73-8b45-8cdd8ff62d96" &&
mkdir -p objs/cover && cd objs/cover &&
bash <(curl -s https://codecov.io/bash)
exit 0