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

SRS5: Test: Support blackbox test by FFmpeg. v5.0.128 (#3355)

1. Enable blackbox test for each PR and push.
2. Refine Makefile and README for srs-bench.
3. Add blackbox using FFmpeg and ffprobe.
4. Add blackbox basic test for RTMP stream.
5. Add blackbox basic test for HTTP-FLV stream.
6. Fix utest rand seed issue.

PICK 2141d220b4
This commit is contained in:
Winlin 2023-01-02 15:33:17 +08:00 committed by winlin
parent e1f6661d1f
commit 4c2db0073a
10 changed files with 1421 additions and 51 deletions

View file

@ -3,27 +3,56 @@
default: bench test
clean:
rm -f ./objs/srs_bench ./objs/srs_test ./objs/srs_gb28181_test
rm -rf ./objs
.format.txt: *.go srs/*.go vnet/*.go janus/*.go gb28181/*.go
#########################################################################################################
# SRS benchmark tool for SRS, janus, GB28181.
./objs/.format.bench.txt: *.go srs/*.go vnet/*.go janus/*.go gb28181/*.go
gofmt -w .
echo "done" > .format.txt
mkdir -p objs && echo "done" > ./objs/.format.bench.txt
bench: ./objs/srs_bench
./objs/srs_bench: .format.txt *.go srs/*.go vnet/*.go janus/*.go gb28181/*.go Makefile
./objs/srs_bench: ./objs/.format.bench.txt *.go srs/*.go vnet/*.go janus/*.go gb28181/*.go Makefile
go build -mod=vendor -o objs/srs_bench .
test: ./objs/srs_test ./objs/srs_gb28181_test
#########################################################################################################
# For all regression tests.
test: ./objs/srs_test ./objs/srs_gb28181_test ./objs/srs_blackbox_test
./objs/srs_test: .format.txt *.go srs/*.go vnet/*.go Makefile
#########################################################################################################
# For SRS regression test.
./objs/.format.srs.txt: srs/*.go vnet/*.go
gofmt -w srs vnet
mkdir -p objs && echo "done" > ./objs/.format.srs.txt
./objs/srs_test: ./objs/.format.srs.txt *.go srs/*.go vnet/*.go Makefile
go test ./srs -mod=vendor -c -o ./objs/srs_test
./objs/srs_gb28181_test: .format.txt *.go gb28181/*.go Makefile
#########################################################################################################
# For gb28181 test.
./objs/.format.gb28181.txt: gb28181/*.go
gofmt -w gb28181
mkdir -p objs && echo "done" > ./objs/.format.gb28181.txt
./objs/srs_gb28181_test: ./objs/.format.gb28181.txt *.go gb28181/*.go Makefile
go test ./gb28181 -mod=vendor -c -o ./objs/srs_gb28181_test
help:
@echo "Usage: make [bench|test]"
@echo " bench Make the bench to ./objs/srs_bench"
@echo " test Make the test tool to ./objs/srs_test and ./objs/srs_gb28181_test"
#########################################################################################################
# For blackbox test.
./objs/.format.blackbox.txt: blackbox/*.go
gofmt -w blackbox
mkdir -p objs && echo "done" > ./objs/.format.blackbox.txt
./objs/srs_blackbox_test: ./objs/.format.blackbox.txt *.go blackbox/*.go Makefile
go test ./blackbox -mod=vendor -c -o ./objs/srs_blackbox_test
#########################################################################################################
# Help menu.
help:
@echo "Usage: make [default|bench|test|clean]"
@echo " default The default entry for make is bench+test"
@echo " bench Make the bench to ./objs/srs_bench"
@echo " test Make the test tool to ./objs/srs_test and ./objs/srs_gb28181_test ./objs/srs_blackbox_test"
@echo " clean Remove all tools at ./objs"