[chore] 单元测试结束后清理垃圾文件

pull/134/head
q191201771 3 years ago
parent 0f21334964
commit 6084827c00

16
.gitignore vendored

@ -1,18 +1,20 @@
/.idea
/.vscode
/SECRET.md
profile.out
coverage.html
/coverage.txt
lal_record
logs
testdata
/bin
/release
/.trash
/playground
/tmp
/playground
profile.out
coverage.html
/coverage.txt
delay.txt
/.trash
/SECRET.md
/TODO.md
/pre-commit.sh
/conf/self.conf.json
@ -23,5 +25,3 @@ testdata
*.aac
*.h264
*.flv
lal_record
delay.txt

@ -20,9 +20,7 @@ image:
.PHONY: clean
clean:
rm -rf ./bin ./release ./logs ./lal_record ./pkg/base/logs ./pkg/base/lal_record ./pkg/httpts/logs ./pkg/httpts/lal_record
rm -rf ./pkg/mpegts/logs ./pkg/mpegts/lal_record ./pkg/remux/logs ./pkg/remux/lal_record ./pkg/rtprtcp/logs ./pkg/rtprtcp/lal_record
rm -rf ./pkg/rtsp/logs ./pkg/rtsp/lal_record ./pkg/sdp/logs ./pkg/sdp/lal_record
rm -rf ./bin ./lal_record ./logs coverage.txt
.PHONY: all
all: build test

@ -53,7 +53,7 @@ mkdir "./testdata/conf"
cp ./conf/cert.pem ./conf/key.pem ./testdata/conf/
cp ./conf/cert.pem ./conf/key.pem ./testdata/conf/
##
## 执行所有pkg里的单元测试并生成测试覆盖文件
echo "" > coverage.txt
for d in $(go list ./... | grep -v vendor | grep pkg | grep -v innertest); do
go test -race -coverprofile=profile.out -covermode=atomic $d
@ -63,8 +63,8 @@ for d in $(go list ./... | grep -v vendor | grep pkg | grep -v innertest); do
fi
done
rm -rf ./pkg/logic/logs ./pkg/rtmp/logs ./pkg/httpflv/logs ./pkg/hls/logs
rm -rf ./pkg/logic/testdata ./pkg/rtmp/testdata ./pkg/httpflv/testdata ./pkg/hls/testdata
rm -rf ./pkg/logic/lal_record ./pkg/rtmp/lal_record ./pkg/httpflv/lal_record ./pkg/hls/lal_record
## 删除测试生成的垃圾文件
find ./pkg -name 'lal_record' | xargs rm -rf
find ./pkg -name 'logs' | xargs rm -rf
echo 'done.'

Loading…
Cancel
Save