1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

Script: Fast coverage support module filter

This commit is contained in:
winlin 2021-03-04 17:00:47 +08:00
parent d6a6f98a70
commit 990dc8cda9

20
trunk/auto/fast.sh Normal file → Executable file
View file

@ -1,5 +1,21 @@
#!/bin/bash #!/bin/bash
MODULES=""
if [[ $# -gt 0 ]]; then
for module in $@; do
module=$(basename $module)
if [[ $module == "src" ]]; then
MODULES="objs/src"
break
fi
MODULES="$MODULES objs/src/$module"
done
fi
if [[ $MODULES == "" ]]; then
MODULES="objs/src"
fi
IS_LINUX=yes IS_LINUX=yes
uname -s|grep Darwin >/dev/null && IS_DARWIN=yes && IS_LINUX=no uname -s|grep Darwin >/dev/null && IS_DARWIN=yes && IS_LINUX=no
echo "IS_LINUX: $IS_LINUX, IS_DARWIN: $IS_DARWIN" echo "IS_LINUX: $IS_LINUX, IS_DARWIN: $IS_DARWIN"
@ -10,8 +26,8 @@ find objs -name *.gcda |xargs rm -f
echo "Build and run utest" echo "Build and run utest"
make -j10 && ./objs/srs_utest make -j10 && ./objs/srs_utest
echo "Generating coverage" echo "Generating coverage at $MODULES"
mkdir -p ./objs/coverage && mkdir -p ./objs/coverage &&
gcovr -r src --html --html-details -o ./objs/coverage/srs.html objs/src && gcovr -r src --html --html-details -o ./objs/coverage/srs.html $MODULES &&
echo "Coverage report at ./objs/coverage/srs.html" && echo "Coverage report at ./objs/coverage/srs.html" &&
open ./objs/coverage/srs.html open ./objs/coverage/srs.html