diff --git a/.circleci/config.yml b/.circleci/config.yml index 9e8de80ba..fc1945ec4 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -48,7 +48,7 @@ jobs: - run: | echo "Build and run utest for SRS" && cd trunk && ./configure --gb28181=on --utest=on --gcov=on && make && - ./objs/srs_utest && bash auto/coverage.sh + ./objs/srs_utest && bash auto/codecov.sh run-regression-test: docker: - image: ossrs/srs:dev diff --git a/trunk/auto/coverage.sh b/trunk/auto/codecov.sh old mode 100644 new mode 100755 similarity index 100% rename from trunk/auto/coverage.sh rename to trunk/auto/codecov.sh diff --git a/trunk/auto/fast.sh b/trunk/auto/fast.sh new file mode 100755 index 000000000..485611792 --- /dev/null +++ b/trunk/auto/fast.sh @@ -0,0 +1,33 @@ +#!/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 +uname -s|grep Darwin >/dev/null && IS_DARWIN=yes && IS_LINUX=no +echo "IS_LINUX: $IS_LINUX, IS_DARWIN: $IS_DARWIN" + +echo "Clean gcda files" +find objs -name *.gcda |xargs rm -f + +echo "Build and run utest" +make -j10 && ./objs/srs_utest + +echo "Generating coverage at $MODULES" +mkdir -p ./objs/coverage && +gcovr -r src --html --html-details -o ./objs/coverage/srs.html $MODULES && +echo "Coverage report at ./objs/coverage/srs.html" && +open ./objs/coverage/srs.html